setjmp.S 2.2 KB

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