aboutsummaryrefslogtreecommitdiff
path: root/src/boot.S
diff options
context:
space:
mode:
authorChristian Cunningham <cc@localhost>2022-01-22 23:18:22 -0700
committerChristian Cunningham <cc@localhost>2022-01-22 23:18:22 -0700
commit3ace36ab03f40db05a7876013b7d814a3e5ca171 (patch)
treea3961e767c4c6672134bac263e72c4047b45fef1 /src/boot.S
parent9c0cb4e1f7df02f24751833b384963917bbf2360 (diff)
Added SVC call for clean stack
Diffstat (limited to 'src/boot.S')
-rw-r--r--src/boot.S17
1 files changed, 14 insertions, 3 deletions
diff --git a/src/boot.S b/src/boot.S
index 94de57f..aedc957 100644
--- a/src/boot.S
+++ b/src/boot.S
@@ -136,14 +136,25 @@ svc:
// TODO: Make supervisor mode return to a specific location
// (rather than to a user location) such as the kernel loop
cmp r0, #0
- bne 2f
+ bne 3f
cps #0x13
b 1f
-2:
+3:
cmp r0, #2
- bne 1f
+ bne 2f
ldmfd sp!, {r0-r12,lr}
b schedule
+2:
+ cmp r0, #3
+ bne 1f
+ ldr r3, =scheduler
+ ldr r2, [r3, #0]
+ ldr r1, [r2, #8] // sp_base
+ cmp r1, #-1
+ beq 1f
+ ldr r3, =stacks_table
+ mov r0, #0
+ strb r0, [r3, r1]
1:
ldmfd sp!, {r0-r12,pc}^
io_halt_prefetch: