$NetBSD: patch-af,v 1.5 1999/07/11 20:00:43 bad Exp $ *** include/storage/s_lock.h Sat Apr 10 19:43:01 1999 --- include/storage/s_lock.h Wed Apr 7 03:06:53 1999 *************** *** 124,129 **** --- 124,145 ---- + #if defined(__arm32__) + #define TAS(lock) tas(lock) + + static __inline__ int + tas(volatile slock_t *lock) + { + register slock_t _res = 1; + + __asm__("swpb %0, %0, [%3]": "=r"(_res), "=m"(*lock):"0"(_res), "r" (lock)); + return (int) _res; + } + + #endif /* __arm32__ */ + + + #if defined(sparc) #define TAS(lock) tas(lock)