diff options
author | Alexander Graf <agraf@suse.de> | 2016-03-04 01:10:12 +0100 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2016-03-15 21:30:13 -0400 |
commit | cc4a474873ecf79775bef6b2e73a8b0c7e13b95f (patch) | |
tree | fbd4f28535b6bb3498684eb64435fcdc31f15e17 | |
parent | da3e620d68ba06d7cb501f4756db7a3caf90e215 (diff) |
arm: Allow EFI payload code to take exceptions
There are 2 ways an EFI payload could return into u-boot:
- Callback function
- Exception
While in EFI payload mode, r9 is owned by the payload and may not contain
a valid pointer to gd, so we need to fix it up. We do that properly for the
payload to callback path already.
This patch also adds gd pointer restoral for the exception path.
Signed-off-by: Alexander Graf <agraf@suse.de>
-rw-r--r-- | arch/arm/lib/interrupts.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/arch/arm/lib/interrupts.c b/arch/arm/lib/interrupts.c index ec3fb77f85..ed83043abb 100644 --- a/arch/arm/lib/interrupts.c +++ b/arch/arm/lib/interrupts.c @@ -22,6 +22,7 @@ #include <common.h> #include <asm/proc-armv/ptrace.h> #include <asm/u-boot-arm.h> +#include <efi_loader.h> DECLARE_GLOBAL_DATA_PTR; @@ -165,6 +166,7 @@ void show_regs (struct pt_regs *regs) void do_undefined_instruction (struct pt_regs *pt_regs) { + efi_restore_gd(); printf ("undefined instruction\n"); show_regs (pt_regs); bad_mode (); @@ -172,6 +174,7 @@ void do_undefined_instruction (struct pt_regs *pt_regs) void do_software_interrupt (struct pt_regs *pt_regs) { + efi_restore_gd(); printf ("software interrupt\n"); show_regs (pt_regs); bad_mode (); @@ -179,6 +182,7 @@ void do_software_interrupt (struct pt_regs *pt_regs) void do_prefetch_abort (struct pt_regs *pt_regs) { + efi_restore_gd(); printf ("prefetch abort\n"); show_regs (pt_regs); bad_mode (); @@ -186,6 +190,7 @@ void do_prefetch_abort (struct pt_regs *pt_regs) void do_data_abort (struct pt_regs *pt_regs) { + efi_restore_gd(); printf ("data abort\n"); show_regs (pt_regs); bad_mode (); @@ -193,6 +198,7 @@ void do_data_abort (struct pt_regs *pt_regs) void do_not_used (struct pt_regs *pt_regs) { + efi_restore_gd(); printf ("not used\n"); show_regs (pt_regs); bad_mode (); @@ -200,6 +206,7 @@ void do_not_used (struct pt_regs *pt_regs) void do_fiq (struct pt_regs *pt_regs) { + efi_restore_gd(); printf ("fast interrupt request\n"); show_regs (pt_regs); bad_mode (); @@ -208,6 +215,7 @@ void do_fiq (struct pt_regs *pt_regs) #ifndef CONFIG_USE_IRQ void do_irq (struct pt_regs *pt_regs) { + efi_restore_gd(); printf ("interrupt request\n"); show_regs (pt_regs); bad_mode (); |