aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/sys/schedule.S4
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]