mirror of
https://github.com/postgres/postgres.git
synced 2025-11-10 17:42:29 +03:00
Darwin porting patches from Peter Bierman <bierman@apple.com>
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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 *);
|
||||
|
||||
Reference in New Issue
Block a user