mirror of
https://github.com/postgres/postgres.git
synced 2025-06-23 14:01:44 +03:00
Fix for NS32K machine.
This commit is contained in:
@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/storage/buffer/Attic/s_lock.c,v 1.10 1998/09/03 02:14:39 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/storage/buffer/Attic/s_lock.c,v 1.11 1998/09/18 05:36:23 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -118,6 +118,17 @@ success: \n\
|
|||||||
#endif /* PPC */
|
#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__) */
|
#else /* defined(__GNUC__) */
|
||||||
/***************************************************************************
|
/***************************************************************************
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/include/storage/s_lock.h,v 1.47 1998/09/12 16:07:53 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/include/storage/s_lock.h,v 1.48 1998/09/18 05:36:24 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -213,22 +213,7 @@ tas(slock_t *s_lock)
|
|||||||
#endif /* NEED_I386_TAS_ASM */
|
#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__) */
|
#endif /* defined(__GNUC__) */
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user