summaryrefslogtreecommitdiff
path: root/libitm/config/sh/sjlj.S
blob: 3489f83ef62a7223b7bdf776893c28db72ed5950 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
/* Copyright (C) 2011-2014 Free Software Foundation, Inc.

   This file is part of the GNU Transactional Memory Library (libitm).

   Libitm is free software; you can redistribute it and/or modify it
   under the terms of the GNU General Public License as published by
   the Free Software Foundation; either version 3 of the License, or
   (at your option) any later version.

   Libitm is distributed in the hope that it will be useful, but WITHOUT ANY
   WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
   FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
   more details.

   Under Section 7 of GPL version 3, you are granted additional
   permissions described in the GCC Runtime Library Exception, version
   3.1, as published by the Free Software Foundation.

   You should have received a copy of the GNU General Public License and
   a copy of the GCC Runtime Library Exception along with this program;
   see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
   <http://www.gnu.org/licenses/>.  */

#include "asmcfi.h"

	.text
	.align	2
	.global	_ITM_beginTransaction
	.type	_ITM_beginTransaction, %function

_ITM_beginTransaction:
	cfi_startproc
	mov	r15, r1
#ifdef __SH_FPU_ANY__
	fmov.s	fr15, @-r15
	fmov.s	fr14, @-r15
	fmov.s	fr13, @-r15
	fmov.s	fr12, @-r15
	sts.l	fpscr, @-r15
#endif /* __SH_FPU_ANY__ */
	stc.l	gbr, @-r15
	sts.l	pr, @-r15
	mov.l	r1, @-r15
	mov.l	r14, @-r15
	mov.l	r13, @-r15
	mov.l	r12, @-r15
	mov.l	r11, @-r15
	mov.l	r10, @-r15
	mov.l	r9, @-r15
	mov.l	r8, @-r15
#ifdef __SH_FPU_ANY__
	cfi_def_cfa_offset (4*15)
#else
	cfi_def_cfa_offset (4*10)
#endif
#if defined HAVE_ATTRIBUTE_VISIBILITY || !defined __PIC__
	mov.l	.Lbegin, r1
	jsr	@r1
	 mov	r15, r5
#else
	mova	.Lgot, r0
	mov.l	.Lgot, r12
	add	r0, r12
	mov.l	.Lbegin, r1
	bsrf	r1
	 mov	r15, r5
.Lbegin0:
	mov.l	@(4*4,r15), r12
#endif
	mov.l	@(8*4,r15), r1
	lds	r1, pr
#ifdef __SH_FPU_ANY__
	add	#(15*4), r15
#else
	add	#(10*5), r15
#endif
	cfi_def_cfa_offset (0)
	rts
	 nop
	cfi_endproc

        .align  2
.Lgot:
	.long	_GLOBAL_OFFSET_TABLE_
.Lbegin:
#if defined HAVE_ATTRIBUTE_VISIBILITY || !defined __PIC__
	.long	GTM_begin_transaction
#else
	.long	GTM_begin_transaction@PLT-(.Lbegin0-.)
#endif
	.size	_ITM_beginTransaction, . - _ITM_beginTransaction

	.global	GTM_longjmp
	.hidden	GTM_longjmp
	.type	GTM_longjmp, %function

GTM_longjmp:
	mov.l	@r5+, r8
	mov.l	@r5+, r9
	mov.l	@r5+, r10
	mov.l	@r5+, r11
	mov.l	@r5+, r12
	mov.l	@r5+, r13
	mov.l	@r5+, r14
	mov.l	@r5+, r15
	lds.l	@r5+, pr
	ldc.l	@r5+, gbr
#ifdef __SH_FPU_ANY__
	lds.l	@r5+, fpscr
	fmov.s	@r5+, fr12
	fmov.s	@r5+, fr13
	fmov.s	@r5+, fr14
	fmov.s	@r5+, fr15
#endif
	rts
	 mov	r4, r0

	.size	GTM_longjmp, . - GTM_longjmp

#ifdef __linux__
.section .note.GNU-stack, "", %progbits
#endif