aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUros Bizjak <[email protected]>2023-11-05 22:34:35 +0100
committerIngo Molnar <[email protected]>2023-11-30 20:06:16 +0100
commit43bda69ed9e3b86d0ba5ff9256e437d50074d7d5 (patch)
treeffca0e834d4ce04cb7ea3ee08ee2af7ab00e294d
parent0548eb067ed664b93043e033295ca71e3e706245 (diff)
x86/percpu: Define PER_CPU_VAR macro also for !__ASSEMBLY__
Some C source files define 'asm' statements that use PER_CPU_VAR, so make PER_CPU_VAR macro available also without __ASSEMBLY__. Signed-off-by: Uros Bizjak <[email protected]> Signed-off-by: Ingo Molnar <[email protected]> Link: https://lore.kernel.org/r/[email protected]
-rw-r--r--arch/x86/include/asm/percpu.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/arch/x86/include/asm/percpu.h b/arch/x86/include/asm/percpu.h
index b86b27d15e52..0f12b2004b94 100644
--- a/arch/x86/include/asm/percpu.h
+++ b/arch/x86/include/asm/percpu.h
@@ -84,10 +84,15 @@
})
#endif /* CONFIG_USE_X86_SEG_SUPPORT */
+#define PER_CPU_VAR(var) %__percpu_seg:(var)__percpu_rel
+
#else /* CONFIG_SMP */
#define __percpu_seg_override
#define __percpu_prefix ""
#define __force_percpu_prefix ""
+
+#define PER_CPU_VAR(var) (var)__percpu_rel
+
#endif /* CONFIG_SMP */
#define __my_cpu_type(var) typeof(var) __percpu_seg_override