提交 08a5901b 编写于 作者: M Marc G. Fournier

Various patches not commited, plus a linux/sparc patch from

Satoshi Ishikawa <power@sekine.densi.gifu-u.ac.jp>
上级 7a7a9b1a
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * 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) ...@@ -453,4 +453,37 @@ S_INIT_LOCK(slock_t *lock)
#endif #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 */ #endif /* HAS_TEST_AND_SET */
...@@ -12,3 +12,6 @@ ...@@ -12,3 +12,6 @@
# define HAS_TEST_AND_SET # define HAS_TEST_AND_SET
typedef unsigned char slock_t; typedef unsigned char slock_t;
# endif # endif
# if defined(sparc)
# undef NEED_I386_TAS_ASM
# endif
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册