h6. [[OS SWI Calls]] h6(. » OS_ClaimProcessorVector h2. OS_ClaimProcessorVector h5. (SWI &69) |_<^{width:3em}. Entry | | |/3<^. R0|<^. bits 0-7: [[Processor Vector Numbers|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 | |_<^{width:3em}. Exit | | |<^. R0|<^. Preserved| |<^. R1|<^. If claiming, address of original routine, else preserved | |<^. R2|<^. Preserved| h4. Use The purpose of this call is to claim a processor vector. h4. 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) h4. See also * [[Processor Vector Numbers]] * [[Service_ClaimFIQ]] * [[Service_ClaimFIQinBackground]]