SWI OS_Hardware (SWI &7A) ------------------------- On entry: R0-R7 parameters R8 = reason code (bits 0-7) and flags (bits 8-31) R9 = hardware call number On exit: depends on flags This SWI provides access to the hardware layer. Conceptually, it is similar to accessing the hardware registers directly in earlier versions of RISC OS - whereever possible OS routines should be used in preference. This call is primarily designed for the use of device drivers - for example the PS2Driver module makes PS2 hardware calls using this interface. Making hardware calls to devices normally managed by the Kernel is liable to cause the same problems as poking the hardware. However, making hardware calls is of course preferable to actually accessing the hardware directly. Use this interface with caution. SWI OS_Hardware 0 (SWI &7A) --------------------------- On entry: R0-R7 parameters for hardware routine R8 = 0 R9 = hardware call number On exit: R0-R3 updated by call R4-R9 preserved. This SWI calls a HAL routine. HAL routines internally are ATPCS, so R0-R3 are passed in as a1-a4, and R4-R7 are pushed on to the stack. The a1-a4 on exit from the routine are passed back in R0-R3. If the HAL routine is not available, an error is returned. Actual HAL routines do not return RISC OS errors - any possible failure will be indicated in a call-specific manner. SWI OS_Hardware 1 (SWI &7A) --------------------------- On entry: R8 = 1 R9 = hardware call number On exit: R0 = routine address R1 = static base value for routine This call looks up the address of a HAL routine. If it does not exist, an error is returned. Otherwise, the address of the routine is returned in R0. Calls made to the routine should be in a privileged mode, with R9 (sb) set to the static base value returned by this SWI. Refer to the HAL documentation for more details of calling conditions.