__longjmp.S 1.5 KB

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