Important: The information in this document is obsolete and should not be used for new development.
DeferUserFn
To determine whether code that might cause page faults can safely be called immediately, use theDeferUserFn
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
TheDeferUserFn
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 byuserFunction
with register A0 containing the value designated byargument
. 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 theDeferUserFn
function are
Registers on entry A0 Address of function D0 Argument for function
Registers on exit D0 Result code RESULT CODES
noErr 0 No error cannotDeferErr -625 Unable to defer additional user functions