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.105 2003/04/04 06:57:39 tgl Exp $
66
+ * $Id: s_lock.h,v 1.106 2003/04/20 21:54:34 tgl Exp $
67
67
*
68
68
*-------------------------------------------------------------------------
69
69
*/
@@ -221,7 +221,12 @@ tas(volatile slock_t *lock)
221
221
222
222
#endif /* __sparc__ */
223
223
224
- #if defined(__powerpc__ ) || defined(__powerpc64__ )
224
+ #if defined(__ppc__ ) || defined(__powerpc__ ) || defined(__powerpc64__ )
225
+ #define TAS (lock ) tas(lock)
226
+ /*
227
+ * NOTE: per the Enhanced PowerPC Architecture manual, v1.0 dated 7-May-2002,
228
+ * an isync is a sufficient synchronization barrier after a lwarx/stwcx loop.
229
+ */
225
230
static __inline__ int
226
231
tas (volatile slock_t * lock )
227
232
{
@@ -248,7 +253,8 @@ tas(volatile slock_t *lock)
248
253
);
249
254
return _res ;
250
255
}
251
- #endif
256
+
257
+ #endif /* powerpc */
252
258
253
259
254
260
#if defined(__mc68000__ ) && defined(__linux__ )
@@ -273,10 +279,9 @@ tas(volatile slock_t *lock)
273
279
#endif /* defined(__mc68000__) && defined(__linux__) */
274
280
275
281
276
- #if defined(__ppc__ ) || defined(__powerpc__ )
282
+ #if defined(__ppc__ ) || defined(__powerpc__ ) || defined( __powerpc64__ )
277
283
/*
278
- * We currently use out-of-line assembler for TAS on PowerPC; see s_lock.c.
279
- * S_UNLOCK is almost standard but requires a "sync" instruction.
284
+ * PowerPC S_UNLOCK is almost standard but requires a "sync" instruction.
280
285
*/
281
286
#define S_UNLOCK (lock ) \
282
287
do \
285
290
*((volatile slock_t *) (lock)) = 0; \
286
291
} while (0)
287
292
288
- #endif /* defined(__ppc__) || defined(__powerpc__) */
293
+ #endif /* powerpc */
289
294
290
295
291
296
#if defined(NEED_VAX_TAS_ASM )
0 commit comments