diff options
author | Marc G. Fournier <scrappy@hub.org> | 1997-04-24 02:35:39 +0000 |
---|---|---|
committer | Marc G. Fournier <scrappy@hub.org> | 1997-04-24 02:35:39 +0000 |
commit | 08a5901ba1068661eac4ccc06fc7ee71c3165341 (patch) | |
tree | 36a8c12a8a9f46d340bef21b63c38dc85bdf5b36 | |
parent | 7a7a9b1a042952ca22a228455492c68402a4c23f (diff) | |
download | postgresql-08a5901ba1068661eac4ccc06fc7ee71c3165341.tar.gz postgresql-08a5901ba1068661eac4ccc06fc7ee71c3165341.zip |
Various patches not commited, plus a linux/sparc patch from
Satoshi Ishikawa <power@sekine.densi.gifu-u.ac.jp>
-rw-r--r-- | src/backend/storage/ipc/s_lock.c | 35 | ||||
-rw-r--r-- | src/include/port/linux.h | 3 |
2 files changed, 37 insertions, 1 deletions
diff --git a/src/backend/storage/ipc/s_lock.c b/src/backend/storage/ipc/s_lock.c index 539a7f9af44..75dd8dcc83a 100644 --- a/src/backend/storage/ipc/s_lock.c +++ b/src/backend/storage/ipc/s_lock.c @@ -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 */ diff --git a/src/include/port/linux.h b/src/include/port/linux.h index fa311d984fe..7735f3ab0fd 100644 --- a/src/include/port/linux.h +++ b/src/include/port/linux.h @@ -12,3 +12,6 @@ # define HAS_TEST_AND_SET typedef unsigned char slock_t; # endif +# if defined(sparc) +# undef NEED_I386_TAS_ASM +# endif |