sjlj.S 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. /* Copyright (C) 2013-2015 Free Software Foundation, Inc.
  2. Contributed by Andreas Krebbel <krebbel@linux.vnet.ibm.com>
  3. This file is part of the GNU Transactional Memory Library (libitm).
  4. Libitm is free software; you can redistribute it and/or modify it
  5. under the terms of the GNU General Public License as published by
  6. the Free Software Foundation; either version 3 of the License, or
  7. (at your option) any later version.
  8. Libitm is distributed in the hope that it will be useful, but WITHOUT ANY
  9. WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  10. FOR A PARTICULAR PURPOSE. See the GNU General Public License for
  11. more details.
  12. Under Section 7 of GPL version 3, you are granted additional
  13. permissions described in the GCC Runtime Library Exception, version
  14. 3.1, as published by the Free Software Foundation.
  15. You should have received a copy of the GNU General Public License and
  16. a copy of the GCC Runtime Library Exception along with this program;
  17. see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
  18. <http://www.gnu.org/licenses/>. */
  19. #include "asmcfi.h"
  20. .text
  21. .align 4
  22. .globl _ITM_beginTransaction
  23. .type _ITM_beginTransaction, @function
  24. /* _ITM_beginTransaction (int props); props -> r2 */
  25. _ITM_beginTransaction:
  26. cfi_startproc
  27. #ifdef __s390x__
  28. lgr %r3,%r15 /* backup stack pointer */
  29. aghi %r15,-304 /* jump buffer (144) + reg save area (160) */
  30. cfi_adjust_cfa_offset(304)
  31. stmg %r6,%r14,160(%r15)
  32. stg %r3,72+160(%r15) /* store the old stack pointer */
  33. std %f8,80+160(%r15)
  34. std %f9,88+160(%r15)
  35. std %f10,96+160(%r15)
  36. std %f11,104+160(%r15)
  37. std %f12,112+160(%r15)
  38. std %f13,120+160(%r15)
  39. std %f14,128+160(%r15)
  40. std %f15,136+160(%r15)
  41. la %r3,160(%r15) /* second argument to GTM_begin_transaction */
  42. brasl %r14,GTM_begin_transaction
  43. lg %r1,64+160(%r15)
  44. aghi %r15,304
  45. cfi_adjust_cfa_offset(-304)
  46. br %r1
  47. #else
  48. lr %r3,%r15 /* backup stack pointer */
  49. ahi %r15,-152 /* jump buffer (56) + reg save area (96) */
  50. cfi_adjust_cfa_offset(152)
  51. stm %r6,%r14,96(%r15)
  52. st %r3,36+96(%r15) /* store the old stack pointer */
  53. std %f4,40+96(%r15)
  54. std %f6,48+96(%r15)
  55. la %r3,96(%r15) /* second argument to GTM_begin_transaction */
  56. /* begin_transaction (uint32_t prop, const gtm_jmpbuf *jb) */
  57. brasl %r14,GTM_begin_transaction /* requires mzarch */
  58. l %r1,32+96(%r15)
  59. ahi %r15,152
  60. cfi_adjust_cfa_offset(-152)
  61. br %r1
  62. #endif
  63. cfi_endproc
  64. .size _ITM_beginTransaction, .-_ITM_beginTransaction
  65. .align 4
  66. .globl GTM_longjmp
  67. .type GTM_longjmp, @function
  68. .hidden GTM_longjmp
  69. /* uint32_t GTM_longjmp (uint32_t, const gtm_jmpbuf *, uint32_t) */
  70. GTM_longjmp:
  71. /* First parameter becomes the return value of
  72. _ITM_beginTransaction (r2).
  73. Third parameter is ignored for now. */
  74. cfi_startproc
  75. #ifdef __s390x__
  76. ld %f8,80(%r3)
  77. ld %f9,88(%r3)
  78. ld %f10,96(%r3)
  79. ld %f11,104(%r3)
  80. ld %f12,112(%r3)
  81. ld %f13,120(%r3)
  82. ld %f14,128(%r3)
  83. ld %f15,136(%r3)
  84. lmg %r6,%r15,0(%r3)
  85. br %r14
  86. #else
  87. ld %f4,40(%r3)
  88. ld %f6,48(%r3)
  89. lm %r6,%r15,0(%r3)
  90. br %r14
  91. #endif
  92. cfi_endproc
  93. .size GTM_longjmp, .-GTM_longjmp
  94. .section .note.GNU-stack, "", @progbits