Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Previous Book Contents Book Index Next

Inside Macintosh: PowerPC System Software /
Chapter 2 - Mixed Mode Manager / Mixed Mode Manager Reference
Data Structures


Routine Descriptors

A routine descriptor is a data structure used by the Mixed Mode Manager to execute a routine. The external interface to a routine descriptor is through a universal procedure pointer, of type UniversalProcPtr, which is defined as a procedure pointer (if the code is 680x0 code) or as a pointer to a routine descriptor (if the code is PowerPC code). A routine descriptor is defined by the RoutineDescriptor data type.

struct RoutineDescriptor {
   unsigned short       goMixedModeTrap;  /*mixed-mode A-trap*/
   char                 version;          /*routine descriptor version*/
   RDFlagsType          routineDescriptorFlags;
                                          /*routine descriptor flags*/
   unsigned long        reserved1;        /*reserved*/
   unsigned char        reserved2;        /*reserved*/
   unsigned char        selectorInfo;     /*selector information*/
   short                routineCount;     /*index of last RR in this RD*/
   RoutineRecord        routineRecords[1];/*the individual routines*/
};
typedef struct RoutineDescriptor RoutineDescriptor;
Field Description
goMixedModeTrap
An A-line instruction that is used privately by the Mixed Mode Manager. When the emulator encounters this instruction, it transfers control to the Mixed Mode Manager. This field contains the value $AAFE.
version
The version number of the RoutineDescriptor data type. The current version number is defined by the constant kRoutineDescriptorVersion:
               enum {kRoutineDescriptorVersion = 7};
routineDescriptorFlags
A set of routine descriptor flags. Currently, all the bits in this field should be set to 0, unless you are specifying a routine descriptor for a dispatched routine. See "Routine Descriptor Flags" on page 2-27 for a complete description of these flags.
reserved1
Reserved. This field must initially be 0.
reserved2
Reserved. This field must be 0.
selectorInfo
Reserved. This field must be 0.
routineCount
The index of the final routine record in the following array, routineRecords. Because the routineRecords array is zero-
based, this field does not contain an actual count of the routine records contained in that array. Often, you'll use a routine descriptor to describe a single procedure, in which case this field should contain the value 0. You can, however, construct a routine descriptor that contains pointers to both 680x0 and PowerPC code (known as a "fat" routine descriptor). In that case, this field should contain the value 1.
routineRecords
An array of routine records for the routines described by this routine descriptor. See "Routine Records" on page 2-36 for the structure of a routine record. This array is zero-based.

IMPORTANT

Your application (or other software) should never attempt to guide its execution by inspecting the value in the ISA field of a routine record and jumping to the address in the procDescriptor field.

Previous Book Contents Book Index Next

© Apple Computer, Inc.
3 JUL 1996