Carbon


RoutineDescriptor

Header: MixedMode.h

struct RoutineDescriptor {
    UInt16 goMixedModeTrap; 
    SInt8 version; 
    RDFlagsType routineDescriptorFlags; 
    UInt32 reserved1; 
    UInt8 reserved2; 
    UInt8 selectorInfo; 
    UInt16 routineCount; 
    RoutineRecord routineRecords[1];
};
typedef RoutineDescriptor RoutineDescriptorPtr;

Field descriptions

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.

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, of 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 will 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 “RoutineRecord” for the structure of a routine record. This array is zero-based.

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.

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.


© 2000 Apple Computer, Inc. (Last Updated 6/30/2000)