From: Bruce Momjian Date: Tue, 13 Apr 1999 17:42:26 +0000 (+0000) Subject: Add ARM32 support by Andrew McMurry X-Git-Tag: REL6_5~400 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c0cd32d7b4934d9359255b5abd3eb98398528e20;p=postgresql Add ARM32 support by Andrew McMurry --- diff --git a/src/include/port/bsd.h b/src/include/port/bsd.h index cfd0d2811b..f24f4f83b5 100644 --- a/src/include/port/bsd.h +++ b/src/include/port/bsd.h @@ -24,6 +24,10 @@ #define HAS_TEST_AND_SET #endif +#if defined(__arm32__) +#define HAS_TEST_AND_SET +#endif + #if defined(__powerpc__) #define HAS_TEST_AND_SET typedef unsigned int slock_t; diff --git a/src/include/storage/s_lock.h b/src/include/storage/s_lock.h index 3863b55a62..9aef29bffc 100644 --- a/src/include/storage/s_lock.h +++ b/src/include/storage/s_lock.h @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/include/storage/s_lock.h,v 1.58 1999/02/13 23:22:09 momjian Exp $ + * $Header: /cvsroot/pgsql/src/include/storage/s_lock.h,v 1.59 1999/04/13 17:42:26 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -124,6 +124,22 @@ __asm__("lock; xchgb %0,%1": "=q"(_res), "=m"(*lock):"0"(_res)); +#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)