setjmp.S 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. /* setjmp for CRIS.
  2. Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
  3. This file is part of the GNU C Library.
  4. The GNU C Library is free software; you can redistribute it and/or
  5. modify it under the terms of the GNU Library General Public License as
  6. published by the Free Software Foundation; either version 2 of the
  7. License, or (at your option) any later version.
  8. The GNU C Library is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  11. Library General Public License for more details.
  12. You should have received a copy of the GNU Library General Public
  13. License along with the GNU C Library; see the file COPYING.LIB. If not,
  14. see <http://www.gnu.org/licenses/>. */
  15. #include "sysdep.h"
  16. .syntax no_register_prefix
  17. ENTRY (__sigsetjmp)
  18. .Local__sigsetjmp:
  19. #ifdef __arch_v32
  20. moveq 1,r9
  21. move.d r10,r12
  22. addq 14*4,r12
  23. movem r9,[r10]
  24. lapc 0f,r13
  25. move.d sp,[r12+]
  26. move.d r13,[r12+]
  27. move srp,[r12+]
  28. #else
  29. moveq 1,r9
  30. movem sp,[r10+1*4]
  31. #ifdef __PIC__
  32. move.d pc,r9
  33. addq 0f-.,r9
  34. #else
  35. move.d 0f,r9
  36. #endif
  37. move.d r9,[r10]
  38. move srp,[r10+16*4]
  39. #endif
  40. /* Saving and restoring CCR is meaningless, so we don't do it. */
  41. /* Saving registers would complicate the implementation, but we
  42. can get away with not setting up R0 here since we know that
  43. __sigjmp_save is a local symbol; it doesn't have a PLT (which
  44. would have required GOT in R0 at the time of the jump). */
  45. PLTJUMP (__sigjmp_save)
  46. 0: /* This is where longjmp returns. (Don't use "ret" - it's a macro. */
  47. Ret
  48. move.d r9,r10
  49. END (__sigsetjmp)
  50. /* Binary compatibility entry points. Having these in separate files
  51. is not meaningful and just adds library overhead. */
  52. ENTRY (__setjmp)
  53. ba .Local__sigsetjmp
  54. moveq 0,r11
  55. END (__setjmp)
  56. ENTRY (_setjmp)
  57. ba .Local__sigsetjmp
  58. moveq 0,r11
  59. END (_setjmp)
  60. ENTRY (setjmp)
  61. ba .Local__sigsetjmp
  62. moveq 1,r11
  63. END (setjmp)