Important: The information in this document is obsolete and should not be used for new development.
Summary of the Memory Management Utilities
Pascal Summary
Constants
CONST {Gestalt constants} gestaltAddressingModeAttr = 'addr'; {addressing mode attributes} gestalt32BitAddressing = 0; {started in 32-bit mode} gestalt32BitSysZone = 1; {32-bit compatible sys. zone} gestalt32BitCapable = 2; {machine is 32-bit capable} {addressing mode constants} false32b = 0; {24-bit addressing mode} true32b = 1; {32-bit addressing mode}Routines
Setting and Restoring the A5 Register
FUNCTION SetCurrentA5 : LongInt; FUNCTION SetA5 (newA5: LongInt): LongInt;Changing the Addressing Mode
FUNCTION GetMMUMode :SignedByte; PROCEDURE SwapMMUMode (VAR mode: SignedByte);Manipulating Memory Addresses
FUNCTION StripAddress (address: UNIV Ptr): Ptr; FUNCTION Translate24To32 (addr24: UNIV Ptr): Ptr;Manipulating the Processor Caches
FUNCTION SwapInstructionCache (cacheEnable: Boolean): Boolean; PROCEDURE FlushInstructionCache; FUNCTION SwapDataCache (cacheEnable: Boolean): Boolean; PROCEDURE FlushDataCache; PROCEDURE FlushCodeCache; FUNCTION FlushCodeCacheRange (address: UNIV Ptr; count: LongInt): OSErr;C Summary
Constants
/*Gestalt constants*/ #define gestaltAddressingModeAttr 'addr'; /*addressing mode attributes*/ #define gestalt32BitAddressing 0; /*started in 32-bit mode*/ #define gestalt32BitSysZone 1; /*32-bit compatible sys. zone*/ #define gestalt32BitCapable 2; /*machine is 32-bit capable*/ /*addressing mode constants*/ enum {false32b = 0}; /*24-bit addressing mode*/ enum {true32b = 1}; /*32-bit addressing mode*/Routines
Setting and Restoring the A5 Register
long SetCurrentA5 (void); long SetA5 (long newA5);Changing the Addressing Mode
pascal char GetMMUMode (void); pascal void SwapMMUMode (char *mode);Manipulating Memory Addresses
pascal Ptr StripAddress (Ptr address); pascal Ptr Translate24To32 (Ptr addr24);Manipulating the Processor Caches
pascal Boolean SwapInstructionCache (Boolean cacheEnable); pascal void FlushInstructionCache (void); pascal Boolean SwapDataCache(Boolean cacheEnable); pascal void FlushDataCache (void); void FlushCodeCache (void); OSErr FlushCodeCacheRange (void *address, unsigned long count);Assembly-Language Summary
Trap Macros
Trap Macros Requiring Routine Selectors
_HWPriv
Selector Routine $0000 SwapInstructionCache $0001 FlushInstructionCache $0002 SwapDataCache $0003 FlushDataCache $0009 FlushCodeCacheRange Global Variables
CurrentA5 long Address of the boundary between the application global variables and the application parameters of the current application. MMU32Bit byte
TRUE
if 32-bit addressing mode is in effect.Result Codes
noErr 0 No error hwParamErr -502 Processor does not support flushing a range