arm: AArch64: Add support for nested exception handlers

In the current implementation both SPSR and ELR registers are saved with
the callee-saved registers and restored by the context-switch routine.
To support nested IRQs we have to save those on the stack when entering
and exiting from an ISR.

Since the values are now carried on the stack we can now add those to
the ESF and the initial stack and take care to restore them for new
threads using the new thread wrapper routine.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
This commit is contained in:
Carlo Caione 2020-03-23 11:49:58 +01:00 committed by Ioannis Glaropoulos
commit 99a8155914
8 changed files with 116 additions and 51 deletions

View file

@ -27,6 +27,8 @@ extern "C" {
struct __esf {
struct __basic_sf {
u64_t regs[20];
u64_t spsr;
u64_t elr;
} basic;
};

View file

@ -35,8 +35,6 @@ struct _callee_saved {
u64_t x28;
u64_t x29; /* FP */
u64_t x30; /* LR */
u64_t spsr;
u64_t elr;
u64_t sp;
};