Skip to content

Commit

Permalink
linux/atomic.h: Do not redefine macroses to make migration to base ea…
Browse files Browse the repository at this point in the history
…sier

(cherry picked from commit 7da762b)
  • Loading branch information
wulf7 committed Dec 24, 2021
1 parent 6f99be4 commit ed5aa3d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions linuxkpi/bsd/include/linux/atomic.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

#include_next <linux/atomic.h>

#ifndef try_cmpxchg
#define try_cmpxchg(p, op, n) \
({ \
__typeof(p) __op = (__typeof((p)))(op); \
Expand All @@ -12,7 +13,9 @@
*__op = __p; \
(__p == __o); \
})
#endif

#ifndef atomic_try_cmpxchg
#define __atomic_try_cmpxchg(type, _p, _po, _n) \
({ \
typeof(_po) __po = (_po); \
Expand All @@ -24,6 +27,7 @@
})

#define atomic_try_cmpxchg(_p, _po, _n) __atomic_try_cmpxchg(, _p, _po, _n)
#endif

#ifndef mb
#define mb() __asm __volatile("mfence;" : : : "memory")
Expand All @@ -45,7 +49,9 @@
#define smp_rmb() rmb()
#endif

#ifndef smp_store_mb
#define __smp_store_mb(var, value) do { (void)xchg(&(var), value); } while (0)
#define smp_store_mb __smp_store_mb
#endif

#endif /* _BSD_LKPI_LINUX_ATOMIC_H_ */

0 comments on commit ed5aa3d

Please sign in to comment.