setjmp.S 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. /* setjmp for or1k
  2. Based on:
  3. setjmp for PowerPC.
  4. Copyright (C) 1995, 1996, 1997, 1999, 2000 Free Software Foundation, Inc.
  5. This file is part of the GNU C Library.
  6. The GNU C Library is free software; you can redistribute it and/or
  7. modify it under the terms of the GNU Lesser General Public
  8. License as published by the Free Software Foundation; either
  9. version 2.1 of the License, or (at your option) any later version.
  10. The GNU C Library is distributed in the hope that it will be useful,
  11. but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  13. Lesser General Public License for more details.
  14. You should have received a copy of the GNU Lesser General Public
  15. License along with the GNU C Library; see the file COPYING.LIB. If
  16. not, see <http://www.gnu.org/licenses/>.  */
  17. #include "spr_defs.h"
  18. #include <jmpbuf-offsets.h>
  19. #ifdef __UCLIBC_HAS_FLOATS__
  20. #define FP(x...) x
  21. #else
  22. #define FP(x...)
  23. #endif
  24. .globl _setjmp
  25. .type _setjmp, @function
  26. .align 2
  27. _setjmp:
  28. l.addi r4,r0,0 /* Set second argument to 0. */
  29. l.j .Local_sigsetjmp
  30. l.nop
  31. .size _setjmp,.-_setjmp
  32. .globl __setjmp
  33. .type __setjmp, @function
  34. .align 2
  35. __setjmp:
  36. l.addi r4,r0,1 /* Set second argument to 1. */
  37. l.j .Local_sigsetjmp
  38. l.nop
  39. .size __setjmp,.-__setjmp
  40. .globl setjmp
  41. .set setjmp,__setjmp
  42. .globl __sigsetjmp
  43. .type __sigsetjmp, @function
  44. .align 2
  45. __sigsetjmp:
  46. .Local_sigsetjmp:
  47. # l.mfspr r11,r0,SPR_SR
  48. # l.sw (JB_SR*4)(r3),r11
  49. l.sw ((JB_GPRS+0)*4)(r3),r1
  50. l.sw ((JB_GPRS+1)*4)(r3),r2
  51. /* l.sw ((JB_GPRS+2)*4)(r3),r3*/
  52. l.sw ((JB_GPRS+3)*4)(r3),r4
  53. l.sw ((JB_GPRS+4)*4)(r3),r5
  54. l.sw ((JB_GPRS+5)*4)(r3),r6
  55. l.sw ((JB_GPRS+6)*4)(r3),r7
  56. l.sw ((JB_GPRS+7)*4)(r3),r8
  57. l.sw ((JB_GPRS+8)*4)(r3),r9
  58. l.sw ((JB_GPRS+9)*4)(r3),r10
  59. l.sw ((JB_GPRS+10)*4)(r3),r11
  60. l.sw ((JB_GPRS+11)*4)(r3),r12
  61. l.sw ((JB_GPRS+12)*4)(r3),r13
  62. l.sw ((JB_GPRS+13)*4)(r3),r14
  63. l.sw ((JB_GPRS+14)*4)(r3),r15
  64. l.sw ((JB_GPRS+15)*4)(r3),r16
  65. l.sw ((JB_GPRS+16)*4)(r3),r17
  66. l.sw ((JB_GPRS+17)*4)(r3),r18
  67. l.sw ((JB_GPRS+18)*4)(r3),r19
  68. l.sw ((JB_GPRS+19)*4)(r3),r20
  69. l.sw ((JB_GPRS+20)*4)(r3),r21
  70. l.sw ((JB_GPRS+21)*4)(r3),r22
  71. l.sw ((JB_GPRS+22)*4)(r3),r23
  72. l.sw ((JB_GPRS+23)*4)(r3),r24
  73. l.sw ((JB_GPRS+24)*4)(r3),r25
  74. l.sw ((JB_GPRS+25)*4)(r3),r26
  75. l.sw ((JB_GPRS+26)*4)(r3),r27
  76. l.sw ((JB_GPRS+27)*4)(r3),r28
  77. l.sw ((JB_GPRS+28)*4)(r3),r29
  78. l.sw ((JB_GPRS+29)*4)(r3),r30
  79. l.sw ((JB_GPRS+30)*4)(r3),r31
  80. l.j __sigjmp_save
  81. l.nop
  82. .size __sigsetjmp,.-__sigsetjmp