From b6666a005fd768b3ce427da52a02662ebebddefb Mon Sep 17 00:00:00 2001 From: pvalchev Date: Thu, 27 May 2004 21:05:25 +0000 Subject: [PATCH] =?UTF-8?q?remove=20powerpc=20workaround=20and=20add=20pat?= =?UTF-8?q?ch=20for=20the=20mutex=20issue=20provided=20by=20sleepycat=20vi?= =?UTF-8?q?a=20Philippe=20Lel=C3=A9dy=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- databases/db/v4/Makefile | 6 +-- databases/db/v4/patches/patch-dbinc_mutex_h | 42 +++++++++++++++++++++ 2 files changed, 43 insertions(+), 5 deletions(-) create mode 100644 databases/db/v4/patches/patch-dbinc_mutex_h diff --git a/databases/db/v4/Makefile b/databases/db/v4/Makefile index 88b769dddc7..4b21f6deb5b 100644 --- a/databases/db/v4/Makefile +++ b/databases/db/v4/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.8 2004/03/07 18:55:21 wilfried Exp $ +# $OpenBSD: Makefile,v 1.9 2004/05/27 21:05:25 pvalchev Exp $ REVISION= 4 VERSION= ${REVISION}.2.52 @@ -12,8 +12,4 @@ CONFIGURE_STYLE=gnu DEST_SUBDIR= ${REVISION} -.if ${MACHINE_ARCH} == "powerpc" -CONFIGURE_ARGS+=--enable-posixmutexes -.endif - .include diff --git a/databases/db/v4/patches/patch-dbinc_mutex_h b/databases/db/v4/patches/patch-dbinc_mutex_h new file mode 100644 index 00000000000..8724c302ad6 --- /dev/null +++ b/databases/db/v4/patches/patch-dbinc_mutex_h @@ -0,0 +1,42 @@ +$OpenBSD: patch-dbinc_mutex_h,v 1.1 2004/05/27 21:05:25 pvalchev Exp $ +--- dbinc/mutex.h.orig 2003-09-20 15:40:49.000000000 -0600 ++++ dbinc/mutex.h 2004-05-27 14:51:44.000000000 -0600 +@@ -578,28 +578,28 @@ typedef u_int32_t tsl_t; + * 'set' mutexes have the value 1, like on Intel; the returned value from + * MUTEX_SET() is 1 if the mutex previously had its low bit clear, 0 otherwise. + */ +-#ifdef HAVE_MUTEX_PPC_GCC_ASSEMBLY + static inline int + MUTEX_SET(int *tsl) { +- int __r; +- asm volatile ( ++ int __r; ++ int __tmp = (int)tsl; ++ asm volatile ( + "0: \n\t" +-" lwarx %0,0,%1 \n\t" ++" lwarx %0,0,%2 \n\t" + " cmpwi %0,0 \n\t" + " bne- 1f \n\t" +-" stwcx. %1,0,%1 \n\t" ++" stwcx. %2,0,%2 \n\t" + " isync \n\t" + " beq+ 2f \n\t" + " b 0b \n\t" + "1: \n\t" + " li %1, 0 \n\t" + "2: \n\t" +- : "=&r" (__r), "+r" (tsl) +- : +- : "cr0", "memory"); +- return (int)tsl; ++ : "=&r" (__r), "=r" (tsl) ++ : "r" (__tmp) ++ : "cr0", "memory"); ++ return (int)tsl; + } +-#endif ++ + static inline int + MUTEX_UNSET(tsl_t *tsl) { + asm volatile("sync" : : : "memory");