Showing changes from revision #6 to #7:
Added | Removed | Changed
Entry | |
---|---|
R8 | Reason code (bits 0-7) and flags (bits 8-31) |
- | Other register meanings dependent on R8 |
Exit | |
---|---|
- | Depends on R8 |
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.
Entry | |
---|---|
R0-R7 | Parameters for hardware routine |
R8 | 0 |
R9 | Hardware call number |
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.
Error &6C1 (Hardware call not available) is returned if the requested call is unknown by this kernel/HAL version or is a null entry (was implemented as a ‘MOV pc,lr’ within the HAL)
Entry | |
---|---|
R8 | 1 |
R9 | Hardware call number |
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 calling standards documentation for more details of calling conditions.
Error &6C1 (Hardware call not available) is returned if the requested call is unknown by this kernel/HAL version or is a null entry (was implemented as a ‘MOV pc,lr’ within the HAL)
Entry | |
---|---|
R0 | Pointer to device descriptor |
R8 | 2 |
Exit | |
---|---|
- | All registers preserved |
Declare a new device to the system. If a device with that address is already registered, an attempt will be made to first remove it.
Entry | |
---|---|
R0 | Pointer to device descriptor |
R8 | 3 |
Exit | |
---|---|
- | All registers preserved |
Removes a device from the system.
Entry | |
---|---|
R0 | Bits 0-15 = type to match |
Bits 16-31 = maximum major version number to match | |
R1 | 0 to start an enumeration, else preserved from last call |
R8 | 4 |
Exit | |
---|---|
R1 | -1 if there are no (more) devices of this type |
R2 | Pointer to device descriptor (undefined if R1 = -1) |
- | Other registers preserved |
Enumerates the device list, searching for devices of a particular type. Devices will be returned in the opposite order to the order they were registered.
Entry | |
---|---|
R0 | Bits 0-15 = type to match |
Bits 16-31 = maximum major version number to match | |
R1 | 0 to start an enumeration, else preserved from last call |
R8 | 5 |
Exit | |
---|---|
R1 | -1 if there are no (more) devices of this type |
R2 | Pointer to device descriptor (undefined if R1 = -1) |
- | Other registers preserved |
Enumerates the device list, searching for devices of a particular type. Devices will be returned in the same order as they were registered.
This call first became available in RISC OS 5.19.