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: Memory /
Chapter 3 - Virtual Memory Manager / Virtual Memory Manager Reference
Routines / Virtual Memory Management


DeferUserFn

To determine whether code that might cause page faults can safely be called immediately, use the DeferUserFn function.

FUNCTION DeferUserFn (userFunction: ProcPtr; 
                        argument: UNIV Ptr): OSErr;
userFunction

The address of the routine to run.
argument
A pointer to the argument to pass to the specified routine.
DESCRIPTION
The DeferUserFn function determines whether or not code that might call page faults can safely be called immediately. If the code can be called safely, DeferUserFn calls the routine designated by userFunction with register A0 containing the value designated by argument. If a page fault is in progress, however, the routine address and its parameter are saved, and the routine is deferred until page faults are again permitted.

Note that the routine might be called immediately (before returning to the caller of DeferUserFn). Deferred functions must follow the register conventions used by interrupt handlers: they can use registers A0-A3 and D0-D3, and they must restore all other registers used.

ASSEMBLY-LANGUAGE INFORMATION
The registers on entry and exit for the DeferUserFn function are
Registers on entry
A0Address of function
D0Argument for function
Registers on exit
D0Result code

RESULT CODES
noErr0No error
cannotDeferErr-625Unable to defer additional user functions

Previous Book Contents Book Index Next

© Apple Computer, Inc.
3 JUL 1996