aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBruce Momjian <bruce@momjian.us>1998-07-19 01:19:54 +0000
committerBruce Momjian <bruce@momjian.us>1998-07-19 01:19:54 +0000
commit62cd6e7b7559ecd31531df0e5db89d336241e6a5 (patch)
tree89c2fc6fb379006870148fc0ea4da8de5e3ae3db /src
parent8ae23e1305e272c84aa0d180db2811936ad79856 (diff)
downloadpostgresql-62cd6e7b7559ecd31531df0e5db89d336241e6a5.tar.gz
postgresql-62cd6e7b7559ecd31531df0e5db89d336241e6a5.zip
Somewhere between 6.1 and 6.3 someone removed the support for the
NS32K machine I contributed. In any case, I now have postgresql-6.3 running again on NetBSD/pc532, a NS32532 machine. The following changes are needed relative to the src directory. (It looks like support was partially removed when the files were moved from the src/backend/storage/.... tree to the src/include tree.) If you need me to get a current development version of postgresql for this change let me know. Also, let me know if this code needs updating due to another code movement that deleted the old NS32K support. Thank you. Phil Nelson
Diffstat (limited to 'src')
-rw-r--r--src/include/port/bsd.h4
-rw-r--r--src/include/storage/s_lock.h22
2 files changed, 23 insertions, 3 deletions
diff --git a/src/include/port/bsd.h b/src/include/port/bsd.h
index 03c99acd873..4e754e77dec 100644
--- a/src/include/port/bsd.h
+++ b/src/include/port/bsd.h
@@ -15,8 +15,8 @@
#define HAS_TEST_AND_SET
#endif
-#if defined(ns32k)
-#define NEED_NS32k_TAS_ASM
+#if defined(__ns32k__)
+#define NEED_NS32K_TAS_ASM
#define HAS_TEST_AND_SET
#endif
diff --git a/src/include/storage/s_lock.h b/src/include/storage/s_lock.h
index 7cbf56385e6..70a0f4226c4 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.39 1998/07/18 14:58:58 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/include/storage/s_lock.h,v 1.40 1998/07/19 01:19:54 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -209,6 +209,22 @@ tas(slock_t *s_lock)
#endif /* NEED_I386_TAS_ASM */
+
+#if defined(NEED_NS32K_TAS_ASM)
+
+#define S_LOCK(lock) \
+{ \
+ slock_t res = 1; \
+ while (res) { \
+ __asm__("movqd 0, r0"); \
+ __asm__("sbitd r0, %0" : "=m"(*lock)); \
+ __asm__("sprb us, %0" : "=r" (res)); \
+ res = ((res >> 5) & 1); \
+ } \
+}
+#endif /* NEED_NS32K_TAS_ASM */
+
+
#endif /* defined(__GNUC__) */
@@ -308,6 +324,10 @@ int tas(volatile slock_t *lock); /* port/.../tas.s, or s_lock.c */
#define TAS(lock) tas((volatile slock_t *) lock)
#endif /* TAS */
+#define S_UNLOCK(lock) (*(lock) = 0)
+
+#define S_INIT_LOCK(lock) S_UNLOCK(lock)
+
#endif /* HAS_TEST_AND_SET */
#endif /* S_LOCK_H */