File tree Expand file tree Collapse file tree 1 file changed +29
-2
lines changed Expand file tree Collapse file tree 1 file changed +29
-2
lines changed Original file line number Diff line number Diff line change 63
63
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
64
64
* Portions Copyright (c) 1994, Regents of the University of California
65
65
*
66
- * $Id: s_lock.h,v 1.102 2002/11/10 00:33:43 momjian Exp $
66
+ * $Id: s_lock.h,v 1.103 2002/11/22 01:13:16 tgl Exp $
67
67
*
68
68
*-------------------------------------------------------------------------
69
69
*/
@@ -150,7 +150,8 @@ tas(volatile slock_t *lock)
150
150
151
151
#endif /* __arm__ */
152
152
153
- #if defined(__s390__ ) || defined(__s390x__ )
153
+
154
+ #if defined(__s390__ ) && !defined(__s390x__ )
154
155
/*
155
156
* S/390 Linux
156
157
*/
@@ -176,6 +177,32 @@ tas(volatile slock_t *lock)
176
177
177
178
#endif /* __s390__ */
178
179
180
+ #if defined(__s390x__ )
181
+ /*
182
+ * S/390x Linux (64-bit zSeries)
183
+ */
184
+ #define TAS (lock ) tas(lock)
185
+
186
+ static __inline__ int
187
+ tas (volatile slock_t * lock )
188
+ {
189
+ int _res ;
190
+
191
+ __asm__ __volatile__(
192
+ " la 1,1 \n"
193
+ " lg 2,%2 \n"
194
+ " slr 0,0 \n"
195
+ " cs 0,1,0(2) \n"
196
+ " lr %1,0 \n"
197
+ : "=m" (lock ), "=d" (_res )
198
+ : "m" (lock )
199
+ : "0" , "1" , "2" );
200
+
201
+ return (_res );
202
+ }
203
+
204
+ #endif /* __s390x__ */
205
+
179
206
180
207
#if defined(__sparc__ )
181
208
#define TAS (lock ) tas(lock)
You can’t perform that action at this time.
0 commit comments