*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/storage/buffer/Attic/s_lock.c,v 1.11 1998/09/18 05:36:23 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/storage/buffer/Attic/s_lock.c,v 1.12 1998/09/18 17:18:39 momjian Exp $
*
*-------------------------------------------------------------------------
*/
#endif /* PPC */
-#if defined(__ns32k__)
-int
-tas(volatile slock_t *lock)
-{
- int res;
- __asm__("sbitb 0, %0" : "=m"(*lock));
- __asm__("sprb us, %0" : "=r"(res));
- res = (res >> 5) & 1;
- return res;
-}
-#endif
#else /* defined(__GNUC__) */
/***************************************************************************
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/include/storage/s_lock.h,v 1.48 1998/09/18 05:36:24 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/include/storage/s_lock.h,v 1.49 1998/09/18 17:18:41 momjian Exp $
*
*-------------------------------------------------------------------------
*/
#endif /* NEED_I386_TAS_ASM */
-/* NS32K code is in s_lock.c */
+
+#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__) */