aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/lib/interrupts.zig7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/lib/interrupts.zig b/src/lib/interrupts.zig
index ebb6e9a..a91e079 100644
--- a/src/lib/interrupts.zig
+++ b/src/lib/interrupts.zig
@@ -93,6 +93,7 @@ export fn handleTrap(epc: usize, tval: usize, cause_bits: usize, frame: *trap.Fr
const w = console.writer();
const status = instructions.sstatus.read();
+
const cause: Cause = @bitCast(cause_bits);
if (cause.isAsync()) {
@@ -226,10 +227,16 @@ export fn supervisorTrapVector() align(4) callconv(.Naked) noreturn {
\\
\\ csrw sscratch, t5
\\
+ \\ .option push
+ \\ .option norelax
+ \\ la gp, _global_pointer
+ \\ .option pop
+ \\
\\ csrr a0, sepc
\\ csrr a1, stval
\\ csrr a2, scause
\\ mv a3, t5
+ \\
\\ la sp, _stvec_stack_end
\\ call handleTrap
\\