16 #ifndef __ASM_ASSEMBLER_H__
17 #define __ASM_ASSEMBLER_H__
20 #error "Only include this from assembly code"
23 #include <asm/ptrace.h>
35 #define get_byte_0 lsl #0
36 #define get_byte_1 lsr #8
37 #define get_byte_2 lsr #16
38 #define get_byte_3 lsr #24
39 #define put_byte_0 lsl #0
40 #define put_byte_1 lsl #8
41 #define put_byte_2 lsl #16
42 #define put_byte_3 lsl #24
46 #define get_byte_0 lsr #24
47 #define get_byte_1 lsr #16
48 #define get_byte_2 lsr #8
49 #define get_byte_3 lsl #0
50 #define put_byte_0 lsl #24
51 #define put_byte_1 lsl #16
52 #define put_byte_2 lsl #8
53 #define put_byte_3 lsl #0
59 #if __LINUX_ARM_ARCH__ >= 5
60 #define PLD(code...) code
74 #ifdef CONFIG_CPU_FEROCEON
75 #define CALGN(code...) code
77 #define CALGN(code...)
83 #if __LINUX_ARM_ARCH__ >= 6
84 .macro disable_irq_notrace
88 .macro enable_irq_notrace
92 .macro disable_irq_notrace
96 .macro enable_irq_notrace
101 .macro asm_trace_hardirqs_off
102 #if defined(CONFIG_TRACE_IRQFLAGS)
110 #if defined(CONFIG_TRACE_IRQFLAGS)
121 .macro asm_trace_hardirqs_on
127 asm_trace_hardirqs_off
131 asm_trace_hardirqs_on
159 restore_irqs_notrace \oldcpsr
164 .pushsection __ex_table,"a"; \
170 #define ALT_SMP(instr...) \
177 #define ALT_UP(instr...) \
178 .pushsection ".alt.smp.init", "a" ;\
181 .if . - 9997b != 4 ;\
182 .error "ALT_UP() content must assemble to exactly 4 bytes";\
185 #define ALT_UP_B(label) \
186 .equ up_b_offset, label - 9998b ;\
187 .pushsection ".alt.smp.init", "a" ;\
189 W(b) . + up_b_offset ;\
192 #define ALT_SMP(instr...)
193 #define ALT_UP(instr...) instr
194 #define ALT_UP_B(label) b label
201 #if __LINUX_ARM_ARCH__ >= 7
203 #elif __LINUX_ARM_ARCH__ == 6
204 mcr p15, 0,
r0, c7, c5, 4
213 #if __LINUX_ARM_ARCH__ >= 7
219 #elif __LINUX_ARM_ARCH__ == 6
222 #error Incompatible SMP platform
232 #ifdef CONFIG_THUMB2_KERNEL
252 .macro safe_svcmode_maskall
reg:
req
262 orr \reg, \reg,
#PSR_A_BIT
274 #ifdef CONFIG_THUMB2_KERNEL
279 \instr\cond\()
b\()\t\().
w \reg, [\ptr, #\off]
281 \instr\cond\()\t\().
w \reg, [\ptr, #\off]
283 .
error "Unsupported inc macro argument"
292 .macro
usracc, instr, reg, ptr, inc, cond,
rept, abort
301 .
error "Unsupported rept macro argument"
305 @ Slightly optimised to avoid incrementing
the pointer twice
306 usraccoff \instr, \reg, \ptr, \inc, 0, \cond, \abort
308 usraccoff \instr, \reg, \ptr, \inc, \inc, \cond, \abort
316 .macro usracc, instr, reg, ptr, inc, cond,
rept, abort, t=
TUSER()
320 \instr\cond\()b\()
\t \reg, [\ptr], #\inc
322 \instr\cond\()\t \reg, [\ptr], #\inc
324 .
error "Unsupported inc macro argument"
327 .pushsection __ex_table,
"a"
337 usracc
str, \reg, \ptr, \inc, \cond, \
rept, \abort
341 usracc
ldr, \reg, \ptr, \inc, \cond, \
rept, \abort
349 .
size \name , . - \name
353 #ifndef CONFIG_CPU_USE_DOMAINS
355 sbcccs \tmp, \tmp, \
limit