summaryrefslogtreecommitdiffstats
path: root/utils/hwstub/stub/crt0.S
diff options
context:
space:
mode:
Diffstat (limited to 'utils/hwstub/stub/crt0.S')
-rw-r--r--utils/hwstub/stub/crt0.S17
1 files changed, 17 insertions, 0 deletions
diff --git a/utils/hwstub/stub/crt0.S b/utils/hwstub/stub/crt0.S
new file mode 100644
index 0000000000..e2d4742d36
--- /dev/null
+++ b/utils/hwstub/stub/crt0.S
@@ -0,0 +1,17 @@
+.section .text,"ax",%progbits
+.code 32
+.align 0x04
+.global start
+start:
+ msr cpsr_c, #0xd3 /* enter supervisor mode, disable IRQ/FIQ */
+ ldr sp, =oc_stackend
+ /* clear bss */
+ ldr r2, =bss_start
+ ldr r3, =bss_end
+ mov r4, #0
+1:
+ cmp r3, r2
+ strhi r4, [r2], #4
+ bhi 1b
+ /* jump to C code */
+ b main