setjmp.S 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /* Copyright (C) 2011-2018 Free Software Foundation, Inc.
  2. The GNU C Library is free software; you can redistribute it and/or
  3. modify it under the terms of the GNU Lesser General Public
  4. License as published by the Free Software Foundation; either
  5. version 2.1 of the License, or (at your option) any later version.
  6. The GNU C Library is distributed in the hope that it will be useful,
  7. but WITHOUT ANY WARRANTY; without even the implied warranty of
  8. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  9. Lesser General Public License for more details.
  10. You should have received a copy of the GNU Lesser General Public
  11. License along with the GNU C Library. If not, see
  12. <http://www.gnu.org/licenses/>. */
  13. #include <sysdep.h>
  14. #include <jmpbuf-offsets.h>
  15. .text
  16. /* Keep traditional entry points in with sigsetjmp(). */
  17. ENTRY(setjmp)
  18. { movei r1, 1; j 1f }
  19. END(setjmp)
  20. ENTRY(_setjmp)
  21. { movei r1, 0; j 1f }
  22. END(_setjmp)
  23. libc_hidden_def (_setjmp)
  24. ENTRY(__sigsetjmp)
  25. 1:
  26. move r2, r0
  27. #define SAVE(r) { st r2, r ; ADDI_PTR r2, r2, REGSIZE }
  28. FOR_EACH_CALLEE_SAVED_REG(SAVE)
  29. mfspr r3, INTERRUPT_CRITICAL_SECTION
  30. st r2, r3
  31. j plt(__sigjmp_save)
  32. jrp lr /* Keep the backtracer happy. */
  33. END(__sigsetjmp)
  34. hidden_def (__sigsetjmp)