From: Phil Nelson <phil@cs.wwu.edu>
Subject: [PATCHES] Added support for NetBSD/pc532.
This commit is contained in:
parent
355d6a2767
commit
15da18508f
@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/storage/ipc/Attic/s_lock.c,v 1.13 1997/04/24 02:35:35 scrappy Exp $
|
* $Header: /cvsroot/pgsql/src/backend/storage/ipc/Attic/s_lock.c,v 1.14 1997/06/06 01:37:14 scrappy Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -486,4 +486,40 @@ S_INIT_LOCK(slock_t *lock)
|
|||||||
|
|
||||||
#endif /* defined(linux) && defined(sparc) */
|
#endif /* defined(linux) && defined(sparc) */
|
||||||
|
|
||||||
|
#if defined(NEED_NS32K_TAS_ASM)
|
||||||
|
|
||||||
|
int
|
||||||
|
tas(slock_t *m)
|
||||||
|
{
|
||||||
|
slock_t res = 0;
|
||||||
|
__asm__("movd 8(fp), r1");
|
||||||
|
__asm__("movqd 0, r0");
|
||||||
|
__asm__("sbitd r0, 0(r1)");
|
||||||
|
__asm__("sprb us, %0" : "=r" (res));
|
||||||
|
res = (res >> 5) & 1;
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
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 /* NEED_NS32K_TAS_ASM */
|
||||||
|
|
||||||
|
|
||||||
#endif /* HAS_TEST_AND_SET */
|
#endif /* HAS_TEST_AND_SET */
|
||||||
|
@ -5,6 +5,9 @@
|
|||||||
# if defined(sparc)
|
# if defined(sparc)
|
||||||
# define NEED_SPARC_TAS_ASM
|
# define NEED_SPARC_TAS_ASM
|
||||||
# endif
|
# endif
|
||||||
|
# if defined(ns32k)
|
||||||
|
# define NEED_NS32k_TAS_ASM
|
||||||
|
# endif
|
||||||
# define HAS_TEST_AND_SET
|
# define HAS_TEST_AND_SET
|
||||||
# if defined(__mips__)
|
# if defined(__mips__)
|
||||||
/* # undef HAS_TEST_AND_SET */
|
/* # undef HAS_TEST_AND_SET */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user