Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit8d25436

Browse files
committed
mkLinux patches from Tatsuo Ishii.
1 parent7c5afb8 commit8d25436

File tree

7 files changed

+97
-10
lines changed

7 files changed

+97
-10
lines changed

‎src/backend/storage/ipc/s_lock.c

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/storage/ipc/Attic/s_lock.c,v 1.14 1997/06/06 01:37:14 scrappy Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/storage/ipc/Attic/s_lock.c,v 1.15 1997/07/29 14:07:48 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -521,5 +521,45 @@ S_INIT_LOCK(slock_t *lock)
521521

522522
#endif/* NEED_NS32K_TAS_ASM */
523523

524+
#if defined(linux)&& defined(PPC)
525+
526+
staticinttas_dummy()
527+
{
528+
__asm__("
529+
tas:/* r3 points to the location of p */
530+
lwarx5,0,3/* r5 = *p */
531+
cmpwi5,0/* r5 == 0 ? */
532+
bnefail/* if not 0, jump to fail */
533+
addi5,5,1/* set 1 to r5 */
534+
stwcx.5,0,3/* try update p atomically */
535+
beqsuccess/* jump if scceed */
536+
fail:li3,1/* set 1 to r3 */
537+
blr
538+
success:
539+
li3,0/* set 0 to r3 */
540+
blr
541+
");
542+
}
543+
544+
void
545+
S_LOCK(slock_t*lock)
546+
{
547+
while (tas(lock))
548+
;
549+
}
550+
551+
void
552+
S_UNLOCK(slock_t*lock)
553+
{
554+
*lock=0;
555+
}
556+
557+
void
558+
S_INIT_LOCK(slock_t*lock)
559+
{
560+
S_UNLOCK(lock);
561+
}
562+
563+
#endif/* defined(linux) && defined(PPC) */
524564

525565
#endif/* HAS_TEST_AND_SET */

‎src/backend/utils/adt/dt.c

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/utils/adt/Attic/dt.c,v 1.29 1997/07/24 20:15:53 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/utils/adt/Attic/dt.c,v 1.30 1997/07/29 14:07:54 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -3758,3 +3758,30 @@ printf( "EncodeTimeSpan- result is %s\n", str);
37583758

37593759
return0;
37603760
}/* EncodeTimeSpan() */
3761+
3762+
3763+
#if defined(linux)&& defined(PPC)
3764+
intdatetime_is_epoch(doublej)
3765+
{
3766+
staticunion {
3767+
doubleepoch;
3768+
unsignedcharc[8];
3769+
}u;
3770+
3771+
u.c[0]=0x80;/* sign bit */
3772+
u.c[1]=0x10;/* DBL_MIN */
3773+
3774+
return(j==u.epoch);
3775+
}
3776+
intdatetime_is_current(doublej)
3777+
{
3778+
staticunion {
3779+
doublecurrent;
3780+
unsignedcharc[8];
3781+
}u;
3782+
3783+
u.c[1]=0x10;/* DBL_MIN */
3784+
3785+
return(j==u.current);
3786+
}
3787+
#endif

‎src/include/port/linux.h

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,20 @@
77
# defineJMP_BUF
88
# defineUSE_POSIX_TIME
99
# defineUSE_POSIX_SIGNALS
10-
# if !defined(PPC)
11-
# defineNEED_I386_TAS_ASM
12-
# defineHAS_TEST_AND_SET
10+
# defineNEED_I386_TAS_ASM
11+
# defineHAS_TEST_AND_SET
12+
13+
# if defined(PPC)
14+
typedefunsignedintslock_t;
15+
# else
1316
typedefunsignedcharslock_t;
1417
# endif
18+
19+
# if defined(PPC)
20+
# undef NEED_I386_TAS_ASM
21+
# undef HAVE_INT_TIMEZONE
22+
# endif
23+
1524
# if defined(sparc)
1625
# undef NEED_I386_TAS_ASM
1726
# endif

‎src/include/utils/dt.h

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
* Copyright (c) 1994, Regents of the University of California
1010
*
11-
* $Id: dt.h,v 1.13 1997/07/01 00:25:30 thomas Exp $
11+
* $Id: dt.h,v 1.14 1997/07/29 14:08:21 momjian Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -215,10 +215,20 @@ typedef struct {
215215
#defineDATETIME_IS_NOEND(j)(j == DT_NOEND)
216216

217217
#defineDATETIME_CURRENT(j){j = DT_CURRENT;}
218+
#if defined(linux)&& defined(PPC)
219+
externintdatetime_is_current(doublej);
220+
#defineDATETIME_IS_CURRENT(j)datetime_is_current(j)
221+
#else
218222
#defineDATETIME_IS_CURRENT(j)(j == DT_CURRENT)
223+
#endif
219224

220225
#defineDATETIME_EPOCH(j){j = DT_EPOCH;}
226+
#if defined(linux)&& defined(PPC)
227+
externintdatetime_is_epoch(doublej);
228+
#defineDATETIME_IS_EPOCH(j)datetime_is_epoch(j)
229+
#else
221230
#defineDATETIME_IS_EPOCH(j)(j == DT_EPOCH)
231+
#endif
222232

223233
#defineDATETIME_IS_RELATIVE(j)(DATETIME_IS_CURRENT(j) || DATETIME_IS_EPOCH(j))
224234
#defineDATETIME_NOT_FINITE(j)(DATETIME_IS_INVALID(j) \

‎src/interfaces/libpq/Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#
88
#
99
# IDENTIFICATION
10-
# $Header: /cvsroot/pgsql/src/interfaces/libpq/Makefile,v 1.35 1997/04/04 10:42:34scrappy Exp $
10+
# $Header: /cvsroot/pgsql/src/interfaces/libpq/Makefile,v 1.36 1997/07/29 14:08:34momjian Exp $
1111
#
1212
#-------------------------------------------------------------------------
1313

@@ -34,6 +34,7 @@ ifeq ($(PORTNAME), linux)
3434
install-shlib-dep := install-shlib
3535
shlib := libpq.so.1
3636
LDFLAGS_SL = -shared
37+
CFLAGS +=$(CFLAGS_SL)
3738
endif
3839
endif
3940
ifeq ($(PORTNAME), BSD44_derived)

‎src/makefiles/Makefile.linux

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
ifdef LINUX_ELF
2-
LDFLAGS+= -rdynamic -Wl,-rpath -Wl,$(DESTDIR)$(LIBDIR)
2+
LDFLAGS+= -export-dynamic -Wl,-rpath -Wl,$(DESTDIR)$(LIBDIR)
33
endif
44
MK_NO_LORDER= true
55

‎src/test/regress/GNUmakefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@
77
#
88
#
99
# IDENTIFICATION
10-
# $Header: /cvsroot/pgsql/src/test/regress/GNUmakefile,v 1.8 1997/06/06 01:35:57 scrappy Exp $
10+
# $Header: /cvsroot/pgsql/src/test/regress/GNUmakefile,v 1.9 1997/07/29 14:09:11 momjian Exp $
1111
#
1212
#-------------------------------------------------------------------------
1313

1414
SRCDIR= ../..
1515
include ../../Makefile.global
1616

17-
CFLAGS+= -I$(LIBPQDIR) -I../../include
17+
CFLAGS+= -I$(LIBPQDIR) -I../../include$(CFLAGS_SL)
1818

1919
LDADD+= -L$(LIBPQDIR) -lpq
2020

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp