diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/include/port/linux.h | 7 | ||||
-rw-r--r-- | src/include/storage/s_lock.h | 20 |
2 files changed, 25 insertions, 2 deletions
diff --git a/src/include/port/linux.h b/src/include/port/linux.h index 2ddb34df2c5..3555aba6d04 100644 --- a/src/include/port/linux.h +++ b/src/include/port/linux.h @@ -33,7 +33,12 @@ typedef unsigned int slock_t; #define HAS_TEST_AND_SET #elif defined(__arm__) -typedef unsigned char slock_t +typedef unsigned char slock_t; + +#define HAS_TEST_AND_SET + +#elif defined(__ia64__) +typedef unsigned int slock_t; #define HAS_TEST_AND_SET diff --git a/src/include/storage/s_lock.h b/src/include/storage/s_lock.h index fadd87edb75..98cbf10920a 100644 --- a/src/include/storage/s_lock.h +++ b/src/include/storage/s_lock.h @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/include/storage/s_lock.h,v 1.70 2000/04/12 17:16:51 momjian Exp $ + * $Header: /cvsroot/pgsql/src/include/storage/s_lock.h,v 1.71 2000/07/05 16:09:31 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -95,6 +95,24 @@ __asm__("lock; xchgb %0,%1": "=q"(_res), "=m"(*lock):"0"(_res)); #endif /* __i386__ */ +#ifdef __ia64__ +#define TAS(lock) tas(lock) + +static __inline__ int +tas (volatile slock_t *lock) +{ + long int ret; + + __asm__ __volatile__( + "xchg4 %0=%1,%2" + : "=r"(ret), "=m"(*lock) + : "r"(1), "1"(*lock) + : "memory"); + + return (int) ret; +} +#endif /* __ia64__ */ + #if defined(__arm__) || defined(__arm__) #define TAS(lock) tas(lock) |