.section ".text.boot" .global _start _start: // Stop all cores except one. mrs x0, mpidr_el1 and x0, x0, #0xFF cbz x0, master b halt // Helper function to clear x1 bytes starting at the x0 memory address. .globl memzero64 memzero64: mov x2, x1 lsr x2, x2, #3 cbz x2, memzero64_ret memzero64_loop: str xzr, [x0], #8 subs x2, x2, #1 b.gt memzero64_loop memzero64_ret: ret // Helper function wait for N cycles before returning. .globl delay delay: subs x0, x0, #1 bne delay ret master: // Set the stack memory location. Since the stack grows towards zero we set // the stack pointer to the end of the .stack memory section. ldr x0, =__stack_end mov sp, x0 // Start C code, should not return. bl main b halt halt: wfe b halt