setjmp.S 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. /* Copyright (C) 1991, 93, 94, 96, 97, 98 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. <http://www.gnu.org/licenses/>. */
  14. #include <jmpbuf-offsets.h>
  15. #define ST_FLUSH_WINDOWS 3
  16. .global _setjmp
  17. .type _setjmp,%function
  18. .align 4
  19. _setjmp:
  20. b 1f
  21. set 0, %o1
  22. .size _setjmp,.-_setjmp
  23. .global setjmp
  24. .type setjmp,%function
  25. .align 4
  26. setjmp:
  27. set 1, %o1
  28. .size setjmp,.-setjmp
  29. .global __sigsetjmp
  30. .type __sigsetjmp,%function
  31. .align 4
  32. __sigsetjmp:
  33. 1:
  34. /* Save our PC, SP and FP. Save the signal mask if requested with
  35. a tail-call for simplicity; it always returns zero. */
  36. ta ST_FLUSH_WINDOWS
  37. st %o7, [%o0 + (JB_PC * 4)]
  38. st %sp, [%o0 + (JB_SP * 4)]
  39. st %fp, [%o0 + (JB_FP * 4)]
  40. mov %o7, %g1
  41. call __sigjmp_save
  42. mov %g1, %o7
  43. .size __sigsetjmp,.-__sigsetjmp
  44. .weak _setjmp
  45. .weak setjmp