1
# DP: Build libitm on AArch64, patch taken from the trunk.
3
+++ b/src/libitm/config/aarch64/sjlj.S
5
+/* Copyright (C) 2014 Free Software Foundation, Inc.
6
+ Contributed by Richard Henderson <rth@redhat.com>.
8
+ This file is part of the GNU Transactional Memory Library (libitm).
10
+ Libitm is free software; you can redistribute it and/or modify it
11
+ under the terms of the GNU General Public License as published by
12
+ the Free Software Foundation; either version 3 of the License, or
13
+ (at your option) any later version.
15
+ Libitm is distributed in the hope that it will be useful, but WITHOUT ANY
16
+ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
17
+ FOR A PARTICULAR PURPOSE. See the GNU General Public License for
20
+ Under Section 7 of GPL version 3, you are granted additional
21
+ permissions described in the GCC Runtime Library Exception, version
22
+ 3.1, as published by the Free Software Foundation.
24
+ You should have received a copy of the GNU General Public License and
25
+ a copy of the GCC Runtime Library Exception along with this program;
26
+ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
27
+ <http://www.gnu.org/licenses/>. */
33
+ .global _ITM_beginTransaction
34
+ .type _ITM_beginTransaction, %function
36
+_ITM_beginTransaction:
39
+ stp x29, x30, [sp, -11*16]!
40
+ cfi_adjust_cfa_offset(11*16)
41
+ cfi_rel_offset(x29, 0)
42
+ cfi_rel_offset(x30, 8)
44
+ stp x19, x20, [sp, 1*16]
45
+ stp x21, x22, [sp, 2*16]
46
+ stp x23, x24, [sp, 3*16]
47
+ stp x25, x26, [sp, 4*16]
48
+ stp x27, x28, [sp, 5*16]
49
+ stp d8, d9, [sp, 6*16]
50
+ stp d10, d11, [sp, 7*16]
51
+ stp d12, d13, [sp, 8*16]
52
+ stp d14, d15, [sp, 9*16]
55
+ /* Invoke GTM_begin_transaction with the struct we just built. */
57
+ bl GTM_begin_transaction
59
+ /* Return; we don't need to restore any of the call-saved regs. */
62
+ cfi_adjust_cfa_offset(-11*16)
67
+ .size _ITM_beginTransaction, . - _ITM_beginTransaction
72
+ .type GTM_longjmp, %function
75
+ /* The first parameter becomes the return value (x0).
76
+ The third parameter is ignored for now. */
78
+ ldp x19, x20, [x1, 1*16]
79
+ ldp x21, x22, [x1, 2*16]
80
+ ldp x23, x24, [x1, 3*16]
81
+ ldp x25, x26, [x1, 4*16]
82
+ ldp x27, x28, [x1, 5*16]
83
+ ldp d8, d9, [x1, 6*16]
84
+ ldp d10, d11, [x1, 7*16]
85
+ ldp d12, d13, [x1, 8*16]
86
+ ldp d14, d15, [x1, 9*16]
93
+ .size GTM_longjmp, . - GTM_longjmp
96
+.section .note.GNU-stack, "", %progbits
99
+++ b/src/libitm/config/aarch64/target.h
101
+/* Copyright (C) 2014 Free Software Foundation, Inc.
102
+ Contributed by Richard Henderson <rth@redhat.com>.
104
+ This file is part of the GNU Transactional Memory Library (libitm).
106
+ Libitm is free software; you can redistribute it and/or modify it
107
+ under the terms of the GNU General Public License as published by
108
+ the Free Software Foundation; either version 3 of the License, or
109
+ (at your option) any later version.
111
+ Libitm is distributed in the hope that it will be useful, but WITHOUT ANY
112
+ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
113
+ FOR A PARTICULAR PURPOSE. See the GNU General Public License for
116
+ Under Section 7 of GPL version 3, you are granted additional
117
+ permissions described in the GCC Runtime Library Exception, version
118
+ 3.1, as published by the Free Software Foundation.
120
+ You should have received a copy of the GNU General Public License and
121
+ a copy of the GCC Runtime Library Exception along with this program;
122
+ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
123
+ <http://www.gnu.org/licenses/>. */
125
+namespace GTM HIDDEN {
127
+typedef struct gtm_jmpbuf
129
+ unsigned long long fp; /* x29 */
130
+ unsigned long long pc; /* x30 */
131
+ unsigned long long gr[10]; /* x19-x28 */
132
+ unsigned long long vr[8]; /* d8-d15 */
136
+/* ??? The size of one line in hardware caches (in bytes). */
137
+#define HW_CACHELINE_SIZE 128
142
+ __asm volatile ("" : : : "memory");
146
--- a/src/libitm/configure.tgt
147
+++ b/src/libitm/configure.tgt
149
# Map the target cpu to an ARCH sub-directory. At the same time,
150
# work out any special compilation flags as necessary.
151
case "${target_cpu}" in
152
+ aarch64*) ARCH=aarch64 ;;
153
alpha*) ARCH=alpha ;;
155
XCFLAGS="${XCFLAGS} -mhtm"