From: Sean Hefty Date: Wed, 25 Aug 2010 23:49:51 +0000 (-0700) Subject: refresh X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=c85fee3d0f9961b61415ee9a4f7b75754c9e571d;p=~shefty%2Fibacm.git refresh --- diff --git a/meta b/meta index ffec739..3c1fc83 100644 --- a/meta +++ b/meta @@ -1,8 +1,7 @@ Version: 1 -Previous: c7ff2c5ccd80c7ad711bcb4f0742963b63fefde5 -Head: 96a23da3a4b575a108d653346bc033c8bb4d4270 +Previous: 7a76d01d0d42220a11c9bd2e6e214fc738c7c2f4 +Head: 1e95862665a23084eb89522ce5b47ccabf008329 Applied: - atomic: 7b8e47f55413b6756b2fa378c16f5e21b98f4690 - refresh-temp: 96a23da3a4b575a108d653346bc033c8bb4d4270 + atomic: 1e95862665a23084eb89522ce5b47ccabf008329 Unapplied: Hidden: diff --git a/patches/atomic b/patches/atomic index 6a46e0b..e774f40 100644 --- a/patches/atomic +++ b/patches/atomic @@ -1,5 +1,5 @@ Bottom: 44cd90e52fd7bd946e34e9acdfcf1cef88293c9a -Top: 59952986bf11b417c6da864108e5278e0fbca08a +Top: b4ed043a0fc86707acda56000b3096e59867bfbe Author: Sean Hefty Date: 2010-08-25 10:26:22 -0700 @@ -17,49 +17,31 @@ Signed-off-by: Sean Hefty --- -diff --git a/Makefile.am b/Makefile.am -index f443091..4bd4bd5 100644 ---- a/Makefile.am -+++ b/Makefile.am -@@ -2,6 +2,10 @@ INCLUDES = -I$(srcdir)/include -I$(srcdir)/linux - - AM_CFLAGS = -g -Wall -D_GNU_SOURCE - -+if DEFINE_ATOMICS -+ AM_CFLAGS += -DDEFINE_ATOMICS -+endif -+ - bin_PROGRAMS = util/ib_acme - sbin_PROGRAMS = svc/ib_acm - svc_ib_acm_SOURCES = src/acm.c diff --git a/configure.in b/configure.in old mode 100644 new mode 100755 -index 997c775..ce55f75 +index 997c775..dfddeac --- a/configure.in +++ b/configure.in -@@ -39,6 +39,19 @@ AC_CHECK_HEADER(infiniband/umad.h, [], +@@ -39,6 +39,16 @@ AC_CHECK_HEADER(infiniband/umad.h, [], AC_MSG_ERROR([ not found. Is libibumad installed?])) fi +dnl Check for gcc atomic intrinsics +AC_MSG_CHECKING(compiler support for atomics) -+AC_TRY_LINK([], -+ [ -+ int i = 0; -+ return __sync_add_and_fetch(&i, 1) == __sync_sub_and_fetch(&i, 1) + 1; -+ ], -+ AC_MSG_RESULT(yes), ++AC_TRY_LINK([int i = 0;], ++ [ return __sync_add_and_fetch(&i, 1) != __sync_sub_and_fetch(&i, 1); ], ++ [ AC_MSG_RESULT(yes) ], + [ -+ AC_MSG_RESULT(no - defining atomics) -+ AC_DEFINE(DEFINE_ATOMICS, [], [Set to 1 to implement atomics]) ++ AC_MSG_RESULT(no) ++ AC_DEFINE(DEFINE_ATOMICS, 1, [Set to 1 to implement atomics]) + ]) + AC_CACHE_CHECK(whether ld accepts --version-script, ac_cv_version_script, if test -n "`$LD --help < /dev/null 2>/dev/null | grep version-script`"; then ac_cv_version_script=yes diff --git a/linux/osd.h b/linux/osd.h -index 722e1b1..9a167a7 100644 +index 722e1b1..9dacab9 100644 --- a/linux/osd.h +++ b/linux/osd.h @@ -65,9 +65,27 @@ @@ -69,17 +51,17 @@ index 722e1b1..9a167a7 100644 +#if DEFINE_ATOMICS +typedef struct { pthread_mutex_t mut; int val; } atomic_t; +#define atomic_inc(v) { \ -+ int v; ++ int x; + pthread_mutex_lock(&(v)->mut); \ -+ v = ++val; \ ++ x = ++val; \ + pthread_mutex_unlock(&(v)->mut); \ -+ return v; } ++ return x; } +#define atomic_dec(v) { \ -+ int v; ++ int x; + pthread_mutex_lock(&(v)->mut); \ -+ v = --val; \ ++ x = --val; \ + pthread_mutex_unlock(&(v)->mut); \ -+ return v; } ++ return x; } +#define atomic_init(v) { pthread_mutex_init(&(v)->mut, NULL); (v)->val = 0); } +#else typedef struct { volatile int val; } atomic_t; diff --git a/patches/refresh-temp b/patches/refresh-temp deleted file mode 100644 index be5fd6a..0000000 --- a/patches/refresh-temp +++ /dev/null @@ -1,77 +0,0 @@ -Bottom: 59952986bf11b417c6da864108e5278e0fbca08a -Top: b4ed043a0fc86707acda56000b3096e59867bfbe -Author: Sean Hefty -Date: 2010-08-25 16:49:51 -0700 - -Refresh of atomic - ---- - -diff --git a/Makefile.am b/Makefile.am -index 4bd4bd5..f443091 100644 ---- a/Makefile.am -+++ b/Makefile.am -@@ -2,10 +2,6 @@ INCLUDES = -I$(srcdir)/include -I$(srcdir)/linux - - AM_CFLAGS = -g -Wall -D_GNU_SOURCE - --if DEFINE_ATOMICS -- AM_CFLAGS += -DDEFINE_ATOMICS --endif -- - bin_PROGRAMS = util/ib_acme - sbin_PROGRAMS = svc/ib_acm - svc_ib_acm_SOURCES = src/acm.c -diff --git a/configure.in b/configure.in -index ce55f75..dfddeac 100755 ---- a/configure.in -+++ b/configure.in -@@ -41,15 +41,12 @@ fi - - dnl Check for gcc atomic intrinsics - AC_MSG_CHECKING(compiler support for atomics) --AC_TRY_LINK([], -+AC_TRY_LINK([int i = 0;], -+ [ return __sync_add_and_fetch(&i, 1) != __sync_sub_and_fetch(&i, 1); ], -+ [ AC_MSG_RESULT(yes) ], - [ -- int i = 0; -- return __sync_add_and_fetch(&i, 1) == __sync_sub_and_fetch(&i, 1) + 1; -- ], -- AC_MSG_RESULT(yes), -- [ -- AC_MSG_RESULT(no - defining atomics) -- AC_DEFINE(DEFINE_ATOMICS, [], [Set to 1 to implement atomics]) -+ AC_MSG_RESULT(no) -+ AC_DEFINE(DEFINE_ATOMICS, 1, [Set to 1 to implement atomics]) - ]) - - AC_CACHE_CHECK(whether ld accepts --version-script, ac_cv_version_script, -diff --git a/linux/osd.h b/linux/osd.h -index 9a167a7..9dacab9 100644 ---- a/linux/osd.h -+++ b/linux/osd.h -@@ -68,17 +68,17 @@ - #if DEFINE_ATOMICS - typedef struct { pthread_mutex_t mut; int val; } atomic_t; - #define atomic_inc(v) { \ -- int v; -+ int x; - pthread_mutex_lock(&(v)->mut); \ -- v = ++val; \ -+ x = ++val; \ - pthread_mutex_unlock(&(v)->mut); \ -- return v; } -+ return x; } - #define atomic_dec(v) { \ -- int v; -+ int x; - pthread_mutex_lock(&(v)->mut); \ -- v = --val; \ -+ x = --val; \ - pthread_mutex_unlock(&(v)->mut); \ -- return v; } -+ return x; } - #define atomic_init(v) { pthread_mutex_init(&(v)->mut, NULL); (v)->val = 0); } - #else - typedef struct { volatile int val; } atomic_t;