RISC OS Open
Safeguarding the past, present and future of RISC OS for everyone
ROOL
Home | News | Downloads | Bugs | Bounties | Forum | Documents | Photos | Contact us
Account

OS_ClaimProcessorVector

OS SWI Calls
» OS_ClaimProcessorVector

OS_ClaimProcessorVector

(SWI &69)
Entry
R0 bits 0-7: Vector number
bit 8: 0 to release, or 1 to claim
bits 9-31: reserved
R1 Address of replacement routine
R2 If releasing: Address of your routine
Exit
R0 Preserved
R1 If claiming, address of original routine, else preserved
R2 Preserved

Use

The purpose of this call is to claim a processor vector.

Notes

This call is used to allow low-level code to claim the ARM’s hardware vectors which are called when interrupts and aborts occur.

The address of your routine must be provided on release to ensure claims and releases happen in the correct order. If the address currently on the vector differs from that in R2, an error is returned.

The FIQ vector cannot be claimed through this call. Instead, Service_ClaimFIQ or Service_ClaimFIQinBackground must be used.

Routines installed via OS_ClaimProcessorVector are entered directly from the corresponding hardware vector. This means that:

  • On 26bit OS versions, they will be entered in a 32bit CPU mode.
  • Data and prefetch abort handlers need to be careful about accessing application space; if lazy task swapping is enabled this may trigger a recursive abort, potentially leaving the machine stuck in an abort loop.
  • On ARMv6 and newer, care is needed to ensure the “exclusive monitor” is left in a safe state. See the ARM ARM or the Hardware Vectors documentation for more detail.

This SWI is only available on RISC OS 3.5 and later. To claim a processor vector on earlier OS versions, you must directly patch the processor vector table at &0. If your code needs to pass on to the previous claimant then care will be needed to make sure you decode the old handler instruction correctly (typically it will either be a branch instruction or a PC-relative LDR of the PC)

See also

  • Processor Vector Numbers
  • Service_ClaimFIQ
  • Service_ClaimFIQinBackground
Revised on June 13, 2018 13:35:14 by Jeffrey Lee (213) (62.252.28.250)
Edit | Back in time (5 revisions) | See changes | History | Views: Print | Source | Linked from: OS_AbortTrap, OS SWI Calls, Processor Vector Numbers, Hardware Vectors, Kernel notes, OS SWI Calls (français)

Search the Wiki

Social

Follow us on and

ROOL Store

Buy RISC OS Open merchandise here, including SD cards for Raspberry Pi and more.

Donate! Why?

Help ROOL make things happen – please consider donating!

RISC OS IPR

RISC OS is an Open Source operating system owned by RISC OS Developments Ltd and licensed primarily under the Apache 2.0 license.

Navigation

  • Home Page
  • All Pages
  • Recently Revised
  • Authors
  • Feeds
Site design © RISC OS Open Limited 2018 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