setjmp.S 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  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. write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  15. Boston, MA 02111-1307, USA. */
  16. #include "sysdep.h"
  17. .syntax no_register_prefix
  18. ENTRY (__sigsetjmp)
  19. .Local__sigsetjmp:
  20. #ifdef __arch_v32
  21. moveq 1,r9
  22. move.d r10,r12
  23. addq 14*4,r12
  24. movem r9,[r10]
  25. lapc 0f,r13
  26. move.d sp,[r12+]
  27. move.d r13,[r12+]
  28. move srp,[r12+]
  29. #else
  30. moveq 1,r9
  31. movem sp,[r10+1*4]
  32. #ifdef __PIC__
  33. move.d pc,r9
  34. addq 0f-.,r9
  35. #else
  36. move.d 0f,r9
  37. #endif
  38. move.d r9,[r10]
  39. move srp,[r10+16*4]
  40. #endif
  41. /* Saving and restoring CCR is meaningless, so we don't do it. */
  42. /* Saving registers would complicate the implementation, but we
  43. can get away with not setting up R0 here since we know that
  44. __sigjmp_save is a local symbol; it doesn't have a PLT (which
  45. would have required GOT in R0 at the time of the jump). */
  46. PLTJUMP (__sigjmp_save)
  47. 0: /* This is where longjmp returns. (Don't use "ret" - it's a macro. */
  48. Ret
  49. move.d r9,r10
  50. END (__sigsetjmp)
  51. /* Binary compatibility entry points. Having these in separate files
  52. is not meaningful and just adds library overhead. */
  53. ENTRY (__setjmp)
  54. ba .Local__sigsetjmp
  55. moveq 0,r11
  56. END (__setjmp)
  57. ENTRY (_setjmp)
  58. ba .Local__sigsetjmp
  59. moveq 0,r11
  60. END (_setjmp)
  61. ENTRY (setjmp)
  62. ba .Local__sigsetjmp
  63. moveq 1,r11
  64. END (setjmp)