siglongjmp.S 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. /* libunwind - a platform-independent unwind library
  2. Copyright (C) 2003-2004 Hewlett-Packard Co
  3. Contributed by David Mosberger-Tang <davidm@hpl.hp.com>
  4. This file is part of libunwind.
  5. Permission is hereby granted, free of charge, to any person obtaining
  6. a copy of this software and associated documentation files (the
  7. "Software"), to deal in the Software without restriction, including
  8. without limitation the rights to use, copy, modify, merge, publish,
  9. distribute, sublicense, and/or sell copies of the Software, and to
  10. permit persons to whom the Software is furnished to do so, subject to
  11. the following conditions:
  12. The above copyright notice and this permission notice shall be
  13. included in all copies or substantial portions of the Software.
  14. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  15. EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  16. MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  17. NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
  18. LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
  19. OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
  20. WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
  21. #define SIG_SETMASK 2
  22. .global _UI_siglongjmp_cont
  23. .global sigprocmask
  24. .align 32
  25. .proc siglongjmp_continuation
  26. siglongjmp_continuation:
  27. _UI_siglongjmp_cont: // non-function label for siglongjmp.c
  28. .prologue
  29. .save rp, r15
  30. .body
  31. nop 0
  32. nop 0
  33. br.call.sptk.many b6 = .next
  34. ;;
  35. .prologue
  36. .save ar.pfs, r33
  37. .next: alloc loc1 = ar.pfs, 0, 3, 3, 0
  38. /*
  39. * Note: we can use the scratch stack are because the caller
  40. * of sigsetjmp() by definition is not a leaf-procedure.
  41. */
  42. st8 [sp] = r17 // store signal mask
  43. .save rp, loc0
  44. mov loc0 = r15 // final continuation point
  45. ;;
  46. .body
  47. mov loc2 = r16 // value to return in r8
  48. mov out0 = SIG_SETMASK
  49. mov out1 = sp
  50. mov out2 = r0
  51. br.call.sptk.many rp = sigprocmask
  52. ;;
  53. mov rp = loc0
  54. mov ar.pfs = loc1
  55. mov r8 = loc2
  56. br.ret.sptk.many rp
  57. .endp siglongjmp_continuation
  58. #ifdef __linux__
  59. /* We do not need executable stack. */
  60. .section .note.GNU-stack,"",@progbits
  61. #endif