__longjmp.S 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /* longjmp for or1k
  2. Based on:
  3. longjmp for PowerPC.
  4. Copyright (C) 2014 Free Software Foundation, Inc.
  5. This file is part of the GNU C Library.
  6. The GNU C Library is free software; you can redistribute it and/or
  7. modify it under the terms of the GNU Lesser General Public
  8. License as published by the Free Software Foundation; either
  9. version 2.1 of the License, or (at your option) any later version.
  10. The GNU C Library is distributed in the hope that it will be useful,
  11. but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  13. Lesser General Public License for more details.
  14. You should have received a copy of the GNU Lesser General Public
  15. License along with the GNU C Library; see the file COPYING.LIB. If
  16. not, see <http://www.gnu.org/licenses/>.  */
  17. #include <jmpbuf-offsets.h>
  18. #ifdef __UCLIBC_HAS_FLOATS__
  19. #define FP(x...) x
  20. #else
  21. #define FP(x...)
  22. #endif
  23. .globl __longjmp;
  24. .type __longjmp,@function;
  25. .align 4;
  26. __longjmp:
  27. l.lwz r1,0(r3)
  28. l.lwz r2,4(r3)
  29. /* if r4 is 0, something wrong, so set it to 1 */
  30. l.sfeqi r4, 0x0
  31. l.bnf 1f /* r4 != 0, longjmp value sensible */
  32. l.nop
  33. l.ori r4, r0, 0x1 /* make nonzero */
  34. 1:
  35. l.addi r11, r4, 0
  36. l.lwz r9,8(r3)
  37. l.lwz r10,12(r3)
  38. l.lwz r14,16(r3)
  39. l.lwz r16,20(r3)
  40. l.lwz r18,24(r3)
  41. l.lwz r20,28(r3)
  42. l.lwz r22,32(r3)
  43. l.lwz r24,36(r3)
  44. l.lwz r26,40(r3)
  45. l.lwz r28,44(r3)
  46. l.lwz r30,48(r3)
  47. l.jr r9
  48. l.nop
  49. .size __longjmp,.-__longjmp
  50. libc_hidden_def(__longjmp)