mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-19 09:00:54 +00:00
kernel: fix isr context handling
We were loading both the context and the banked context, which resulted in an invalid context being selected. This caused a cascading failure. Load only the lower halfword in order to correctly enter the interrupt context. Signed-off-by: Sean Cross <sean@xobs.io>
This commit is contained in:
parent
fb01359821
commit
fa22d9bad8
6 changed files with 4 additions and 4 deletions
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
|
@ -51,10 +51,10 @@ _start:
|
||||||
_start_trap:
|
_start_trap:
|
||||||
csrw sscratch, sp
|
csrw sscratch, sp
|
||||||
li sp, 0xff801000
|
li sp, 0xff801000
|
||||||
STORE x1, 0*REGBYTES(sp)
|
STORE x1, 0*REGBYTES(sp) // Store x1 in the scratch field
|
||||||
LOAD x1, 1*REGBYTES(sp)
|
lh x1, 1*REGBYTES(sp) // Load current context number
|
||||||
slli x1, x1, 7
|
slli x1, x1, 7 // Multiply current context number by 32
|
||||||
add sp, sp, x1
|
add sp, sp, x1 // Set $sp to 0xff801000 + (current_context * 32)
|
||||||
|
|
||||||
STORE x1, 0*REGBYTES(sp)
|
STORE x1, 0*REGBYTES(sp)
|
||||||
// Skip SP for now
|
// Skip SP for now
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue