summaryrefslogtreecommitdiff
path: root/arch/riscv/lib/interrupts.c
diff options
context:
space:
mode:
authorAnton Blanchard <antonb@tenstorrent.com>2024-08-08 02:14:17 +0000
committerLeo Yu-Chi Liang <ycliang@andestech.com>2024-10-29 19:58:14 +0800
commit8e1acda14ea0ac08a77ea7d3d40ab7255ccbe4c5 (patch)
treeee007052b3eda1aa665741fecb69f2de7a4234df /arch/riscv/lib/interrupts.c
parent9d688e6da5c97fc7758bfa2367fe29cb75ae4868 (diff)
riscv: resume needs to be a global
If we take an exception before u-boot is relocated, there's a good chance we will end up in an endless loop of exceptions because resume is invalid until after relocation. Signed-off-by: Anton Blanchard <antonb@tenstorrent.com> Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
Diffstat (limited to 'arch/riscv/lib/interrupts.c')
-rw-r--r--arch/riscv/lib/interrupts.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/arch/riscv/lib/interrupts.c b/arch/riscv/lib/interrupts.c
index 714cc92d03e..ef1056eeb6f 100644
--- a/arch/riscv/lib/interrupts.c
+++ b/arch/riscv/lib/interrupts.c
@@ -22,11 +22,9 @@
DECLARE_GLOBAL_DATA_PTR;
-static struct resume_data *resume;
-
void set_resume(struct resume_data *data)
{
- resume = data;
+ gd->arch.resume = data;
}
static void show_efi_loaded_images(uintptr_t epc)
@@ -138,9 +136,9 @@ static void _exit_trap(ulong code, ulong epc, ulong tval, struct pt_regs *regs)
"Store/AMO page fault",
};
- if (resume) {
- resume->code = code;
- longjmp(resume->jump, 1);
+ if (gd->arch.resume) {
+ gd->arch.resume->code = code;
+ longjmp(gd->arch.resume->jump, 1);
}
if (code < ARRAY_SIZE(exception_code))