diff options
author | Kinsey Moore <kinsey.moore@oarcorp.com> | 2020-12-08 09:11:34 -0600 |
---|---|---|
committer | Joel Sherrill <joel@rtems.org> | 2020-12-10 11:37:50 -0600 |
commit | d188e6e88233bd91da5f9985a89cf791cb4fd117 (patch) | |
tree | 5f79aed0a4164664e6b83a8f98e22e1c2f538512 | |
parent | cpukit/aarch64: Use hex consistently for offsets (diff) | |
download | rtems-d188e6e88233bd91da5f9985a89cf791cb4fd117.tar.bz2 |
cpukit/aarch64: Add explanation of exception flow
-rw-r--r-- | cpukit/score/cpu/aarch64/aarch64-exception-default.S | 17 | ||||
-rw-r--r-- | cpukit/score/cpu/aarch64/aarch64-exception-interrupt.S | 4 |
2 files changed, 18 insertions, 3 deletions
diff --git a/cpukit/score/cpu/aarch64/aarch64-exception-default.S b/cpukit/score/cpu/aarch64/aarch64-exception-default.S index 81aa82558e..970ccf735f 100644 --- a/cpukit/score/cpu/aarch64/aarch64-exception-default.S +++ b/cpukit/score/cpu/aarch64/aarch64-exception-default.S @@ -54,7 +54,22 @@ /* * This is the exception vector table and the pointers to the default - * exceptions handlers. + * exceptions handlers. Each vector in the table has space for up to 32 + * instructions. The space of the last two instructions in each vector is used + * for the exception handler pointer. + * + * The operation of all exceptions is as follows: + * * An exception occurs + * * A vector is chosen based on the exception type and machine state + * * Execution begins at the chosen vector + * * X0 and LR are pushed onto the current stack + * * An unconditional branch and link is taken to the next instruction to get + * the PC + * * The exception handler pointer (EHP) is retrieved from the current vector using + * the PC + * * Branch and link to the EHP + * * X0 and LR are popped from the current stack after returning from the EHP + * * The exception returns to the previous execution state */ /* diff --git a/cpukit/score/cpu/aarch64/aarch64-exception-interrupt.S b/cpukit/score/cpu/aarch64/aarch64-exception-interrupt.S index f534a526b3..cb0954a29b 100644 --- a/cpukit/score/cpu/aarch64/aarch64-exception-interrupt.S +++ b/cpukit/score/cpu/aarch64/aarch64-exception-interrupt.S @@ -255,7 +255,7 @@ _AArch64_Exception_interrupt_nest: Save volatile regs on interrupt stack Execute irq handler Restore volatile regs from interrupt stack -Exception return +Return to embedded exception vector code */ /* Push interrupt context */ @@ -281,7 +281,7 @@ Execute interrupt handler Switch to thread stack Call thread dispatch Restore volatile registers from thread stack -Return to dispatch +Return to embedded exception vector code */ |