mirror of
https://github.com/postgres/postgres.git
synced 2025-05-29 00:03:09 -04:00
mkLinux patches from Tatsuo Ishii.
This commit is contained in:
parent
7c5afb87c3
commit
8d25436d70
@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/storage/ipc/Attic/s_lock.c,v 1.14 1997/06/06 01:37:14 scrappy Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/storage/ipc/Attic/s_lock.c,v 1.15 1997/07/29 14:07:48 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -521,5 +521,45 @@ S_INIT_LOCK(slock_t *lock)
|
||||
|
||||
#endif /* NEED_NS32K_TAS_ASM */
|
||||
|
||||
#if defined(linux) && defined(PPC)
|
||||
|
||||
static int tas_dummy()
|
||||
{
|
||||
__asm__("
|
||||
tas: /* r3 points to the location of p */
|
||||
lwarx 5,0,3 /* r5 = *p */
|
||||
cmpwi 5,0 /* r5 == 0 ? */
|
||||
bne fail /* if not 0, jump to fail */
|
||||
addi 5,5,1 /* set 1 to r5 */
|
||||
stwcx. 5,0,3 /* try update p atomically */
|
||||
beq success /* jump if scceed */
|
||||
fail: li 3,1 /* set 1 to r3 */
|
||||
blr
|
||||
success:
|
||||
li 3,0 /* set 0 to r3 */
|
||||
blr
|
||||
");
|
||||
}
|
||||
|
||||
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(PPC) */
|
||||
|
||||
#endif /* HAS_TEST_AND_SET */
|
||||
|
@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/Attic/dt.c,v 1.29 1997/07/24 20:15:53 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/Attic/dt.c,v 1.30 1997/07/29 14:07:54 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -3758,3 +3758,30 @@ printf( "EncodeTimeSpan- result is %s\n", str);
|
||||
|
||||
return 0;
|
||||
} /* EncodeTimeSpan() */
|
||||
|
||||
|
||||
#if defined(linux) && defined(PPC)
|
||||
int datetime_is_epoch(double j)
|
||||
{
|
||||
static union {
|
||||
double epoch;
|
||||
unsigned char c[8];
|
||||
} u;
|
||||
|
||||
u.c[0] = 0x80; /* sign bit */
|
||||
u.c[1] = 0x10; /* DBL_MIN */
|
||||
|
||||
return(j == u.epoch);
|
||||
}
|
||||
int datetime_is_current(double j)
|
||||
{
|
||||
static union {
|
||||
double current;
|
||||
unsigned char c[8];
|
||||
} u;
|
||||
|
||||
u.c[1] = 0x10; /* DBL_MIN */
|
||||
|
||||
return(j == u.current);
|
||||
}
|
||||
#endif
|
||||
|
@ -7,11 +7,20 @@
|
||||
# define JMP_BUF
|
||||
# define USE_POSIX_TIME
|
||||
# define USE_POSIX_SIGNALS
|
||||
# if !defined(PPC)
|
||||
# define NEED_I386_TAS_ASM
|
||||
# define HAS_TEST_AND_SET
|
||||
# define NEED_I386_TAS_ASM
|
||||
# define HAS_TEST_AND_SET
|
||||
|
||||
# if defined(PPC)
|
||||
typedef unsigned int slock_t;
|
||||
# else
|
||||
typedef unsigned char slock_t;
|
||||
# endif
|
||||
|
||||
# if defined(PPC)
|
||||
# undef NEED_I386_TAS_ASM
|
||||
# undef HAVE_INT_TIMEZONE
|
||||
# endif
|
||||
|
||||
# if defined(sparc)
|
||||
# undef NEED_I386_TAS_ASM
|
||||
# endif
|
||||
|
@ -8,7 +8,7 @@
|
||||
*
|
||||
* Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* $Id: dt.h,v 1.13 1997/07/01 00:25:30 thomas Exp $
|
||||
* $Id: dt.h,v 1.14 1997/07/29 14:08:21 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -215,10 +215,20 @@ typedef struct {
|
||||
#define DATETIME_IS_NOEND(j) (j == DT_NOEND)
|
||||
|
||||
#define DATETIME_CURRENT(j) {j = DT_CURRENT;}
|
||||
#if defined(linux) && defined(PPC)
|
||||
extern int datetime_is_current(double j);
|
||||
#define DATETIME_IS_CURRENT(j) datetime_is_current(j)
|
||||
#else
|
||||
#define DATETIME_IS_CURRENT(j) (j == DT_CURRENT)
|
||||
#endif
|
||||
|
||||
#define DATETIME_EPOCH(j) {j = DT_EPOCH;}
|
||||
#if defined(linux) && defined(PPC)
|
||||
extern int datetime_is_epoch(double j);
|
||||
#define DATETIME_IS_EPOCH(j) datetime_is_epoch(j)
|
||||
#else
|
||||
#define DATETIME_IS_EPOCH(j) (j == DT_EPOCH)
|
||||
#endif
|
||||
|
||||
#define DATETIME_IS_RELATIVE(j) (DATETIME_IS_CURRENT(j) || DATETIME_IS_EPOCH(j))
|
||||
#define DATETIME_NOT_FINITE(j) (DATETIME_IS_INVALID(j) \
|
||||
|
@ -7,7 +7,7 @@
|
||||
#
|
||||
#
|
||||
# IDENTIFICATION
|
||||
# $Header: /cvsroot/pgsql/src/interfaces/libpq/Makefile,v 1.35 1997/04/04 10:42:34 scrappy Exp $
|
||||
# $Header: /cvsroot/pgsql/src/interfaces/libpq/Makefile,v 1.36 1997/07/29 14:08:34 momjian Exp $
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
|
||||
@ -34,6 +34,7 @@ ifeq ($(PORTNAME), linux)
|
||||
install-shlib-dep := install-shlib
|
||||
shlib := libpq.so.1
|
||||
LDFLAGS_SL = -shared
|
||||
CFLAGS += $(CFLAGS_SL)
|
||||
endif
|
||||
endif
|
||||
ifeq ($(PORTNAME), BSD44_derived)
|
||||
|
@ -1,5 +1,5 @@
|
||||
ifdef LINUX_ELF
|
||||
LDFLAGS+= -rdynamic -Wl,-rpath -Wl,$(DESTDIR)$(LIBDIR)
|
||||
LDFLAGS+= -export-dynamic -Wl,-rpath -Wl,$(DESTDIR)$(LIBDIR)
|
||||
endif
|
||||
MK_NO_LORDER= true
|
||||
|
||||
|
@ -7,14 +7,14 @@
|
||||
#
|
||||
#
|
||||
# IDENTIFICATION
|
||||
# $Header: /cvsroot/pgsql/src/test/regress/GNUmakefile,v 1.8 1997/06/06 01:35:57 scrappy Exp $
|
||||
# $Header: /cvsroot/pgsql/src/test/regress/GNUmakefile,v 1.9 1997/07/29 14:09:11 momjian Exp $
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
|
||||
SRCDIR= ../..
|
||||
include ../../Makefile.global
|
||||
|
||||
CFLAGS+= -I$(LIBPQDIR) -I../../include
|
||||
CFLAGS+= -I$(LIBPQDIR) -I../../include $(CFLAGS_SL)
|
||||
|
||||
LDADD+= -L$(LIBPQDIR) -lpq
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user