diff options
Diffstat (limited to 'arch/arm/include/asm/assembler.h')
-rw-r--r-- | arch/arm/include/asm/assembler.h | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/arch/arm/include/asm/assembler.h b/arch/arm/include/asm/assembler.h index 6e8f05c8a1c8..062b58c029ab 100644 --- a/arch/arm/include/asm/assembler.h +++ b/arch/arm/include/asm/assembler.h | |||
@@ -154,16 +154,39 @@ | |||
154 | .long 9999b,9001f; \ | 154 | .long 9999b,9001f; \ |
155 | .popsection | 155 | .popsection |
156 | 156 | ||
157 | #ifdef CONFIG_SMP | ||
158 | #define ALT_SMP(instr...) \ | ||
159 | 9998: instr | ||
160 | #define ALT_UP(instr...) \ | ||
161 | .pushsection ".alt.smp.init", "a" ;\ | ||
162 | .long 9998b ;\ | ||
163 | instr ;\ | ||
164 | .popsection | ||
165 | #define ALT_UP_B(label) \ | ||
166 | .equ up_b_offset, label - 9998b ;\ | ||
167 | .pushsection ".alt.smp.init", "a" ;\ | ||
168 | .long 9998b ;\ | ||
169 | b . + up_b_offset ;\ | ||
170 | .popsection | ||
171 | #else | ||
172 | #define ALT_SMP(instr...) | ||
173 | #define ALT_UP(instr...) instr | ||
174 | #define ALT_UP_B(label) b label | ||
175 | #endif | ||
176 | |||
157 | /* | 177 | /* |
158 | * SMP data memory barrier | 178 | * SMP data memory barrier |
159 | */ | 179 | */ |
160 | .macro smp_dmb | 180 | .macro smp_dmb |
161 | #ifdef CONFIG_SMP | 181 | #ifdef CONFIG_SMP |
162 | #if __LINUX_ARM_ARCH__ >= 7 | 182 | #if __LINUX_ARM_ARCH__ >= 7 |
163 | dmb | 183 | ALT_SMP(dmb) |
164 | #elif __LINUX_ARM_ARCH__ == 6 | 184 | #elif __LINUX_ARM_ARCH__ == 6 |
165 | mcr p15, 0, r0, c7, c10, 5 @ dmb | 185 | ALT_SMP(mcr p15, 0, r0, c7, c10, 5) @ dmb |
186 | #else | ||
187 | #error Incompatible SMP platform | ||
166 | #endif | 188 | #endif |
189 | ALT_UP(nop) | ||
167 | #endif | 190 | #endif |
168 | .endm | 191 | .endm |
169 | 192 | ||