RISC OS Open
A fast and easily customised operating system for ARM devices
ROOL
Home | News | Software | Bugs | Bounties | Forum | Documents | Photos | Contact us
Account

OS_Hardware

Hardware Abstraction Layer
» Other documentation
» OS_Hardware

OS_Hardware

(SWI &7A)
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.

OS_Hardware 0

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.

OS_Hardware 1

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.

OS_Hardware 2

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.

OS_Hardware 3

Entry
R0 Pointer to device descriptor
R8 3
Exit
- All registers preserved

Removes a device from the system.

OS_Hardware 4

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.

Information sources: Kernel.Docs.HAL.OS_Hardware and Kernel.Docs.HAL.NewAPI in CVS
Revised on March 13, 2010 17:07:00 by W P Blatchley (147)? (127.0.0.1)
Edit | Back in time (4 revisions) | See changes | History | Views: Print | Source | Linked from: Hardware Abstraction Layer, HAL entry points from RISC OS, Other HAL related documentation, HAL entry points by number, OS SWI Calls, OS_IICOp

Search the Wiki

Commercial use

For commercial enquiries, please contact the owners of RISC OS, Castle Technology Ltd.

ROOL Store

The official C/C++ Development kit and more here.

Donate! Why?

Help ROOL make things happen – please consider donating!

Navigation

  • Home Page
  • All Pages
  • Recently Revised
  • Authors
  • Feeds
Site design © RISC OS Open Limited 2011 except where indicated
The RISC OS Open Instiki theme is based on Insitki's default layout

Valid XHTML 1.0  |  Valid CSS

Instiki 0.19.1(MML+)
This site runs on Rails

Hosted by Arachsys