You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

38 lines
742 B

  1. .section .entry
  2. .global entry
  3. .syntax unified
  4. .thumb_func
  5. entry:
  6. /* Disable interrupts */
  7. cpsid i
  8. /* Privileged mode, main stack, no floating point */
  9. mov r0, #0
  10. msr control, r0
  11. isb
  12. /* Load initial stack pointer */
  13. ldr r0, =_estack
  14. mov sp, r0
  15. isb
  16. /* Clear BSS */
  17. mov r0, #0
  18. ldr r1, =_bss
  19. ldr r2, =_ebss
  20. 1:
  21. cmp r1, r2
  22. it lt
  23. strlt r0, [r1], #4
  24. blt 1b
  25. /* No need to copy initialized data, since it's already in RAM */
  26. /* It's safe to call C code now */
  27. bl __libc_init_array
  28. bl main
  29. /* Main returned -- hang */
  30. b .