From d085707a1054df197a8695a3a822687dd1a16022 Mon Sep 17 00:00:00 2001 From: Christian Cunningham Date: Sun, 23 Jan 2022 16:32:57 -0700 Subject: Fixed context switch bug --- src/sys/schedule.S | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') 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] -- cgit v1.2.1