aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2017-11-20 17:57:46 -0500
committerTom Lane <tgl@sss.pgh.pa.us>2017-11-20 17:57:46 -0500
commit940bafa75a0417128279095673a22d6d9b9e8413 (patch)
tree96997cb833f7991a9a76b6e26f2cf82a8a2f8416 /src
parenta96e2252833542ab8f79eb27a23941ab8cf0d7d1 (diff)
downloadpostgresql-940bafa75a0417128279095673a22d6d9b9e8413.tar.gz
postgresql-940bafa75a0417128279095673a22d6d9b9e8413.zip
Add support for Motorola 88K to s_lock.h.
Apparently there are still people out there who care about this old architecture. They probably care about dusty versions of Postgres too, so back-patch to all supported branches. David Carlier (from a patch being carried by OpenBSD packagers) Discussion: https://postgr.es/m/CA+XhMqzwFSGVU7MEnfhCecc8YdP98tigXzzpd0AAdwaGwaVXEA@mail.gmail.com
Diffstat (limited to 'src')
-rw-r--r--src/include/storage/s_lock.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/include/storage/s_lock.h b/src/include/storage/s_lock.h
index 64ca372c453..4663f028e62 100644
--- a/src/include/storage/s_lock.h
+++ b/src/include/storage/s_lock.h
@@ -543,6 +543,30 @@ tas(volatile slock_t *lock)
#endif /* (__mc68000__ || __m68k__) && __linux__ */
+/* Motorola 88k */
+#if defined(__m88k__)
+#define HAS_TEST_AND_SET
+
+typedef unsigned int slock_t;
+
+#define TAS(lock) tas(lock)
+
+static __inline__ int
+tas(volatile slock_t *lock)
+{
+ register slock_t _res = 1;
+
+ __asm__ __volatile__(
+ " xmem %0, %2, %%r0 \n"
+: "+r"(_res), "+m"(*lock)
+: "r"(lock)
+: "memory");
+ return (int) _res;
+}
+
+#endif /* __m88k__ */
+
+
/*
* VAXen -- even multiprocessor ones
* (thanks to Tom Ivar Helbekkmo)