pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/net/ser Add assembler bits for locking on amd64. Fixes...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/a914914116c1
branches:  trunk
changeset: 545967:a914914116c1
user:      dholland <dholland%pkgsrc.org@localhost>
date:      Sun Aug 17 22:40:26 2008 +0000

description:
Add assembler bits for locking on amd64. Fixes broken build, because one
of the modules doesn't compile against the portable locking code. Doesn't
affect other platforms, so no revision bump.

diffstat:

 net/ser/distinfo         |   5 +++--
 net/ser/patches/patch-aa |  21 ++++++++++++++++-----
 net/ser/patches/patch-ac |  30 ++++++++++++++++++++++++++++++
 3 files changed, 49 insertions(+), 7 deletions(-)

diffs (92 lines):

diff -r 22c7e53006ab -r a914914116c1 net/ser/distinfo
--- a/net/ser/distinfo  Sun Aug 17 21:46:06 2008 +0000
+++ b/net/ser/distinfo  Sun Aug 17 22:40:26 2008 +0000
@@ -1,8 +1,9 @@
-$NetBSD: distinfo,v 1.3 2007/06/01 00:26:36 wiz Exp $
+$NetBSD: distinfo,v 1.4 2008/08/17 22:40:26 dholland Exp $
 
 SHA1 (ser-0.8.14_src.tar.gz) = 91553951247506850d66da25819333b61b150d1d
 RMD160 (ser-0.8.14_src.tar.gz) = 72c3a0793f3dd88584ee65b3751ccf8a3776f840
 Size (ser-0.8.14_src.tar.gz) = 1551881 bytes
-SHA1 (patch-aa) = 25ee2488f106859ce1208923d5e5ae762dbe65f1
+SHA1 (patch-aa) = bbf309fef1a0b130d544127f123fedd374235135
 SHA1 (patch-ab) = 871de5c826853381eb5b6889d8e3d8b2f310dc6b
+SHA1 (patch-ac) = ece24eec7175c1396d76e2b85ff69a4b995e541e
 SHA1 (patch-ad) = aa7a962546fbfcbecde79d68c0765ae34c2916da
diff -r 22c7e53006ab -r a914914116c1 net/ser/patches/patch-aa
--- a/net/ser/patches/patch-aa  Sun Aug 17 21:46:06 2008 +0000
+++ b/net/ser/patches/patch-aa  Sun Aug 17 22:40:26 2008 +0000
@@ -1,7 +1,7 @@
-$NetBSD: patch-aa,v 1.2 2007/05/31 04:22:10 rillig Exp $
+$NetBSD: patch-aa,v 1.3 2008/08/17 22:40:26 dholland Exp $
 
---- Makefile.defs.orig 2004-07-27 13:38:33.000000000 +0200
-+++ Makefile.defs      2007-05-31 06:17:16.000000000 +0200
+--- Makefile.defs.orig 2004-07-27 07:38:33.000000000 -0400
++++ Makefile.defs      2008-08-17 18:34:04.000000000 -0400
 @@ -77,7 +77,7 @@ prefix = $(PREFIX)
  BASEDIR ?=
  basedir = $(BASEDIR)
@@ -66,7 +66,18 @@
  
  #set some vars from the environment (and not make builtins)
  CC   := $(shell echo "$${CC}")
-@@ -639,6 +650,7 @@ ifeq       ($(CC_NAME), suncc)
+@@ -384,6 +395,10 @@ ifeq ($(ARCH), i386)
+       use_fast_lock=yes
+ endif
+ 
++ifeq ($(ARCH), amd64)
++      use_fast_lock=yes
++endif
++
+ ifeq ($(ARCH), sparc64)
+ ifeq  ($(CC_NAME), gcc)
+       use_fast_lock=yes
+@@ -639,6 +654,7 @@ ifeq       ($(CC_NAME), suncc)
  endif
  
  endif #mode=release
@@ -74,7 +85,7 @@
  
  
  #*FLAGS used for compiling the modules
-@@ -743,6 +755,19 @@ ifeq ($(OS), netbsd)
+@@ -743,6 +759,19 @@ ifeq ($(OS), netbsd)
        LIBS= -lfl 
  endif
  
diff -r 22c7e53006ab -r a914914116c1 net/ser/patches/patch-ac
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/net/ser/patches/patch-ac  Sun Aug 17 22:40:26 2008 +0000
@@ -0,0 +1,30 @@
+$NetBSD: patch-ac,v 1.1 2008/08/17 22:40:26 dholland Exp $
+
+--- fastlock.h.orig    2008-08-17 18:36:52.000000000 -0400
++++ fastlock.h 2008-08-17 18:36:55.000000000 -0400
+@@ -77,6 +77,11 @@ inline static int tsl(fl_lock_t* lock)
+               " xchg %b1, %0" : "=q" (val), "=m" (*lock) : "0" (val) : "memory"
+       );
+ #endif /*NOSMP*/
++#elif defined __CPU_amd64
++      val=1;
++      asm volatile( 
++              " xchg %b1, %0" : "=q" (val), "=m" (*lock) : "0" (val) : "memory"
++      );
+ #elif defined __CPU_sparc64
+       asm volatile(
+                       "ldstub [%1], %0 \n\t"
+@@ -142,6 +147,13 @@ inline static void release_lock(fl_lock_
+               " movb $0, (%0)" : /*no output*/ : "r"(lock): "memory"
+               /*" xchg %b0, %1" : "=q" (val), "=m" (*lock) : "0" (val) : "memory"*/
+       ); 
++#elif defined __CPU_amd64
++      char val;
++      val=0;
++      asm volatile(
++              " movb $0, (%0)" : /*no output*/ : "r"(lock): "memory"
++              /*" xchg %b0, %1" : "=q" (val), "=m" (*lock) : "0" (val) : "memory"*/
++      ); 
+ #elif defined __CPU_sparc64
+       asm volatile(
+ #ifndef NOSMP



Home | Main Index | Thread Index | Old Index