X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?p=rpikern;a=blobdiff_plain;f=src%2Fstartup.s;h=587ab95ea08c275fe7c1388a63afb97e4ef73c0d;hp=ec157f666db98b0078ce4b386324be47c8f0fc1c;hb=574147e84aafb61db3cf8b595d2a12ce5ba160de;hpb=e3851fa5fc01560a8ab799046b7cf0d2f35f18e8 diff --git a/src/startup.s b/src/startup.s index ec157f6..587ab95 100644 --- a/src/startup.s +++ b/src/startup.s @@ -1,8 +1,32 @@ + .extern main + .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 + cmp r1, #0 + beq 1f @ 0-sized bss, skip clear 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: