diff options
Diffstat (limited to 'src/backend/storage')
-rw-r--r-- | src/backend/storage/buffer/s_lock.c | 31 | ||||
-rw-r--r-- | src/backend/storage/ipc/ipc.c | 13 | ||||
-rw-r--r-- | src/backend/storage/ipc/spin.c | 4 | ||||
-rw-r--r-- | src/backend/storage/lmgr/proc.c | 9 |
4 files changed, 48 insertions, 9 deletions
diff --git a/src/backend/storage/buffer/s_lock.c b/src/backend/storage/buffer/s_lock.c index 72b167977d5..7f658ad26a8 100644 --- a/src/backend/storage/buffer/s_lock.c +++ b/src/backend/storage/buffer/s_lock.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/storage/buffer/Attic/s_lock.c,v 1.26 2000/11/28 23:27:55 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/storage/buffer/Attic/s_lock.c,v 1.27 2000/12/11 00:49:51 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -119,6 +119,35 @@ _success: \n\ #endif /* __m68k__ */ +#if defined(__APPLE__) && defined(__ppc__) +/* used in darwin. */ +/* We key off __APPLE__ here because this function differs from + * the LinuxPPC implementation only in compiler syntax. + */ +static void +tas_dummy() +{ + __asm__(" \n\ + .globl tas \n\ + .globl _tas \n\ +_tas: \n\ +tas: \n\ + lwarx r5,0,r3 \n\ + cmpwi r5,0 \n\ + bne fail \n\ + addi r5,r5,1 \n\ + stwcx. r5,0,r3 \n\ + beq success \n\ +fail: li r3,1 \n\ + blr \n\ +success: \n\ + li r3,0 \n\ + blr \n\ + "); +} + +#endif /* __APPLE__ && __ppc__ */ + #if defined(__powerpc__) /* Note: need a nice gcc constrained asm version so it can be inlined */ static void diff --git a/src/backend/storage/ipc/ipc.c b/src/backend/storage/ipc/ipc.c index 804411bb960..ee1bd7aeab1 100644 --- a/src/backend/storage/ipc/ipc.c +++ b/src/backend/storage/ipc/ipc.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/storage/ipc/ipc.c,v 1.56 2000/12/03 17:18:10 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/storage/ipc/ipc.c,v 1.57 2000/12/11 00:49:52 tgl Exp $ * * NOTES * @@ -45,14 +45,19 @@ #ifdef HAVE_KERNEL_OS_H #include <kernel/OS.h> #endif -#include "miscadmin.h" -#include "utils/memutils.h" -#include "libpq/libpq.h" #if defined(solaris_sparc) #include <sys/ipc.h> #endif +#if defined(__darwin__) +#include "port/darwin/sem.h" +#endif + +#include "miscadmin.h" +#include "utils/memutils.h" +#include "libpq/libpq.h" + /* * This flag is set during proc_exit() to change elog()'s behavior, diff --git a/src/backend/storage/ipc/spin.c b/src/backend/storage/ipc/spin.c index a93ae69e032..554eeba797e 100644 --- a/src/backend/storage/ipc/spin.c +++ b/src/backend/storage/ipc/spin.c @@ -14,14 +14,14 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/storage/ipc/Attic/spin.c,v 1.26 2000/11/28 23:27:56 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/storage/ipc/Attic/spin.c,v 1.27 2000/12/11 00:49:52 tgl Exp $ * *------------------------------------------------------------------------- */ #include "postgres.h" #include <errno.h> -#ifndef HAS_TEST_AND_SET +#if !defined(HAS_TEST_AND_SET) && defined(HAVE_SYS_SEM_H) #include <sys/sem.h> #endif diff --git a/src/backend/storage/lmgr/proc.c b/src/backend/storage/lmgr/proc.c index 0193a7ad2e7..550a43bb54a 100644 --- a/src/backend/storage/lmgr/proc.c +++ b/src/backend/storage/lmgr/proc.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/storage/lmgr/proc.c,v 1.84 2000/11/28 23:27:56 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/storage/lmgr/proc.c,v 1.85 2000/12/11 00:49:52 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -47,7 +47,7 @@ * This is so that we can support more backends. (system-wide semaphore * sets run out pretty fast.) -ay 4/95 * - * $Header: /cvsroot/pgsql/src/backend/storage/lmgr/proc.c,v 1.84 2000/11/28 23:27:56 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/storage/lmgr/proc.c,v 1.85 2000/12/11 00:49:52 tgl Exp $ */ #include "postgres.h" @@ -61,6 +61,10 @@ #include <sys/sem.h> #endif +#if defined(__darwin__) +#include "port/darwin/sem.h" +#endif + #include "miscadmin.h" @@ -71,6 +75,7 @@ #include "storage/proc.h" + void HandleDeadLock(SIGNAL_ARGS); static void ProcFreeAllSemaphores(void); static bool GetOffWaitqueue(PROC *); |