ARM: Add SMP and UP macros for inline assembly
PATCH 1/1 ARM: Add SMP and UP macros for inline assembly
We can't use the macros in asm/assembler.h in C inline functions.
Signed-off-by Tony Lindgren <[email protected]>
arch/arm/include/asm/assembler.h +4 -0
@@ -154,6 +154,10 @@ .long 9999b,9001f; \ .popsection +/* +* SMP and UP defines for assembly code. See also asm/smp_plat.h +* for the SMP and UP defines for inline code. +*/ #ifdef CONFIG_SMP #define SMP(instr...) \ 9998: instr
arch/arm/include/asm/smp_plat.h +21 -0
@@ -18,4 +18,25 @@ static inline int cache_ops_need_broadcast(void) return ((read_cpuid_ext(CPUID_EXT_MMFR3) >> 12) & 0xf) < 1; } +/* +* SMP and UP defines for inline functions. See also asm/assembler.h +* for the SMP and UP defines for assembly code. +*/ +#ifdef CONFIG_SMP +#define _str(s...) #s +#define _9998(s...) _str(9998: s\n) + +#define SMP(instr...) \ + _9998(instr) + +#define UP(instr...) \ + _str(.pushsection ".smpalt.init", "a"\n) \ + _str(.word 9998b\n) \ + _str(instr\n) \ + _str(.popsection\n) +#else +#define SMP(instr...) +#define UP(instr...) _str(instr) +#endif +#endif