ARMv8: Store status register on interrupt
authorLukas Humbel <lukas.humbel@inf.ethz.ch>
Tue, 18 Apr 2017 08:59:00 +0000 (10:59 +0200)
committerLukas Humbel <lukas.humbel@inf.ethz.ch>
Tue, 18 Apr 2017 08:59:00 +0000 (10:59 +0200)
Signed-off-by: Lukas Humbel <lukas.humbel@inf.ethz.ch>

kernel/arch/armv8/exn.c

index 59de200..80d9343 100644 (file)
@@ -205,14 +205,15 @@ void handle_irq(arch_registers_state_t* save_area, uintptr_t fault_pc,
 {
     uint32_t irq = 0;
 
-    /* The assembly stub leaves the first 4 registers, the stack pointer, and
-     * the exception PC for us to save, as it's run out of room for the
-     * necessary instructions. */
+    /* The assembly stub leaves the first 4 registers, the stack pointer, 
+     * the exception PC, and the SPSR for us to save, as it's run out of room for
+     * the necessary instructions. */
     save_area->named.x0    = x0;
     save_area->named.x1    = x1;
     save_area->named.x2    = x2;
     save_area->named.x3    = x3;
     save_area->named.stack = armv8_SP_EL0_rd(NULL);
+    save_area->named.spsr  = armv8_SPSR_EL1_rd(NULL);
     save_area->named.pc    = fault_pc;
 
     irq = gicv3_get_active_irq();