extern void *rcu_dereference_sym_bp(void *p);
#define rcu_dereference_bp(p) \
+ __extension__ \
({ \
__typeof__(p) _________p1 = URCU_FORCE_CAST(__typeof__(p), \
rcu_dereference_sym_bp(URCU_FORCE_CAST(void *, p))); \
extern void *rcu_cmpxchg_pointer_sym_bp(void **p, void *old, void *_new);
#define rcu_cmpxchg_pointer_bp(p, old, _new) \
+ __extension__ \
({ \
__typeof__(*(p)) _________pold = (old); \
__typeof__(*(p)) _________pnew = (_new); \
extern void *rcu_xchg_pointer_sym_bp(void **p, void *v);
#define rcu_xchg_pointer_bp(p, v) \
+ __extension__ \
({ \
__typeof__(*(p)) _________pv = (v); \
__typeof__(*(p)) _________p1 = URCU_FORCE_CAST(__typeof__(*(p)),\
extern void *rcu_set_pointer_sym_bp(void **p, void *v);
#define rcu_set_pointer_bp(p, v) \
+ __extension__ \
({ \
__typeof__(*(p)) _________pv = (v); \
__typeof__(*(p)) _________p1 = URCU_FORCE_CAST(__typeof__(*(p)), \
extern void *rcu_dereference_sym(void *p);
#define rcu_dereference(p) \
+ __extension__ \
({ \
__typeof__(p) _________p1 = URCU_FORCE_CAST(__typeof__(p), \
rcu_dereference_sym(URCU_FORCE_CAST(void *, p))); \
extern void *rcu_cmpxchg_pointer_sym(void **p, void *old, void *_new);
#define rcu_cmpxchg_pointer(p, old, _new) \
+ __extension__ \
({ \
__typeof__(*(p)) _________pold = (old); \
__typeof__(*(p)) _________pnew = (_new); \
extern void *rcu_xchg_pointer_sym(void **p, void *v);
#define rcu_xchg_pointer(p, v) \
+ __extension__ \
({ \
__typeof__(*(p)) _________pv = (v); \
__typeof__(*(p)) _________p1 = URCU_FORCE_CAST(__typeof__(*(p)), \
#define cmm_smp_wmb() __asm__ __volatile__ (LWSYNC_OPCODE:::"memory")
#define mftbl() \
+ __extension__ \
({ \
unsigned long rval; \
__asm__ __volatile__ ("mftbl %0" : "=r" (rval)); \
})
#define mftbu() \
+ __extension__ \
({ \
unsigned long rval; \
__asm__ __volatile__ ("mftbu %0" : "=r" (rval)); \
})
#define mftb() \
+ __extension__ \
({ \
unsigned long long rval; \
__asm__ __volatile__ ("mftb %0" : "=r" (rval)); \
* @member: name of the field within the object.
*/
#define caa_container_of(ptr, type, member) \
+ __extension__ \
({ \
const __typeof__(((type *) NULL)->member) * __ptr = (ptr); \
(type *)((char *)__ptr - offsetof(type, member)); \
* meets the 10-line criterion in LGPL, allowing this function to be
* expanded directly in non-LGPL code.
*/
-#define _rcu_dereference(p) ({ \
+#define _rcu_dereference(p) \
+ __extension__ \
+ ({ \
__typeof__(p) _________p1 = CMM_LOAD_SHARED(p); \
cmm_smp_read_barrier_depends(); \
(_________p1); \
* expanded directly in non-LGPL code.
*/
#define _rcu_cmpxchg_pointer(p, old, _new) \
+ __extension__ \
({ \
__typeof__(*p) _________pold = (old); \
__typeof__(*p) _________pnew = (_new); \
* expanded directly in non-LGPL code.
*/
#define _rcu_xchg_pointer(p, v) \
+ __extension__ \
({ \
__typeof__(*p) _________pv = (v); \
if (!__builtin_constant_p(v) || \
* Load a data from shared memory, doing a cache flush if required.
*/
#define CMM_LOAD_SHARED(p) \
+ __extension__ \
({ \
cmm_smp_rmc(); \
_CMM_LOAD_SHARED(p); \
* Identify a shared store. A cmm_smp_wmc() or cmm_smp_mc() should
* follow the store.
*/
-#define _CMM_STORE_SHARED(x, v) ({ CMM_ACCESS_ONCE(x) = (v); })
+#define _CMM_STORE_SHARED(x, v) __extension__ ({ CMM_ACCESS_ONCE(x) = (v); })
/*
* Store v into x, where x is located in shared memory. Performs the
* required cache flush after writing. Returns v.
*/
#define CMM_STORE_SHARED(x, v) \
+ __extension__ \
({ \
__typeof__(x) _v = _CMM_STORE_SHARED(x, v); \
cmm_smp_wmc(); \