14 * Macro for exception prologue.
15 * Offset -> offset to PC, to the particular instruction to return to.
17 .macro EXCEPTION_PROLOGUE offset, switch_mode
18 # Adjust LR to offset.
21 // Save SPSR and LR onto the SVC stack.
24 // Switch to SVC mode, interrupts disabled.
27 // Save registers (r0 - r15) on stack.
32 // First argument is pointer to the structure above.
37 * Macro for exception epilogue.
39 .macro EXCEPTION_EPILOGUE
40 // Get back registers (r0 - r14), while skipping r15, from stack.
42 // Get back up 64 bytes.
45 // Return from exception (via the SPSR and LR we saved before).
50 #error ARM versions below ARMv6 not supported yet.
54 * Stub (for all exceptions I haven't bothered with yet).
58 EXCEPTION_PROLOGUE #0, #1