mirror of
https://github.com/postgres/postgres.git
synced 2025-04-24 10:47:04 +03:00
Fix for netbsd locking, from Henry B. Hotz.
This commit is contained in:
parent
e2617c856e
commit
58ed1232f5
@ -1,15 +1,25 @@
|
|||||||
#define USE_POSIX_TIME
|
#define USE_POSIX_TIME
|
||||||
|
|
||||||
#if defined(i386)
|
#if defined(i386)
|
||||||
#define NEED_I386_TAS_ASM
|
#define NEED_I386_TAS_ASM
|
||||||
|
#define HAS_TEST_AND_SET
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(sparc)
|
#if defined(sparc)
|
||||||
#define NEED_SPARC_TAS_ASM
|
#define NEED_SPARC_TAS_ASM
|
||||||
|
#define HAS_TEST_AND_SET
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(ns32k)
|
#if defined(ns32k)
|
||||||
#define NEED_NS32k_TAS_ASM
|
#define NEED_NS32k_TAS_ASM
|
||||||
#endif
|
|
||||||
#define HAS_TEST_AND_SET
|
#define HAS_TEST_AND_SET
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(__m68k__)
|
||||||
|
#define HAS_TEST_AND_SET
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined(__mips__)
|
#if defined(__mips__)
|
||||||
/* # undef HAS_TEST_AND_SET */
|
/* # undef HAS_TEST_AND_SET */
|
||||||
#endif
|
#endif
|
||||||
typedef unsigned char slock_t;
|
typedef unsigned char slock_t;
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/include/storage/s_lock.h,v 1.10 1997/10/03 15:27:18 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/include/storage/s_lock.h,v 1.11 1997/10/30 05:24:19 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -24,6 +24,10 @@
|
|||||||
* ;
|
* ;
|
||||||
* }
|
* }
|
||||||
*
|
*
|
||||||
|
* In addition to modifying this file you will need to modify
|
||||||
|
* the appropriate ...src/include/port/...h file to define
|
||||||
|
* HAS_TEST_AND_SET for the appropriate circumstances.
|
||||||
|
*
|
||||||
* If this is not done, POSTGRES will default to using System V
|
* If this is not done, POSTGRES will default to using System V
|
||||||
* semaphores (and take a large performance hit -- around 40% of
|
* semaphores (and take a large performance hit -- around 40% of
|
||||||
* its time on a DS5000/240 is spent in semop(3)...).
|
* its time on a DS5000/240 is spent in semop(3)...).
|
||||||
@ -228,6 +232,31 @@ tas_dummy()
|
|||||||
|
|
||||||
#endif /* sun3 */
|
#endif /* sun3 */
|
||||||
|
|
||||||
|
/*
|
||||||
|
* M68000 ports under NetBSD.
|
||||||
|
*
|
||||||
|
* This version should also work on a sun3, but I can't test it.
|
||||||
|
* Conversely the sun3 version should work under NetBSD/m68k, but
|
||||||
|
* it doesn't.
|
||||||
|
*/
|
||||||
|
#if defined(__NetBSD__) && defined(__m68k__)
|
||||||
|
|
||||||
|
static void S_LOCK(char *lock)
|
||||||
|
{
|
||||||
|
asm("
|
||||||
|
movel a6@(8),a0
|
||||||
|
LOOP:
|
||||||
|
tas a0@
|
||||||
|
bmi LOOP
|
||||||
|
");
|
||||||
|
}
|
||||||
|
|
||||||
|
#define S_UNLOCK(lock) (*(lock) = 0)
|
||||||
|
|
||||||
|
#define S_INIT_LOCK(lock) S_UNLOCK(lock)
|
||||||
|
|
||||||
|
#endif /* M68000 && NetBSD */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* sparc machines
|
* sparc machines
|
||||||
*/
|
*/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user