aboutsummaryrefslogtreecommitdiff
path: root/boot.S
diff options
context:
space:
mode:
Diffstat (limited to 'boot.S')
-rw-r--r--boot.S18
1 files changed, 8 insertions, 10 deletions
diff --git a/boot.S b/boot.S
index be858ee..0cd0339 100644
--- a/boot.S
+++ b/boot.S
@@ -7,26 +7,24 @@
// r2 -> 0x00000100 - start of ATAGS
// preserve these registers as argument for kernel_main
-.globl _boot // make entry point label global
+.global _boot // make entry point label global
_boot:
- // Shut off extra cores
- mrc p15, 0, r5, c0, c0, 5
- and r5, r5, #3
- cmp r5, #0
+ // Only let the first core execute
+ mrc p15, 0, r3, c0, c0, 5
+ and r3, r3, #3
+ cmp r3, #0
beq proceed
// this is a kind of blef - races can theoretically still occur
// when the main core overwrites this part of memory
wfe
proceed:
- // go to system mode
+ // go to system mode (we had problems doing this later)
cps #0b11111
isb
- // Setup the stack.
- // It shall be directly below our kernel image
- ldr r5, =__start
- mov sp, r5
+ // Initialize the stack (_stack_top is defined in linker.ld)
+ ldr sp, =_stack_top
// Call kernel_main
ldr r3, =kernel_main