]> granicus.if.org Git - postgresql/commitdiff
Various patches not commited, plus a linux/sparc patch from
authorMarc G. Fournier <scrappy@hub.org>
Thu, 24 Apr 1997 02:35:39 +0000 (02:35 +0000)
committerMarc G. Fournier <scrappy@hub.org>
Thu, 24 Apr 1997 02:35:39 +0000 (02:35 +0000)
Satoshi Ishikawa <power@sekine.densi.gifu-u.ac.jp>

src/backend/storage/ipc/s_lock.c
src/include/port/linux.h

index 539a7f9af44a4c49f44881b9d58a0118ed93bc10..75dd8dcc83a6483554c86febd951e958ec819208 100644 (file)
@@ -7,7 +7,7 @@
  *
  *
  * IDENTIFICATION
- *    $Header: /cvsroot/pgsql/src/backend/storage/ipc/Attic/s_lock.c,v 1.12 1997/03/12 21:06:48 scrappy Exp $
+ *    $Header: /cvsroot/pgsql/src/backend/storage/ipc/Attic/s_lock.c,v 1.13 1997/04/24 02:35:35 scrappy Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -453,4 +453,37 @@ S_INIT_LOCK(slock_t *lock)
 
 #endif
 
+#if defined(linux) && defined(sparc)
+int 
+tas(slock_t *m)
+{
+  slock_t res;
+  __asm__("ldstub [%1], %0"
+         : "=&r" (res)
+         : "r" (m));
+  return (res != 0);
+}
+
+void
+S_LOCK(slock_t *lock)
+{
+    while (tas(lock))
+       ;
+}
+
+void
+S_UNLOCK(slock_t *lock)
+{
+    *lock = 0;
+}
+
+void
+S_INIT_LOCK(slock_t *lock)
+{
+    S_UNLOCK(lock);
+}
+
+#endif /* defined(linux) && defined(sparc) */
+
 #endif /* HAS_TEST_AND_SET */
index fa311d984fe6b9d076263515e44e1c8aaf94cb48..7735f3ab0fd15705db30446ee40b68a828c44015 100644 (file)
@@ -12,3 +12,6 @@
 #    define HAS_TEST_AND_SET
      typedef unsigned char slock_t;
 #  endif
+#  if defined(sparc)
+#    undef NEED_I386_TAS_ASM
+#  endif