__longjmp.S 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /* longjmp, RISC-V version.
  2. Copyright (C) 1996-2018 Free Software Foundation, Inc.
  3. The GNU C Library is free software; you can redistribute it and/or
  4. modify it under the terms of the GNU Lesser General Public
  5. License as published by the Free Software Foundation; either
  6. version 2.1 of the License, or (at your option) any later version.
  7. The GNU C Library is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  10. Lesser General Public License for more details.
  11. You should have received a copy of the GNU Lesser General Public
  12. License along with the GNU C Library. If not, see
  13. <http://www.gnu.org/licenses/>. */
  14. #include <sysdep.h>
  15. #include <sys/asm.h>
  16. ENTRY (__longjmp)
  17. REG_L ra, 0*SZREG(a0)
  18. REG_L s0, 1*SZREG(a0)
  19. REG_L s1, 2*SZREG(a0)
  20. REG_L s2, 3*SZREG(a0)
  21. REG_L s3, 4*SZREG(a0)
  22. REG_L s4, 5*SZREG(a0)
  23. REG_L s5, 6*SZREG(a0)
  24. REG_L s6, 7*SZREG(a0)
  25. REG_L s7, 8*SZREG(a0)
  26. REG_L s8, 9*SZREG(a0)
  27. REG_L s9, 10*SZREG(a0)
  28. REG_L s10,11*SZREG(a0)
  29. REG_L s11,12*SZREG(a0)
  30. REG_L sp, 13*SZREG(a0)
  31. #ifndef __riscv_float_abi_soft
  32. FREG_L fs0, 14*SZREG+ 0*SZFREG(a0)
  33. FREG_L fs1, 14*SZREG+ 1*SZFREG(a0)
  34. FREG_L fs2, 14*SZREG+ 2*SZFREG(a0)
  35. FREG_L fs3, 14*SZREG+ 3*SZFREG(a0)
  36. FREG_L fs4, 14*SZREG+ 4*SZFREG(a0)
  37. FREG_L fs5, 14*SZREG+ 5*SZFREG(a0)
  38. FREG_L fs6, 14*SZREG+ 6*SZFREG(a0)
  39. FREG_L fs7, 14*SZREG+ 7*SZFREG(a0)
  40. FREG_L fs8, 14*SZREG+ 8*SZFREG(a0)
  41. FREG_L fs9, 14*SZREG+ 9*SZFREG(a0)
  42. FREG_L fs10,14*SZREG+10*SZFREG(a0)
  43. FREG_L fs11,14*SZREG+11*SZFREG(a0)
  44. #endif
  45. seqz a0, a1
  46. add a0, a0, a1 # a0 = (a1 == 0) ? 1 : a1
  47. ret
  48. END (__longjmp)
  49. libc_hidden_def(__longjmp)