setjmp.S 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. /* Copyright (C) 1992, 1994, 1996, 1997 Free Software Foundation, Inc.
  2. This file is part of the GNU C Library.
  3. The GNU C Library is free software; you can redistribute it and/or
  4. modify it under the terms of the GNU Lesser General Public
  5. License as published by the Free Software Foundation; either
  6. version 2.1 of the License, or (at your option) any later version.
  7. The GNU C Library is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  10. Lesser General Public License for more details.
  11. You should have received a copy of the GNU Lesser General Public
  12. License along with the GNU C Library; if not, write to the Free
  13. Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
  14. 02111-1307 USA. */
  15. #include <jmpbuf-offsets.h>
  16. #define a0 $16
  17. .ent __sigsetjmp
  18. .global __sigsetjmp
  19. __sigsetjmp:
  20. ldgp $29, 0($27)
  21. $sigsetjmp_local:
  22. #ifndef __PIC__
  23. # define FRAME 16
  24. subq $30, FRAME, $30
  25. .frame $30, FRAME, $26, 0
  26. stq $26, 0($30)
  27. .mask 0x04000000, -FRAME
  28. #else
  29. # define FRAME 0
  30. .frame $30, FRAME, $26, 0
  31. #endif
  32. .prologue 1
  33. stq $9, JB_S0*8(a0)
  34. stq $10, JB_S1*8(a0)
  35. stq $11, JB_S2*8(a0)
  36. stq $12, JB_S3*8(a0)
  37. stq $13, JB_S4*8(a0)
  38. stq $14, JB_S5*8(a0)
  39. stq $26, JB_PC*8(a0)
  40. addq $30, FRAME, $1
  41. stq $1, JB_SP*8(a0)
  42. stq $15, JB_FP*8(a0)
  43. stt $f2, JB_F2*8(a0)
  44. stt $f3, JB_F3*8(a0)
  45. stt $f4, JB_F4*8(a0)
  46. stt $f5, JB_F5*8(a0)
  47. stt $f6, JB_F6*8(a0)
  48. stt $f7, JB_F7*8(a0)
  49. stt $f8, JB_F8*8(a0)
  50. stt $f9, JB_F9*8(a0)
  51. #ifndef __PIC__
  52. /* Call to C to (potentially) save our signal mask. */
  53. jsr $26, __sigjmp_save
  54. ldq $26, 0($30)
  55. addq $30, 16, $30
  56. ret
  57. #else
  58. /* Tailcall to save the signal mask. */
  59. br $31, __sigjmp_save !samegp
  60. #endif
  61. .end __sigsetjmp
  62. /* Put these traditional entry points in the same file so that we can
  63. elide much of the nonsense in trying to jmp to the real function. */
  64. .globl _setjmp;
  65. .align 3;
  66. .ent _setjmp , 0;
  67. _setjmp:
  68. ldgp $29, 0($27)
  69. mov 0, $17
  70. br $sigsetjmp_local
  71. .end _setjmp
  72. .globl setjmp;
  73. .align 3;
  74. .ent setjmp , 0;
  75. setjmp:
  76. ldgp $29, 0($27)
  77. mov 1, $17
  78. br $sigsetjmp_local
  79. .end setjmp