|
@@ -6,7 +6,7 @@
|
|
|
|
|
|
.section .text.vector_table
|
|
|
|
|
|
-#define TRAP_FRAME_SIZE 272
|
|
|
+#define REGISTER_STATE_SIZE 272
|
|
|
#define SPSR_EL1_SLOT (31 * 8)
|
|
|
#define ELR_EL1_SLOT (32 * 8)
|
|
|
#define TPIDR_EL0_SLOT (33 * 8)
|
|
@@ -34,7 +34,7 @@
|
|
|
//
|
|
|
.macro save_current_context
|
|
|
// Allocate stack space for Trap Frame
|
|
|
- sub sp, sp, #TRAP_FRAME_SIZE
|
|
|
+ sub sp, sp, #REGISTER_STATE_SIZE
|
|
|
|
|
|
stp x0, x1, [sp, #(0 * 0)]
|
|
|
stp x2, x3, [sp, #(2 * 8)]
|
|
@@ -60,10 +60,12 @@
|
|
|
str x0, [sp, #ELR_EL1_SLOT]
|
|
|
mrs x0, tpidr_el0
|
|
|
str x0, [sp, #TPIDR_EL0_SLOT]
|
|
|
+ mrs x0, sp_el0
|
|
|
+ str x0, [sp, #SP_EL0_SLOT]
|
|
|
|
|
|
// Set up TrapFrame struct on the stack
|
|
|
- sub sp, sp, #16
|
|
|
mov x0, sp
|
|
|
+ sub sp, sp, #16
|
|
|
str x0, [sp, #(1 * 8)]
|
|
|
str xzr, [sp, #(0 * 0)]
|
|
|
|
|
@@ -83,6 +85,8 @@
|
|
|
msr elr_el1, x0
|
|
|
ldr x0, [sp, #TPIDR_EL0_SLOT]
|
|
|
msr tpidr_el0, x0
|
|
|
+ ldr x0, [sp, #SP_EL0_SLOT]
|
|
|
+ msr sp_el0, x0
|
|
|
|
|
|
ldp x0, x1, [sp, #(0 * 0)]
|
|
|
ldp x2, x3, [sp, #(2 * 8)]
|
|
@@ -101,7 +105,7 @@
|
|
|
ldp x28, x29, [sp, #(28 * 8)]
|
|
|
ldr x30, [sp, #(30 * 8)]
|
|
|
|
|
|
- add sp, sp, #TRAP_FRAME_SIZE
|
|
|
+ add sp, sp, #REGISTER_STATE_SIZE
|
|
|
.endm
|
|
|
|
|
|
.global vector_table_el1
|
|
@@ -143,7 +147,7 @@ synchronous_current_elsp_elx:
|
|
|
|
|
|
irq_current_elsp_elx:
|
|
|
save_current_context
|
|
|
- bl exception_common
|
|
|
+ bl handle_interrupt
|
|
|
restore_previous_context
|
|
|
eret
|
|
|
|
|
@@ -166,10 +170,6 @@ synchronous_current_elsp_el0:
|
|
|
eret
|
|
|
|
|
|
irq_current_elsp_el0:
|
|
|
- // An IRQ will always switch the stack pointer to SP_EL1, however we want to use SP_EL0, so switch
|
|
|
- // to SP_EL0. This means that the stack of the currently executing thread is used as the irq stack.
|
|
|
- msr SPSel, #0
|
|
|
-
|
|
|
save_current_context
|
|
|
bl handle_interrupt
|
|
|
restore_previous_context
|