setjmp.S 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. /* Copyright (C) 1997-2016 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 License as
  5. published by the Free Software Foundation; either version 2.1 of the
  6. 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 <jmpbuf-offsets.h>
  16. /* Keep traditional entry points in with sigsetjmp(). */
  17. ENTRY (setjmp)
  18. mov x1, #1
  19. b 1f
  20. END (setjmp)
  21. ENTRY (_setjmp)
  22. mov x1, #0
  23. b 1f
  24. END (_setjmp)
  25. libc_hidden_def (_setjmp)
  26. ENTRY (__sigsetjmp)
  27. 1:
  28. stp x19, x20, [x0, #JB_X19<<3]
  29. stp x21, x22, [x0, #JB_X21<<3]
  30. stp x23, x24, [x0, #JB_X23<<3]
  31. stp x25, x26, [x0, #JB_X25<<3]
  32. stp x27, x28, [x0, #JB_X27<<3]
  33. stp x29, x30, [x0, #JB_X29<<3]
  34. /* setjmp probe takes 3 arguments, address of jump buffer
  35. first argument (8@x0), return value second argument (-4@x1),
  36. and target address (8@x30), respectively. */
  37. //LIBC_PROBE (setjmp, 3, 8@x0, -4@x1, 8@x30)
  38. stp d8, d9, [x0, #JB_D8<<3]
  39. stp d10, d11, [x0, #JB_D10<<3]
  40. stp d12, d13, [x0, #JB_D12<<3]
  41. stp d14, d15, [x0, #JB_D14<<3]
  42. mov x2, sp
  43. str x2, [x0, #JB_SP<<3]
  44. b C_SYMBOL_NAME(__sigjmp_save)
  45. END (__sigsetjmp)
  46. hidden_def (__sigsetjmp)