__longjmp.S 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. /* Copyright (C) 1992-2026 Free Software Foundation, Inc.
  2. This file is part of the GNU C Library.
  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. <https://www.gnu.org/licenses/>. */
  14. #define __ASSEMBLY__
  15. #include <sysdep.h>
  16. #include <pointer_guard.h>
  17. #include <jmpbuf-offsets.h>
  18. ENTRY(__longjmp)
  19. #ifdef PROF
  20. ldgp gp, 0(pv)
  21. .set noat
  22. lda AT, _mcount
  23. jsr AT, (AT), _mcount
  24. .set at
  25. .prologue 1
  26. #else
  27. .prologue 0
  28. #endif
  29. mov a1, v0
  30. ldq s0, JB_S0*8(a0)
  31. ldq s1, JB_S1*8(a0)
  32. ldq s2, JB_S2*8(a0)
  33. ldq s3, JB_S3*8(a0)
  34. ldq s4, JB_S4*8(a0)
  35. ldq s5, JB_S5*8(a0)
  36. ldq ra, JB_PC*8(a0)
  37. ldq fp, JB_FP*8(a0)
  38. ldq t0, JB_SP*8(a0)
  39. ldt $f2, JB_F2*8(a0)
  40. ldt $f3, JB_F3*8(a0)
  41. ldt $f4, JB_F4*8(a0)
  42. ldt $f5, JB_F5*8(a0)
  43. ldt $f6, JB_F6*8(a0)
  44. ldt $f7, JB_F7*8(a0)
  45. ldt $f8, JB_F8*8(a0)
  46. ldt $f9, JB_F9*8(a0)
  47. #ifdef PTR_DEMANGLE
  48. PTR_DEMANGLE(ra, t1)
  49. PTR_DEMANGLE2(t0, t1)
  50. PTR_DEMANGLE2(fp, t1)
  51. #endif
  52. cmoveq v0, 1, v0
  53. mov t0, sp
  54. ret
  55. END(__longjmp)