@@ -156,6 +156,8 @@ do { \
156
156
*(qual __my_cpu_type(pcp) *)__my_cpu_ptr(&(pcp)) = (val); \
157
157
} while (0)
158
158
159
+ #define __raw_cpu_read_const (pcp ) __raw_cpu_read(, , pcp)
160
+
159
161
#else /* CONFIG_USE_X86_SEG_SUPPORT */
160
162
161
163
#define __raw_cpu_read (size , qual , _var ) \
@@ -180,6 +182,12 @@ do { \
180
182
: [val] __pcpu_reg_imm_##size(pto_val__)); \
181
183
} while (0)
182
184
185
+ /*
186
+ * The generic per-cpu infrastrucutre is not suitable for
187
+ * reading const-qualified variables.
188
+ */
189
+ #define __raw_cpu_read_const (pcp ) ({ BUILD_BUG(); (typeof(pcp))0; })
190
+
183
191
#endif /* CONFIG_USE_X86_SEG_SUPPORT */
184
192
185
193
#define percpu_stable_op (size , op , _var ) \
@@ -470,16 +478,7 @@ do { \
470
478
#define this_cpu_write_8 (pcp , val ) __raw_cpu_write(8, volatile, pcp, val)
471
479
#endif
472
480
473
- #ifdef CONFIG_USE_X86_SEG_SUPPORT
474
- #define this_cpu_read_const (pcp ) __raw_cpu_read(, , pcp)
475
- #else /* CONFIG_USE_X86_SEG_SUPPORT */
476
-
477
- /*
478
- * The generic per-cpu infrastrucutre is not suitable for
479
- * reading const-qualified variables.
480
- */
481
- #define this_cpu_read_const (pcp ) ({ BUILD_BUG(); (typeof(pcp))0; })
482
- #endif /* CONFIG_USE_X86_SEG_SUPPORT */
481
+ #define this_cpu_read_const (pcp ) __raw_cpu_read_const(pcp)
483
482
484
483
#define this_cpu_read_stable_1 (pcp ) percpu_stable_op(1, "mov", pcp)
485
484
#define this_cpu_read_stable_2 (pcp ) percpu_stable_op(2, "mov", pcp)
0 commit comments