aboutsummaryrefslogtreecommitdiff
path: root/isa/rv64si/scall.S
diff options
context:
space:
mode:
Diffstat (limited to 'isa/rv64si/scall.S')
-rw-r--r--isa/rv64si/scall.S7
1 files changed, 7 insertions, 0 deletions
diff --git a/isa/rv64si/scall.S b/isa/rv64si/scall.S
index 9956e03..5dda6bb 100644
--- a/isa/rv64si/scall.S
+++ b/isa/rv64si/scall.S
@@ -67,6 +67,13 @@ do_scall:
.global stvec_handler
stvec_handler:
csrr t0, scause
+ # Check if CLIC mode
+ csrr t2, stvec
+ andi t2, t2, 2
+ # Skip masking if non-CLIC mode
+ beqz t2, skip_mask
+ andi t0, t0, 255
+skip_mask:
bne t0, t1, fail
la t2, do_scall
csrr t0, sepc