Important: The information in this document is obsolete and should not be used for new development.
Chapter 4 - Memory Management Utilities
This chapter describes a number of utility routines you can use to control certain aspects of the memory environment in Macintosh computers. Some features of the memory environment are controlled by the user through the Memory control panel; others are controlled by the Process Manager or other parts of the Macintosh Operating System and Toolbox. The utility routines described in this chapter allow you to modify some of the normal operations of the Operating System or the Toolbox.You need to read this chapter if your application or driver
To use this chapter, you should be familiar with the information in the chapter "Introduction to Memory Management" earlier in this book. Also, you can read the chapter "Introduction to Processes and Tasks" in Inside Macintosh: Processes for a related discussion of the A5 register.
- installs completion routines or interrupt tasks that are executed by the Operating System or Toolbox, not directly by your application
- modifies the addressing mode or converts addresses from one form to another
- moves executable code in memory, or performs DMA operations
This chapter begins with a brief description of the Memory control panel, which allows users to alter several aspects of the Operating System's memory configuration. Then it shows how you can use the Memory Management Utilities to
- set up the A5 register so that your application-defined completion routines and interrupt tasks can access your application's global variables
- get the value of the A5 register so that you can read your application's QuickDraw global variables from within stand-alone code
- get or set a computer's address-translation mode
- strip the flag bits from a master pointer or other memory address
- convert 24-bit addresses to 32-bit addresses
- flush the microprocessor's instruction and data caches
Chapter Contents
- The Memory Control Panel
- About the Memory Management Utilities
- The A5 Register
- Addressing Modes
- Address Translation
- Processor Caches
- Stale Instructions
- Stale Data
- Using the Memory Management Utilities
- Accessing the A5 World in Completion Routines
- Accessing the A5 World in Interrupt Tasks
- Using QuickDraw Global Variables in Stand-Alone Code
- Switching Addressing Modes
- Stripping Flag Bits From Memory Addresses
- Translating Memory Addresses
- Memory Management Utilities Reference
- Routines
- Setting and Restoring the A5 Register
- Changing the Addressing Mode
- Manipulating Memory Addresses
- Manipulating the Processor Caches
- Summary of the Memory Management Utilities
- Pascal Summary
- Constants
- Routines
- C Summary
- Constants
- Routines
- Assembly-Language Summary
- Trap Macros
- Global Variables
- Result Codes