summaryrefslogtreecommitdiff
path: root/assembly/rrxing2/rrxing2.S
diff options
context:
space:
mode:
authorcheapie <cheapiephp@gmail.com>2026-11-05 05:02:41 -0600
committercheapie <cheapiephp@gmail.com>2026-11-05 05:02:41 -0600
commit747374b7e56717d39d6f5dbef7e1c04cbf0c5355 (patch)
treeaf1f97dfdcbe28874e133f39e09a5168692fd6bf /assembly/rrxing2/rrxing2.S
parent588c85a8463fa860b9cf36b8b669ee20a3e7b72b (diff)
downloadrvcontroller-747374b7e56717d39d6f5dbef7e1c04cbf0c5355.tar
rvcontroller-747374b7e56717d39d6f5dbef7e1c04cbf0c5355.tar.gz
rvcontroller-747374b7e56717d39d6f5dbef7e1c04cbf0c5355.tar.bz2
rvcontroller-747374b7e56717d39d6f5dbef7e1c04cbf0c5355.tar.xz
rvcontroller-747374b7e56717d39d6f5dbef7e1c04cbf0c5355.zip
More work on rrxing2
Diffstat (limited to 'assembly/rrxing2/rrxing2.S')
-rw-r--r--assembly/rrxing2/rrxing2.S7
1 files changed, 3 insertions, 4 deletions
diff --git a/assembly/rrxing2/rrxing2.S b/assembly/rrxing2/rrxing2.S
index 2118ca1..4501948 100644
--- a/assembly/rrxing2/rrxing2.S
+++ b/assembly/rrxing2/rrxing2.S
@@ -3,6 +3,8 @@ j _start
.include "util.S"
_start:
+li t0,0x400
+csrs mseccfg,t0 # Turn on MLPE (enable Zicfilp)
li sp,0x10000 # Set up stack pointer
la t0,handler
csrw mtvec,t0 # Set up trap handler
@@ -30,7 +32,7 @@ digiline_send signalchannel,lightredmsg
.align 2
handler:
-csrrw x31,mscratch,x31 # Free up x31 to hold the context address
+csrw mscratch,x31 # Free up x31 to hold the context address
la x31,hcontext # Using x register numbers here since trap handlers don't use the usual calling convention
sw x1,0(x31) # Save all the registers to the context
sd x2,4(x31) # Two at a time since we have Zilsd/Zclsd
@@ -51,9 +53,6 @@ sw x30,116(x31)
csrr x30,mscratch # Get the old x31 value back into a register
sw x30,120(x31) # and write that back out too
-li t0,0x400
-csrw mseccfg,t0 # Turn on MLPE (enable Zicfilp)
-
csrr t0,mcause # Read why the trap occurred
li t1,0x80000011 # Interrupt 17 = digilines