projects
/
rpikern
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
interrupts, timers, under construction
[rpikern]
/
src
/
startup.s
diff --git
a/src/startup.s
b/src/startup.s
index
ec157f6
..
587ab95
100644
(file)
--- a/
src/startup.s
+++ b/
src/startup.s
@@
-1,8
+1,32
@@
+ .extern main
+
.section .startup
.section .startup
+ .code 32
+
+ .global startup
+startup:
+ @ stop all but one of the cores
+ mrc p15, 0, r0, c0, c0, 5
+ ands r0, r0, #0xff
+ bne exit
+
+ @ setup stack
+ ldr sp, =_stacktop
+
@ clear bss
ldr r0, =_bss_start
ldr r1, =_bss_size
@ clear bss
ldr r0, =_bss_start
ldr r1, =_bss_size
+ cmp r1, #0
+ beq 1f @ 0-sized bss, skip clear
mov r2, #0
0: str r2, [r0], #4
subs r1, #4
bne 0b
mov r2, #0
0: str r2, [r0], #4
subs r1, #4
bne 0b
+1:
+ blx main
+
+ .global exit
+exit: wfe
+ b exit
+
+@ vi:set filetype=armasm: