* should not be freed !).
*/
-#define _rcu_cmpxchg_pointer(p, old, _new) \
- ({ \
- if (!__builtin_constant_p(_new) || \
- ((_new) != NULL)) \
- wmb(); \
- uatomic_cmpxchg(p, old, _new); \
+#define _rcu_cmpxchg_pointer(p, old, _new) \
+ ({ \
+ typeof(*p) _________pold = (old); \
+ typeof(*p) _________pnew = (_new); \
+ if (!__builtin_constant_p(_new) || \
+ ((_new) != NULL)) \
+ wmb(); \
+ uatomic_cmpxchg(p, _________pold, _________pnew); \
})
/**
#define _rcu_xchg_pointer(p, v) \
({ \
+ typeof(*p) _________pv = (v); \
if (!__builtin_constant_p(v) || \
((v) != NULL)) \
wmb(); \
- uatomic_xchg(p, v); \
+ uatomic_xchg(p, _________pv); \
})
#define _rcu_set_pointer(p, v) \
({ \
+ typeof(*p) _________pv = (v); \
if (!__builtin_constant_p(v) || \
((v) != NULL)) \
wmb(); \
- STORE_SHARED(*(p), v); \
+ STORE_SHARED(*(p), _________pv); \
})
/**
extern void *rcu_cmpxchg_pointer_sym(void **p, void *old, void *_new);
#define rcu_cmpxchg_pointer(p, old, _new) \
({ \
+ typeof(*p) _________pold = (old); \
+ typeof(*p) _________pnew = (_new); \
typeof(*p) _________p1 = \
- rcu_cmpxchg_pointer_sym((void **)(p), (old), (_new));\
+ rcu_cmpxchg_pointer_sym((void **)(p), _________pold, \
+ _________pnew); \
(_________p1); \
})
extern void *rcu_xchg_pointer_sym(void **p, void *v);
#define rcu_xchg_pointer(p, v) \
({ \
+ typeof(*p) _________pv = (v); \
typeof(*p) _________p1 = \
- rcu_xchg_pointer_sym((void **)(p), (v)); \
+ rcu_xchg_pointer_sym((void **)(p), _________pv); \
(_________p1); \
})
extern void *rcu_set_pointer_sym(void **p, void *v);
#define rcu_set_pointer(p, v) \
({ \
+ typeof(*p) _________pv = (v); \
typeof(*p) _________p1 = \
- rcu_set_pointer_sym((void **)(p), (v)); \
+ rcu_set_pointer_sym((void **)(p), _________pv); \
})
#endif /* !_LGPL_SOURCE */