Showing changes from revision #1 to #2:
Added | Removed | Changed
The undefined instruction handler is entered in the following state:
If the handler is capable of handling the exception (e.g. by emulating the instruction) then it can resume execution by performing a suitable exception return operation.
On 26bit OS versions, the CPU will be in SVC26 mode, with R14 containing the combined LR+PSR.
The kernel’s default handler will save a copy of the ARM integer registers (corresponding to the CPU mode the exception occurred in) to the Exception Registers Block, reset the stack pointers for all the privileged CPU modes, and then call OS_GenerateError to report an Undefined Instruction error.
It is possible for nested aborts to occur (typically data aborts or prefetch aborts), e.g. as a result of interacting with pages which are subject to lazy task swapping. Where necessary, care should be taken to ensure your abort handler can deal with this, e.g. by making a copy of R14_und and SPSR_und prior to performing any action which could trigger a nested abort.