--- configure.in +++ configure.in 2000/06/20 09:17:54 @@ -786,7 +786,8 @@ AC_MSG_RESULT(no)) AC_MSG_CHECKING(for fcntl(F_SETLK)) -AC_TRY_LINK([#include ], +AC_TRY_LINK([#include +#include ], [struct flock lck; lck.l_whence = SEEK_SET; lck.l_start = lck.l_len = 0; lck.l_type = F_WRLCK; --- src/include/port/linux.h +++ src/include/port/linux.h 2000/06/20 09:35:00 @@ -33,7 +33,12 @@ #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 --- src/include/storage/s_lock.h +++ src/include/storage/s_lock.h 2000/06/20 09:40:50 @@ -95,6 +95,24 @@ #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)