Documentation Archive Developer
Search

ADC Home > Reference Library > Technical Q&As > Legacy Documents > Hardware & Drivers >

Legacy Documentclose button

Important: This document is part of the Legacy section of the ADC Reference Library. This information should not be used for new development.

Current information on this Reference Library topic can be found here:

Calling ataManager on a Power Macintosh


Q: We're working on drivers for the ATA bus in Power Macintosh computers. However, we can't seem to find the link libraries on our ETO disks. The header libraries are there, but there is nothing to link to.

A: Classic 68K code calls ATA Manager through inline trap glue and does not need a link library. CFM (PowerPC and CFM-68K) code needs to used Mixed Mode glue to call the ataManager trap. The following code should do:

#include <MixedMode.h>
#include <Patches.h>
#include <ATA.h>
 
extern pascal SInt16 ataManager(ataPB *pb)
{
    return CallUniversalProc(
                GetToolboxTrapAddress(0xAAF1),
                kPascalStackBased
                | RESULT_SIZE(SIZE_CODE(sizeof(SInt16)))
                | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(pb))),
                pb);
}

[Sep 21 1998]