setjmp.S 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. .text
  2. /* This just does a tail-call to `__sigsetjmp (ARG, 0)'.
  3. We cannot do it in C because it must be a tail-call, so frame-unwinding
  4. in setjmp doesn't clobber the state restored by longjmp. */
  5. .global _setjmp
  6. .type _setjmp,@function
  7. _setjmp:
  8. setlos #0, gr9
  9. bra .Lsigsetjmp_intern
  10. .size _setjmp,.-_setjmp
  11. /* This just does a tail-call to `__sigsetjmp (ARG, 1)'.
  12. We cannot do it in C because it must be a tail-call, so frame-unwinding
  13. in setjmp doesn't clobber the state restored by longjmp. */
  14. .align 4
  15. .type setjmp,@function
  16. .globl setjmp
  17. setjmp:
  18. setlos #1, gr9
  19. bra .Lsigsetjmp_intern
  20. .size setjmp,.-setjmp
  21. # setjmp/longjmp for Frv. The jmpbuf looks like this:
  22. #
  23. # Register jmpbuf offset
  24. # R16-R31 0x0-0x03c
  25. # R48-R63 0x40-0x7c
  26. # FR16-FR31 0x80-0xbc
  27. # FR48-FR63 0xc0-0xfc
  28. # LR 0x100
  29. # SP 0x104
  30. # FP 0x108
  31. .global __sigsetjmp
  32. .type __sigsetjmp,@function
  33. __sigsetjmp:
  34. .Lsigsetjmp_intern:
  35. stdi gr16, @(gr8,0)
  36. stdi gr18, @(gr8,8)
  37. stdi gr20, @(gr8,16)
  38. stdi gr22, @(gr8,24)
  39. stdi gr24, @(gr8,32)
  40. stdi gr26, @(gr8,40)
  41. stdi gr28, @(gr8,48)
  42. stdi gr30, @(gr8,56)
  43. #if __FRV_GPR__ != 32
  44. stdi gr48, @(gr8,64)
  45. stdi gr50, @(gr8,72)
  46. stdi gr52, @(gr8,80)
  47. stdi gr54, @(gr8,88)
  48. stdi gr56, @(gr8,96)
  49. stdi gr58, @(gr8,104)
  50. stdi gr60, @(gr8,112)
  51. stdi gr62, @(gr8,120)
  52. #endif
  53. #if __FRV_FPR__ != 0
  54. stdfi fr16, @(gr8,128)
  55. stdfi fr18, @(gr8,136)
  56. stdfi fr20, @(gr8,144)
  57. stdfi fr22, @(gr8,152)
  58. stdfi fr24, @(gr8,160)
  59. stdfi fr26, @(gr8,168)
  60. stdfi fr28, @(gr8,176)
  61. stdfi fr30, @(gr8,184)
  62. #if __FRV_FPR__ != 32
  63. stdfi fr48, @(gr8,192)
  64. stdfi fr50, @(gr8,200)
  65. stdfi fr52, @(gr8,208)
  66. stdfi fr54, @(gr8,216)
  67. stdfi fr56, @(gr8,224)
  68. stdfi fr58, @(gr8,232)
  69. stdfi fr60, @(gr8,240)
  70. stdfi fr62, @(gr8,248)
  71. #endif
  72. #endif
  73. movsg lr, gr4
  74. sti gr4, @(gr8,256)
  75. sti sp, @(gr8,260)
  76. sti fp, @(gr8,264)
  77. sethi.p #gotofffuncdeschi(__sigjmp_save), gr4
  78. setlo #gotofffuncdesclo(__sigjmp_save), gr4
  79. ldd @(gr15, gr4), gr14
  80. jmpl @(gr14, gr0)
  81. .size __sigsetjmp,.-__sigsetjmp