setjmp.S 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. #define _SETJMP_H
  2. #define _ASM
  3. #include <bits/setjmp.h>
  4. #include <libc-symbols.h>
  5. .text
  6. .global C_SYMBOL_NAME(setjmp)
  7. .type C_SYMBOL_NAME(setjmp),@function
  8. .align 4
  9. C_SYMBOL_NAME(setjmp):
  10. mvi r2, 1 /* save the signal mask */
  11. bi C_SYMBOL_NAME(__sigsetjmp)
  12. .text
  13. .global C_SYMBOL_NAME(_setjmp)
  14. .type C_SYMBOL_NAME(_setjmp),@function
  15. .align 4
  16. C_SYMBOL_NAME(_setjmp):
  17. mvi r2, 0 /* don't save the signal mask */
  18. bi C_SYMBOL_NAME(__sigsetjmp)
  19. .text
  20. .global C_SYMBOL_NAME(__sigsetjmp)
  21. .type C_SYMBOL_NAME(__sigsetjmp),@function
  22. .align 4
  23. C_SYMBOL_NAME(__sigsetjmp):
  24. /* save registers relative to r1 (arg0) */
  25. sw (r1+0), r11
  26. sw (r1+4), r12
  27. sw (r1+8), r13
  28. sw (r1+12), r14
  29. sw (r1+16), r15
  30. sw (r1+20), r16
  31. sw (r1+24), r17
  32. sw (r1+28), r18
  33. sw (r1+32), r19
  34. sw (r1+36), r20
  35. sw (r1+40), r21
  36. sw (r1+44), r22
  37. sw (r1+48), r23
  38. sw (r1+52), r24
  39. sw (r1+56), r25
  40. sw (r1+60), gp
  41. sw (r1+64), fp
  42. sw (r1+68), sp
  43. sw (r1+72), ra
  44. /* make a tail call to __sigjmp_save; it takes the same args */
  45. bi C_SYMBOL_NAME(__sigjmp_save)