]> git.openfabrics.org - ~shefty/ibacm.git/commitdiff
refresh (create temporary patch)
authorSean Hefty <sean.hefty@intel.com>
Thu, 26 Aug 2010 00:01:58 +0000 (17:01 -0700)
committerSean Hefty <sean.hefty@intel.com>
Thu, 26 Aug 2010 00:01:58 +0000 (17:01 -0700)
meta
patches/refresh-temp [new file with mode: 0644]

diff --git a/meta b/meta
index 3c1fc836bd48709854b4b79e2f389b0b0b0ad6a6..753526a71e9e4a1a0fa2ec5934f4cfc032aada1e 100644 (file)
--- a/meta
+++ b/meta
@@ -1,7 +1,8 @@
 Version: 1
-Previous: 7a76d01d0d42220a11c9bd2e6e214fc738c7c2f4
-Head: 1e95862665a23084eb89522ce5b47ccabf008329
+Previous: be0734ca347edc568e9854fe5d5ebd8c5e79424c
+Head: d38a322fbaa608020244730906e11d55bfdb9212
 Applied:
   atomic: 1e95862665a23084eb89522ce5b47ccabf008329
+  refresh-temp: d38a322fbaa608020244730906e11d55bfdb9212
 Unapplied:
 Hidden:
diff --git a/patches/refresh-temp b/patches/refresh-temp
new file mode 100644 (file)
index 0000000..680f3c8
--- /dev/null
@@ -0,0 +1,56 @@
+Bottom: b4ed043a0fc86707acda56000b3096e59867bfbe
+Top:    58672dbab4886462dc5ca2664ef7b5725ca5a6d8
+Author: Sean Hefty <sean.hefty@intel.com>
+Date:   2010-08-25 17:01:58 -0700
+
+Refresh of atomic
+
+---
+
+diff --git a/linux/osd.h b/linux/osd.h
+index 9dacab9..28c3647 100644
+--- a/linux/osd.h
++++ b/linux/osd.h
+@@ -67,19 +67,29 @@
\r
+ #if DEFINE_ATOMICS\r
+ typedef struct { pthread_mutex_t mut; int val; } atomic_t;\r
+-#define atomic_inc(v) { \\r
+-      int x;\r
+-      pthread_mutex_lock(&(v)->mut); \\r
+-      x = ++val; \\r
+-      pthread_mutex_unlock(&(v)->mut); \\r
+-      return x; }\r
+-#define atomic_dec(v) { \\r
+-      int x;\r
+-      pthread_mutex_lock(&(v)->mut); \\r
+-      x = --val; \\r
+-      pthread_mutex_unlock(&(v)->mut); \\r
+-      return x; }\r
+-#define atomic_init(v) { pthread_mutex_init(&(v)->mut, NULL); (v)->val = 0); }\r
++static inline int atomic_inc(atomic_t *atomic)\r
++{\r
++      int v;\r
++\r
++      pthread_mutex_lock(&atomic->mut);\r
++      v = ++(atomic->val);\r
++      pthread_mutex_unlock(&atomic->mut);\r
++      return v;\r
++}\r
++static inline int atomic_dec(atomic_t *atomic)\r
++{\r
++      int v;\r
++\r
++      pthread_mutex_lock(&atomic->mut);\r
++      v = --(atomic->val);\r
++      pthread_mutex_unlock(&atomic->mut);\r
++      return v;\r
++}\r
++static inline void atomic_init(atomic_t *atomic)\r
++{\r
++      pthread_mutex_init(&atomic->mut, NULL);\r
++      atomic->val = 0;\r
++}\r
+ #else\r
+ typedef struct { volatile int val; } atomic_t;\r
+ #define atomic_inc(v) (__sync_add_and_fetch(&(v)->val, 1))