__longjmp.S 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /* longjmp for CRIS.
  2. Copyright (C) 2001, 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 <features.h>
  17. #include "sysdep.h"
  18. #define _SETJMP_H
  19. #define _ASM
  20. #include <bits/setjmp.h>
  21. .syntax no_register_prefix
  22. /* Saving and restoring CCR is meaningless, so we don't do it. */
  23. ENTRY (__longjmp)
  24. /* Note that r10 = jmp_buf, r11 = retval. */
  25. #ifdef __arch_v32
  26. /* We don't restore the call-clobbered registers for v32;
  27. their space (corresponding to v10) is now defined as
  28. reserved. */
  29. movem [r10],r9
  30. addq 14*4,r10
  31. cmpq 0,r11
  32. beq 0f
  33. move.d [r10+],sp
  34. move.d r11,r9
  35. 0:
  36. move.d [r10+],acr
  37. jump acr
  38. move [r10],srp
  39. #else
  40. move [r10+16*4],srp
  41. test.d r11
  42. beq 0f /* Already a 1 in place. */
  43. nop
  44. /* Offset for r9, the return value (see setjmp). */
  45. move.d r11,[r10+6*4]
  46. 0:
  47. movem [r10],pc
  48. #endif
  49. END (__longjmp)
  50. libc_hidden_def(__longjmp)