summaryrefslogtreecommitdiff
path: root/libcpu/risc-v/virt64/stackframe.h
diff options
context:
space:
mode:
authorbigmagic <[email protected]>2021-05-21 17:03:30 +0800
committerbigmagic <[email protected]>2021-05-21 17:10:07 +0800
commitb7c7c7f4dec7ec3708ff056b3d12c9750c835f38 (patch)
treeb06cf2b027a180b9d393a1ac69a08ec4b47b4d40 /libcpu/risc-v/virt64/stackframe.h
parent0dc972bee60ed64032071fa482ee99f4e4c4ef57 (diff)
Support for running with M-Mode
Diffstat (limited to 'libcpu/risc-v/virt64/stackframe.h')
-rw-r--r--libcpu/risc-v/virt64/stackframe.h22
1 files changed, 7 insertions, 15 deletions
diff --git a/libcpu/risc-v/virt64/stackframe.h b/libcpu/risc-v/virt64/stackframe.h
index e5a5271a7a..835f03ee3a 100644
--- a/libcpu/risc-v/virt64/stackframe.h
+++ b/libcpu/risc-v/virt64/stackframe.h
@@ -19,10 +19,10 @@
STORE x1, 1 * REGBYTES(sp)
- csrr x1, sstatus
+ csrr x1, SRC_XSTATUS
STORE x1, 2 * REGBYTES(sp)
- csrr x1, sepc
+ csrr x1, SRC_XEPC
STORE x1, 0 * REGBYTES(sp)
STORE x3, 3 * REGBYTES(sp)
@@ -54,17 +54,17 @@
STORE x29, 29 * REGBYTES(sp)
STORE x30, 30 * REGBYTES(sp)
STORE x31, 31 * REGBYTES(sp)
- csrr t0, sscratch
+ csrr t0, SRC_XSCRATCH
STORE t0, 32 * REGBYTES(sp)
.endm
.macro RESTORE_ALL_ONLY
/* resw ra to sepc */
LOAD x1, 0 * REGBYTES(sp)
- csrw sepc, x1
+ csrw SRC_XEPC, x1
LOAD x1, 2 * REGBYTES(sp)
- csrw sstatus, x1
+ csrw SRC_XSTATUS, x1
LOAD x1, 1 * REGBYTES(sp)
@@ -104,10 +104,10 @@
.macro RESTORE_ALL
/* resw ra to sepc */
LOAD x1, 0 * REGBYTES(sp)
- csrw sepc, x1
+ csrw SRC_XEPC, x1
LOAD x1, 2 * REGBYTES(sp)
- csrw sstatus, x1
+ csrw SRC_XSTATUS, x1
LOAD x1, 1 * REGBYTES(sp)
@@ -152,12 +152,4 @@
.option pop
.endm
-.macro OPEN_INTERRUPT
- csrsi sstatus, 2
-.endm
-
-.macro CLOSE_INTERRUPT
- csrci sstatus, 2
-.endm
-
#endif \ No newline at end of file