context_aarch64.S 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. .p2align 2
  2. #if !(defined __darwin__) && !(defined __arm64__)
  3. .global __mysetjmp
  4. .type __mysetjmp,@function
  5. __mysetjmp:
  6. #else
  7. .global ___mysetjmp
  8. ___mysetjmp:
  9. #endif
  10. // IHI0055B_aapcs64.pdf 5.1.1, 5.1.2 callee saved registers
  11. stp x19, x20, [x0,#0]
  12. stp x21, x22, [x0,#16]
  13. stp x23, x24, [x0,#32]
  14. stp x25, x26, [x0,#48]
  15. stp x27, x28, [x0,#64]
  16. stp x29, x30, [x0,#80]
  17. mov x2, sp
  18. str x2, [x0,#104]
  19. stp d8, d9, [x0,#112]
  20. stp d10, d11, [x0,#128]
  21. stp d12, d13, [x0,#144]
  22. stp d14, d15, [x0,#160]
  23. mov x0, #0
  24. ret
  25. .p2align 2
  26. #if !(defined __darwin__) && !(defined __arm64__)
  27. .global __mylongjmp
  28. .type __mylongjump,@function
  29. __mylongjmp:
  30. #else
  31. .global ___mylongjmp
  32. ___mylongjmp:
  33. #endif
  34. // IHI0055B_aapcs64.pdf 5.1.1, 5.1.2 callee saved registers
  35. ldp x19, x20, [x0,#0]
  36. ldp x21, x22, [x0,#16]
  37. ldp x23, x24, [x0,#32]
  38. ldp x25, x26, [x0,#48]
  39. ldp x27, x28, [x0,#64]
  40. ldp x29, x30, [x0,#80]
  41. ldr x2, [x0,#104]
  42. mov sp, x2
  43. ldp d8 , d9, [x0,#112]
  44. ldp d10, d11, [x0,#128]
  45. ldp d12, d13, [x0,#144]
  46. ldp d14, d15, [x0,#160]
  47. mov x0, x1
  48. cbnz x1, 1f
  49. mov x0, #1
  50. 1: br x30