[英]gcc show “Need native word sized stores/loads for atomicity” for calling `hlist_nulls_add_head_rcu`
I want to call hlist_nulls_add_head_rcu
to manage my list, however gcc gives lots of error messages as following: 我想致电
hlist_nulls_add_head_rcu
来管理我的列表,但是gcc给出了许多错误消息,如下所示:
|| ./include/linux/rculist_nulls.h: In function ‘hlist_nulls_add_head_rcu’:
/home/river/Desktop/kernel/linux-4.9.82/./include/linux/compiler.h|518 col 38| error: call to ‘__compiletime_assert_97’ declared with attribute error: Need native word sized stores/loads for atomicity.
|| _compiletime_assert(condition, msg, __compiletime_assert_, __LINE__)
|| ^
/home/river/Desktop/kernel/linux-4.9.82/./include/linux/compiler.h|501 col 4| note: in definition of macro ‘__compiletime_assert’
|| prefix ## suffix(); \
|| ^~~~~~
/home/river/Desktop/kernel/linux-4.9.82/./include/linux/compiler.h|518 col 2| note: in expansion of macro ‘_compiletime_assert’
|| _compiletime_assert(condition, msg, __compiletime_assert_, __LINE__)
|| ^~~~~~~~~~~~~~~~~~~
/home/river/Desktop/kernel/linux-4.9.82/./include/linux/compiler.h|521 col 2| note: in expansion of macro ‘compiletime_assert’
|| compiletime_assert(__native_word(t), \
|| ^~~~~~~~~~~~~~~~~~
/home/river/Desktop/kernel/linux-4.9.82/./arch/x86/include/asm/barrier.h|92 col 2| note: in expansion of macro ‘compiletime_assert_atomic_type’
|| compiletime_assert_atomic_type(*p); \
|| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/river/Desktop/kernel/linux-4.9.82/./include/asm-generic/barrier.h|157 col 33| note: in expansion of macro ‘__smp_store_release’
|| #define smp_store_release(p, v) __smp_store_release(p, v)
|| ^~~~~~~~~~~~~~~~~~~
/home/river/Desktop/kernel/linux-4.9.82/./include/linux/rcupdate.h|672 col 3| note: in expansion of macro ‘smp_store_release’
|| smp_store_release(&p, RCU_INITIALIZER((typeof(p))_r_a_p__v)); \
|| ^~~~~~~~~~~~~~~~~
/home/river/Desktop/kernel/linux-4.9.82/./include/linux/rculist_nulls.h|97 col 2| note: in expansion of macro ‘rcu_assign_pointer’
|| rcu_assign_pointer(hlist_nulls_first_rcu(h), n);
|| ^~~~~~~~~~~~~~~~~~
I think the most useful message is the first: 我认为最有用的信息是第一个:
/include/linux/compiler.h|518 col 38| error: call to ‘__compiletime_assert_97’ declared with attribute error: Need native word sized stores/loads for atomicity.
Then sentence calling hlist_nulls_add_head_rcu
in my module is : 然后在我的模块中调用
hlist_nulls_add_head_rcu
句子是:
hlist_nulls_add_head_rcu( &kcnew->hnnode,
&kp_sock_lists[kp_hash(kcnew->sock)] );
The parameter type is correct, so maybe the calling manner is error. 参数类型正确,因此调用方式可能是错误的。 Do anyone know how to use
hlist_nulls_add_head_rcu
? 有谁知道如何使用
hlist_nulls_add_head_rcu
吗?
删除ccflags -y的'-O0'RCU的编译需要编译优化。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.