diff options
Diffstat (limited to 'spm/cactus/aarch64/cactus_exceptions.S')
-rw-r--r-- | spm/cactus/aarch64/cactus_exceptions.S | 39 |
1 files changed, 28 insertions, 11 deletions
diff --git a/spm/cactus/aarch64/cactus_exceptions.S b/spm/cactus/aarch64/cactus_exceptions.S index 31cdbf9a5..06df31c93 100644 --- a/spm/cactus/aarch64/cactus_exceptions.S +++ b/spm/cactus/aarch64/cactus_exceptions.S @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, Arm Limited. All rights reserved. + * Copyright (c) 2021-2022, Arm Limited. All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause */ @@ -18,6 +18,15 @@ end_vector_entry \name .endm +.macro interrupt_vector _type + sub sp, sp, #0x100 + save_gp_regs + bl cactus_interrupt_handler_\_type + restore_gp_regs + add sp, sp, #0x100 + eret +.endm + vector_base cactus_vector /* @@ -31,7 +40,9 @@ unhandled_exception serr_sp0 /* * Current EL with SPx : 0x200 - 0x400. */ -unhandled_exception sync_spx +vector_entry sync_spx + b sync_exception_vector_entry +end_vector_entry sync_spx vector_entry irq_spx b irq_vector_entry @@ -98,22 +109,28 @@ unhandled_exception serr_a32 ldp x0, x1, [sp, #0x0] .endm -func irq_vector_entry +func sync_exception_vector_entry sub sp, sp, #0x100 save_gp_regs - bl cactus_irq_handler - restore_gp_regs + mov x19, sp + bl tftf_sync_exception_handler + cbnz x0, 0f + mov x0, x19 + /* Save original stack pointer value on the stack */ + add x1, x0, #0x100 + str x1, [x0, #0xf8] + b print_exception +0: restore_gp_regs add sp, sp, #0x100 eret +endfunc sync_exception_vector_entry + +func irq_vector_entry + interrupt_vector irq endfunc irq_vector_entry func fiq_vector_entry - sub sp, sp, #0x100 - save_gp_regs - bl cactus_fiq_handler - restore_gp_regs - add sp, sp, #0x100 - eret + interrupt_vector fiq endfunc fiq_vector_entry func crash_dump |