sjlj.S 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. /* Copyright (C) 2011-2022 Free Software Foundation, Inc.
  2. This file is part of the GNU Transactional Memory Library (libitm).
  3. Libitm is free software; you can redistribute it and/or modify it
  4. under the terms of the GNU General Public License as published by
  5. the Free Software Foundation; either version 3 of the License, or
  6. (at your option) any later version.
  7. Libitm is distributed in the hope that it will be useful, but WITHOUT ANY
  8. WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  9. FOR A PARTICULAR PURPOSE. See the GNU General Public License for
  10. more details.
  11. Under Section 7 of GPL version 3, you are granted additional
  12. permissions described in the GCC Runtime Library Exception, version
  13. 3.1, as published by the Free Software Foundation.
  14. You should have received a copy of the GNU General Public License and
  15. a copy of the GCC Runtime Library Exception along with this program;
  16. see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
  17. <http://www.gnu.org/licenses/>. */
  18. #include "asmcfi.h"
  19. .text
  20. .align 2
  21. .global _ITM_beginTransaction
  22. .type _ITM_beginTransaction, %function
  23. _ITM_beginTransaction:
  24. cfi_startproc
  25. mov r15, r1
  26. #ifdef __SH_FPU_ANY__
  27. fmov.s fr15, @-r15
  28. fmov.s fr14, @-r15
  29. fmov.s fr13, @-r15
  30. fmov.s fr12, @-r15
  31. sts.l fpscr, @-r15
  32. #endif /* __SH_FPU_ANY__ */
  33. stc.l gbr, @-r15
  34. sts.l pr, @-r15
  35. mov.l r1, @-r15
  36. mov.l r14, @-r15
  37. mov.l r13, @-r15
  38. mov.l r12, @-r15
  39. mov.l r11, @-r15
  40. mov.l r10, @-r15
  41. mov.l r9, @-r15
  42. mov.l r8, @-r15
  43. #ifdef __SH_FPU_ANY__
  44. cfi_def_cfa_offset (4*15)
  45. #else
  46. cfi_def_cfa_offset (4*10)
  47. #endif
  48. #if !defined __PIC__
  49. mov.l .Lbegin, r1
  50. jsr @r1
  51. mov r15, r5
  52. #else
  53. mov.l .Lbegin, r1
  54. bsrf r1
  55. mov r15, r5
  56. .Lbegin0:
  57. mov.l @(4*4,r15), r12
  58. #endif
  59. mov.l @(8*4,r15), r1
  60. lds r1, pr
  61. #ifdef __SH_FPU_ANY__
  62. add #(15*4), r15
  63. #else
  64. add #(10*5), r15
  65. #endif
  66. cfi_def_cfa_offset (0)
  67. rts
  68. nop
  69. cfi_endproc
  70. .align 2
  71. .Lbegin:
  72. #if !defined __PIC__
  73. .long GTM_begin_transaction
  74. #else
  75. .long GTM_begin_transaction@PCREL-(.Lbegin0-.)
  76. #endif
  77. .size _ITM_beginTransaction, . - _ITM_beginTransaction
  78. .global GTM_longjmp
  79. .hidden GTM_longjmp
  80. .type GTM_longjmp, %function
  81. GTM_longjmp:
  82. mov.l @r5+, r8
  83. mov.l @r5+, r9
  84. mov.l @r5+, r10
  85. mov.l @r5+, r11
  86. mov.l @r5+, r12
  87. mov.l @r5+, r13
  88. mov.l @r5+, r14
  89. mov.l @r5+, r15
  90. lds.l @r5+, pr
  91. ldc.l @r5+, gbr
  92. #ifdef __SH_FPU_ANY__
  93. lds.l @r5+, fpscr
  94. fmov.s @r5+, fr12
  95. fmov.s @r5+, fr13
  96. fmov.s @r5+, fr14
  97. fmov.s @r5+, fr15
  98. #endif
  99. rts
  100. mov r4, r0
  101. .size GTM_longjmp, . - GTM_longjmp
  102. #ifdef __linux__
  103. .section .note.GNU-stack, "", %progbits
  104. #endif