aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruce Momjian <bruce@momjian.us>1999-04-13 17:42:26 +0000
committerBruce Momjian <bruce@momjian.us>1999-04-13 17:42:26 +0000
commitc0cd32d7b4934d9359255b5abd3eb98398528e20 (patch)
tree8fe92886c6067237a0020971e02d28cb1921bbd9
parenta01dfe71b868e5e5fd435018aed3f020ce8c72ed (diff)
downloadpostgresql-c0cd32d7b4934d9359255b5abd3eb98398528e20.tar.gz
postgresql-c0cd32d7b4934d9359255b5abd3eb98398528e20.zip
Add ARM32 support by Andrew McMurry
-rw-r--r--src/include/port/bsd.h4
-rw-r--r--src/include/storage/s_lock.h18
2 files changed, 21 insertions, 1 deletions
diff --git a/src/include/port/bsd.h b/src/include/port/bsd.h
index cfd0d2811bd..f24f4f83b57 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 3863b55a62d..9aef29bffce 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)