gchelper.s 818 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. .syntax unified
  2. .cpu cortex-m4
  3. .thumb
  4. .text
  5. .align 2
  6. @ uint gc_helper_get_sp(void)
  7. .global gc_helper_get_sp
  8. .thumb
  9. .thumb_func
  10. .type gc_helper_get_sp, %function
  11. gc_helper_get_sp:
  12. @ return the sp
  13. mov r0, sp
  14. bx lr
  15. @ uint gc_helper_get_regs_and_sp(r0=uint regs[10])
  16. .global gc_helper_get_regs_and_sp
  17. .thumb
  18. .thumb_func
  19. .type gc_helper_get_regs_and_sp, %function
  20. gc_helper_get_regs_and_sp:
  21. @ store registers into given array
  22. str r4, [r0], #4
  23. str r5, [r0], #4
  24. str r6, [r0], #4
  25. str r7, [r0], #4
  26. str r8, [r0], #4
  27. str r9, [r0], #4
  28. str r10, [r0], #4
  29. str r11, [r0], #4
  30. str r12, [r0], #4
  31. str r13, [r0], #4
  32. @ return the sp
  33. mov r0, sp
  34. bx lr