XHDI Function Calling Procedure
Calling Procedure
All the
XHDI functions must be called in
supervisor mode, otherwise their effect is undefined.
The contents of the
XHDI_Cookie may change over time, especially when more than one
XHDI driver is installed. Therefore, in some applications, the cookie contents must be checked before every call to the handler.
Parameters
Parameters are passed the same way as to
GEMDOS functions. All values are put onto the stack, with the 16 bit opcode last, i.e. at the lowest address. The 32 bit result is returned in
d0.
Wherever it is specified that "the caller may pass a zero pointer" for a pointer parameter, then passing such a zero pointer (NULL) indicates that the caller is not interested in the value to be returned. Drivers must always check pointers for zero before dereferencing them.
Upon Return
- All processor registers except d0 are preserved.
- EINVFN? is returned for invalid opcodes (see XHDIErrorCodes).
- Some of the function calls — notably XHReadWrite() — might be implemented by calls to BIOS or XBIOS functions and therefore can activate the "Critical Error Handler". It's the responsibility of the caller to switch of the "Critical Error Handler", if this is needed.
See Also