lock support for aarch64 - Mailing list pgsql-hackers

From Mark Salter
Subject lock support for aarch64
Date
Msg-id 1368448758.23422.12.camel@t520.redhat.com
Whole thread Raw
Responses Re: lock support for aarch64  (Heikki Linnakangas <hlinnakangas@vmware.com>)
Re: lock support for aarch64  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
I used the following patch to add lock support aarch64. It is just a
copy of the arm support based on gcc builtins. Postgresql built with
this patch passes the various tests.

diff --git a/src/include/storage/s_lock.h b/src/include/storage/s_lock.h
index d4a783f..624a73b 100644
--- a/src/include/storage/s_lock.h
+++ b/src/include/storage/s_lock.h
@@ -335,6 +335,25 @@ tas(volatile slock_t *lock)#endif     /* __arm__ */
+/*
+ * Use gcc builtins for AArch64.
+ */
+#if defined(__aarch64__)
+#define HAS_TEST_AND_SET
+
+#define TAS(lock) tas(lock)
+
+typedef int slock_t;
+
+static __inline__ int
+tas(volatile slock_t *lock)
+{
+    return __sync_lock_test_and_set(lock, 1);
+}
+
+#define S_UNLOCK(lock) __sync_lock_release(lock)
+#endif /* __aarch64__ */
+/* S/390 and S/390x Linux (32- and 64-bit zSeries) */#if defined(__s390__) || defined(__s390x__)#define
HAS_TEST_AND_SET





pgsql-hackers by date:

Previous
From: Amit Langote
Date:
Subject: Re: Logging of PAM Authentication Failure
Next
From: "ktm@rice.edu"
Date:
Subject: Re: corrupt pages detected by enabling checksums