Page MenuHomeFreeBSD

D36015.id108812.diff
No OneTemporary

D36015.id108812.diff

Index: sys/compat/linuxkpi/common/include/asm/atomic.h
===================================================================
--- sys/compat/linuxkpi/common/include/asm/atomic.h
+++ sys/compat/linuxkpi/common/include/asm/atomic.h
@@ -268,6 +268,28 @@
__ret.val; \
})
+#define try_cmpxchg(p, op, n) \
+({ \
+ __typeof(p) __op = (__typeof((p)))(op); \
+ __typeof(*(p)) __o = *__op; \
+ __typeof(*(p)) __p = __sync_val_compare_and_swap((p), (__o), (n)); \
+ if (__p != __o) \
+ *__op = __p; \
+ (__p == __o); \
+})
+
+#define __atomic_try_cmpxchg(type, _p, _po, _n) \
+({ \
+ typeof(_po) __po = (_po); \
+ typeof(*(_po)) __r, __o = *__po; \
+ __r = atomic_cmpxchg##type((_p), __o, (_n)); \
+ if (unlikely(__r != __o)) \
+ *__po = __r; \
+ likely(__r == __o); \
+})
+
+#define atomic_try_cmpxchg(_p, _po, _n) __atomic_try_cmpxchg(, _p, _po, _n)
+
static inline int
atomic_dec_if_positive(atomic_t *v)
{

File Metadata

Mime Type
text/plain
Expires
Sun, Jan 25, 5:37 PM (13 h, 50 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
27955057
Default Alt Text
D36015.id108812.diff (974 B)

Event Timeline