diff options
author | Furquan Shaikh <furquan@google.com> | 2014-08-27 21:43:36 -0700 |
---|---|---|
committer | Patrick Georgi <pgeorgi@google.com> | 2015-03-21 13:35:38 +0100 |
commit | 3b1ee0387c70f0b31307f50a5efa5a2b584a3635 (patch) | |
tree | 4f5072c847d94279afdbd35c450e0076736cf4e7 /payloads/libpayload/arch/arm64/exception_asm.S | |
parent | 02efc9413b076d869da86017eff188741d114991 (diff) |
libpayload arm64: Make exceptions work
BUG=chrome-os-partner:31634
BRANCH=None
TEST=test_exc generates and handles exceptions properly
Change-Id: If3ecab93be6d02942b52960ec97edc687bedf64b
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Original-Commit-Id: bba2caae0bd436ba9e5215f5d8606ce8c4987c98
Original-Change-Id: I4abe8a0e426eab2532852179dbb32505353cd0a1
Original-Signed-off-by: Furquan Shaikh <furquan@google.com>
Original-Reviewed-on: https://chromium-review.googlesource.com/214609
Original-Tested-by: Furquan Shaikh <furquan@chromium.org>
Original-Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Original-Commit-Queue: Furquan Shaikh <furquan@chromium.org>
Reviewed-on: http://review.coreboot.org/8783
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Diffstat (limited to 'payloads/libpayload/arch/arm64/exception_asm.S')
-rw-r--r-- | payloads/libpayload/arch/arm64/exception_asm.S | 61 |
1 files changed, 25 insertions, 36 deletions
diff --git a/payloads/libpayload/arch/arm64/exception_asm.S b/payloads/libpayload/arch/arm64/exception_asm.S index c68ba5a7c6..8e69ddad86 100644 --- a/payloads/libpayload/arch/arm64/exception_asm.S +++ b/payloads/libpayload/arch/arm64/exception_asm.S @@ -35,11 +35,13 @@ * Move exception id into x1 * Branch to exception_handler */ -.macro eentry id - stp x30, xzr, [sp, #-16]! - bl exception_prologue - mov x1, \id - bl exception_handler +.macro eentry lbl id + .align 7 +\lbl: + stp x30, xzr, [sp, #-16]! + bl exception_prologue + mov x1, \id + bl exception_handler .endm /* Exception table has 16 entries and each of 128 bytes @@ -51,37 +53,22 @@ .global exception_table exception_table: - .align 7 -sync_el0: - eentry #0 - - .align 7 -irq_el0: - eentry #0 - - .align 7 -fiq_el0: - eentry #0 - - .align 7 -serror_el0: - eentry #0 - - .align 7 -sync_elx: - eentry #1 - - .align 7 -irq_elx: - eentry #2 - - .align 7 -fiq_elx: - eentry #3 - - .align 7 -serror_elx: - eentry #4 +eentry sync_sp0,#0 +eentry irq_sp0,#1 +eentry fiq_sp0,#2 +eentry serror_sp0,#3 +eentry sync_spx,#4 +eentry irq_spx,#5 +eentry fiq_spx,#6 +eentry serror_spx,#7 +eentry sync_elx_64,#8 +eentry irq_elx_64,#9 +eentry fiq_elx_64,#10 +eentry serror_elx_64,#11 +eentry sync_elx_32,#12 +eentry irq_elx_32,#13 +eentry fiq_elx_32,#14 +eentry serror_elx_32,#15 exception_prologue: /* Save all registers x0-x29 */ @@ -119,6 +106,8 @@ exception_handler: /* Pop return address saved on stack */ ldp x0, x1, [sp], #16 + msr elr_el3, x0 + msr esr_el3, x1 /* Pop exception reason saved on stack, followed by regs x0-x30 */ ldp x0, x1, [sp], #16 ldp x2, x3, [sp], #16 |