__longjmp.S 1.6 KB

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