* by both the reader and the writers.
*/
DEFINE_URCU_TLS(struct urcu_bp_reader *, urcu_bp_reader);
-URCU_ATTR_ALIAS("urcu_bp_reader")
-extern struct urcu_bp_reader *rcu_reader_bp;
+DEFINE_URCU_TLS_ALIAS(struct urcu_bp_reader *, urcu_bp_reader, rcu_reader_bp);
static CDS_LIST_HEAD(registry);
* writers.
*/
DEFINE_URCU_TLS(struct urcu_qsbr_reader, urcu_qsbr_reader);
-URCU_ATTR_ALIAS("urcu_qsbr_reader")
-extern struct urcu_qsbr_reader rcu_reader_qsbr;
+DEFINE_URCU_TLS_ALIAS(struct urcu_qsbr_reader, urcu_qsbr_reader, rcu_reader_qsbr);
static CDS_LIST_HEAD(registry);
#define URCU_ATTR_ALIAS(x) __attribute__((alias(x)))
#endif
+#ifdef CONFIG_RCU_TLS
+#define DEFINE_URCU_TLS_ALIAS_1(type, name, alias) \
+ URCU_ATTR_ALIAS(#name) \
+ extern type alias
+
+#else
+#define DEFINE_URCU_TLS_ALIAS_1(type, name, alias) \
+ URCU_ATTR_ALIAS("*__tls_access_" #name) \
+ type *__tls_access_ ## alias()
+#endif
+
+#define DEFINE_URCU_TLS_ALIAS(type, name, alias) \
+ DEFINE_URCU_TLS_ALIAS_1(type, name, alias)
+
#endif /* _URCU_UTILS_H */
* writers.
*/
DEFINE_URCU_TLS(struct urcu_reader, rcu_reader);
-URCU_ATTR_ALIAS(urcu_stringify(rcu_reader))
-extern struct urcu_reader alias_rcu_reader;
+DEFINE_URCU_TLS_ALIAS(struct urcu_reader, rcu_reader, alias_rcu_reader);
static CDS_LIST_HEAD(registry);