summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAnup Patel <anup.patel@wdc.com>2018-12-21 11:36:17 +0300
committerAnup Patel <anup@brainfault.org>2018-12-21 12:24:06 +0300
commit1bfa2445059a4248f82f097a94e4746b5adf2137 (patch)
tree5bb4e9cb75e7f3d07bf42efcf55ef9dfe0c37714 /lib
parente1e8f1813080958ed3547e0cd03f940859f20a60 (diff)
downloadopensbi-1bfa2445059a4248f82f097a94e4746b5adf2137.tar.xz
lib: Fix delegate_traps() for Linux boot
commit d403c70fb11fb55042ca3cef0dbe399ed87cc79b breaks Linux booting because of fewer exceptions delegated to S-mode. This patch fixes Linux booting by having all required exceptions delegated to S-mode. Signed-off-by: Anup Patel <anup.patel@wdc.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/sbi_hart.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/sbi_hart.c b/lib/sbi_hart.c
index 09739b9..fae82c9 100644
--- a/lib/sbi_hart.c
+++ b/lib/sbi_hart.c
@@ -95,7 +95,10 @@ static int delegate_traps(u32 hartid)
/* Send M-mode interrupts and most exceptions to S-mode */
interrupts = MIP_SSIP | MIP_STIP | MIP_SEIP;
exceptions = (1U << CAUSE_MISALIGNED_FETCH) |
+ (1U << CAUSE_FETCH_PAGE_FAULT) |
(1U << CAUSE_BREAKPOINT) |
+ (1U << CAUSE_LOAD_PAGE_FAULT) |
+ (1U << CAUSE_STORE_PAGE_FAULT) |
(1U << CAUSE_USER_ECALL);
}