|
|
@ -63,7 +63,7 @@ |
|
|
|
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group |
|
|
|
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group |
|
|
|
* Portions Copyright (c) 1994, Regents of the University of California |
|
|
|
* Portions Copyright (c) 1994, Regents of the University of California |
|
|
|
* |
|
|
|
* |
|
|
|
* $Id: s_lock.h,v 1.105 2003/04/04 06:57:39 tgl Exp $ |
|
|
|
* $Id: s_lock.h,v 1.106 2003/04/20 21:54:34 tgl Exp $ |
|
|
|
* |
|
|
|
* |
|
|
|
*------------------------------------------------------------------------- |
|
|
|
*------------------------------------------------------------------------- |
|
|
|
*/ |
|
|
|
*/ |
|
|
@ -221,7 +221,12 @@ tas(volatile slock_t *lock) |
|
|
|
|
|
|
|
|
|
|
|
#endif /* __sparc__ */ |
|
|
|
#endif /* __sparc__ */ |
|
|
|
|
|
|
|
|
|
|
|
#if defined(__powerpc__) || defined(__powerpc64__) |
|
|
|
#if defined(__ppc__) || defined(__powerpc__) || defined(__powerpc64__) |
|
|
|
|
|
|
|
#define TAS(lock) tas(lock) |
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
|
|
* NOTE: per the Enhanced PowerPC Architecture manual, v1.0 dated 7-May-2002, |
|
|
|
|
|
|
|
* an isync is a sufficient synchronization barrier after a lwarx/stwcx loop. |
|
|
|
|
|
|
|
*/ |
|
|
|
static __inline__ int |
|
|
|
static __inline__ int |
|
|
|
tas(volatile slock_t *lock) |
|
|
|
tas(volatile slock_t *lock) |
|
|
|
{ |
|
|
|
{ |
|
|
@ -248,7 +253,8 @@ tas(volatile slock_t *lock) |
|
|
|
); |
|
|
|
); |
|
|
|
return _res; |
|
|
|
return _res; |
|
|
|
} |
|
|
|
} |
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
#endif /* powerpc */ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#if defined(__mc68000__) && defined(__linux__) |
|
|
|
#if defined(__mc68000__) && defined(__linux__) |
|
|
@ -273,10 +279,9 @@ tas(volatile slock_t *lock) |
|
|
|
#endif /* defined(__mc68000__) && defined(__linux__) */ |
|
|
|
#endif /* defined(__mc68000__) && defined(__linux__) */ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#if defined(__ppc__) || defined(__powerpc__) |
|
|
|
#if defined(__ppc__) || defined(__powerpc__) || defined(__powerpc64__) |
|
|
|
/*
|
|
|
|
/*
|
|
|
|
* We currently use out-of-line assembler for TAS on PowerPC; see s_lock.c. |
|
|
|
* PowerPC S_UNLOCK is almost standard but requires a "sync" instruction. |
|
|
|
* S_UNLOCK is almost standard but requires a "sync" instruction. |
|
|
|
|
|
|
|
*/ |
|
|
|
*/ |
|
|
|
#define S_UNLOCK(lock) \ |
|
|
|
#define S_UNLOCK(lock) \ |
|
|
|
do \
|
|
|
|
do \
|
|
|
@ -285,7 +290,7 @@ do \ |
|
|
|
*((volatile slock_t *) (lock)) = 0; \
|
|
|
|
*((volatile slock_t *) (lock)) = 0; \
|
|
|
|
} while (0) |
|
|
|
} while (0) |
|
|
|
|
|
|
|
|
|
|
|
#endif /* defined(__ppc__) || defined(__powerpc__) */ |
|
|
|
#endif /* powerpc */ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#if defined(NEED_VAX_TAS_ASM) |
|
|
|
#if defined(NEED_VAX_TAS_ASM) |
|
|
|