aboutsummaryrefslogtreecommitdiff
path: root/src/boot.S
diff options
context:
space:
mode:
authorChristian Cunningham <cc@localhost>2022-01-21 18:52:25 -0700
committerChristian Cunningham <cc@localhost>2022-01-21 18:52:25 -0700
commit0d551d712c098d6ebb75512340d7503da98361b4 (patch)
treead01fa489a37f70e3dd4e94bd22dc67381e05710 /src/boot.S
parentc7c1702dc66f5be0f8f07703e2c8e9f5bd8db80d (diff)
Got some scheduling
Diffstat (limited to 'src/boot.S')
-rw-r--r--src/boot.S39
1 files changed, 28 insertions, 11 deletions
diff --git a/src/boot.S b/src/boot.S
index 42e991a..27f6ddc 100644
--- a/src/boot.S
+++ b/src/boot.S
@@ -120,28 +120,34 @@ svc:
stmfd sp!, {r0-r12,lr}
ldr r0, [lr, #-4]
bic r0, #0xFF000000
- push {r0}
- ldr r0, =svc_msg
- bl uart_string
- ldr r0, [sp]
- bl uart_hexn
- pop {r0}
+ /// push {r0}
+ /// ldr r0, =svc_msg
+ /// bl uart_string
+ /// ldr r0, [sp]
+ /// bl uart_hexn
+ /// pop {r0}
// SVC #0 returns to supervisor mode
// 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
+ cps #0x13
+ b 1f
+2:
+ cmp r0, #2
bne 1f
- mrs r0, spsr
- bic r0, #0x1f
- // Return in supervisor mode
- orr r0, #0x13
- msr spsr, r0
+ ldmfd sp!, {r0-r12,lr}
+ bl schedule
1:
ldmfd sp!, {r0-r12,pc}^
io_halt_prefetch:
stmfd sp!, {r0-r12,lr}
+ push {lr}
ldr r0, =prefetch_msg
bl uart_string
+ pop {lr}
+ mov r0, lr
+ bl uart_hexn
ldmfd sp!, {r0-r12,pc}^
io_halt_data:
stmfd sp!, {r0-r12,lr}
@@ -158,6 +164,17 @@ fiq:
//ldr r0, =fiq_msg
//bl uart_string
bl c_fiq_handler
+ cmp r0, #1
+ bne 1f
+ ldmfd sp!, {r0-r12,lr}
+ sub lr, #4
+ stmfd sp!, {r0-r12,lr}
+ ldr r3, =irqlr
+ str lr, [r3, #0]
+ ldmfd sp!, {r0-r12,lr}
+ cps #0x13
+ b schedule
+1:
ldmfd sp!, {r0-r12,lr}
subs pc, lr, #4