diff options
author | Christian Cunningham <cc@localhost> | 2022-01-23 16:32:57 -0700 |
---|---|---|
committer | Christian Cunningham <cc@localhost> | 2022-01-23 16:32:57 -0700 |
commit | d085707a1054df197a8695a3a822687dd1a16022 (patch) | |
tree | 0e4b045b60b2fccdf07c80aed4bf34be0bb62052 /src | |
parent | 746d701c36bdbc5884af6ef9ba6ee65915b5891d (diff) |
Fixed context switch bug
Diffstat (limited to 'src')
-rw-r--r-- | src/sys/schedule.S | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/sys/schedule.S b/src/sys/schedule.S index 8cfb238..c8dcaa2 100644 --- a/src/sys/schedule.S +++ b/src/sys/schedule.S @@ -36,7 +36,9 @@ schedule: cmp r0, #0 beq 1f // Replace LR with IRQ's LR - mov lr, r0 + ldr r3, =scheduler + ldr r2, [r3, #0] // struct Thread* rthread + str r0, [r2, #0] // svc_lr -> void* pc // Clear IRQ's LR mov r0, #0 str r0, [r1] |