Merge pull request #277 from KarlK90/risc-v-eclic-t0-restore-fix
[RISC-V ECLIC] Fix t0 restore when exiting interrupt
This commit is contained in:
commit
9c2bfa6aeb
|
@ -103,6 +103,13 @@
|
|||
# registers and status csr registers from stack.
|
||||
# --------------------------------------------------------------------------
|
||||
.macro RESTORE_CONTEXT
|
||||
LOAD t0, 17*REGBYTES(sp)
|
||||
csrw CSR_MEPC, t0
|
||||
LOAD t0, 18*REGBYTES(sp)
|
||||
csrw CSR_MCAUSE, t0
|
||||
LOAD t0, 19*REGBYTES(sp)
|
||||
csrw CSR_MSUBM, t0
|
||||
|
||||
LOAD ra, 0*REGBYTES(sp)
|
||||
LOAD tp, 1*REGBYTES(sp)
|
||||
LOAD t0, 2*REGBYTES(sp)
|
||||
|
@ -121,13 +128,6 @@
|
|||
LOAD t5, 15*REGBYTES(sp)
|
||||
LOAD t6, 16*REGBYTES(sp)
|
||||
|
||||
LOAD t0, 17*REGBYTES(sp)
|
||||
csrw CSR_MEPC, t0
|
||||
LOAD t0, 18*REGBYTES(sp)
|
||||
csrw CSR_MCAUSE, t0
|
||||
LOAD t0, 19*REGBYTES(sp)
|
||||
csrw CSR_MSUBM, t0
|
||||
|
||||
# De-allocate the stack space
|
||||
addi sp, sp, 20*REGBYTES
|
||||
.endm
|
||||
|
|
Loading…
Reference in New Issue