1 /* SPDX-License-Identifier: GPL-2.0 */
3 * include/asm-arm/unified.h - Unified Assembler Syntax helper macros
5 * Copyright (C) 2008 ARM Limited
8 #ifndef __ASM_UNIFIED_H
9 #define __ASM_UNIFIED_H
11 #if defined(__ASSEMBLY__) && defined(CONFIG_ARM_ASM_UNIFIED)
16 #define AR_CLASS(x...)
17 #define M_CLASS(x...) x
19 #define AR_CLASS(x...) x
23 #ifdef CONFIG_THUMB2_KERNEL
26 #error Thumb-2 kernel requires gcc >= 4
29 /* The CPSR bit describing the instruction set (Thumb) */
30 #define PSR_ISETSTATE PSR_T_BIT
35 #define W(instr) instr.w
37 #define WASM(instr) #instr ".w"
40 #else /* !CONFIG_THUMB2_KERNEL */
42 /* The CPSR bit describing the instruction set (ARM) */
43 #define PSR_ISETSTATE 0
48 #define W(instr) instr
50 #define WASM(instr) #instr
53 #endif /* CONFIG_THUMB2_KERNEL */
55 #ifndef CONFIG_ARM_ASM_UNIFIED
58 * If the unified assembly syntax isn't used (in ARM mode), these
59 * macros expand to an empty string
92 #else /* !__ASSEMBLY__ */
100 " .macro ittt, cond\n"
102 " .macro itte, cond\n"
104 " .macro itet, cond\n"
106 " .macro itee, cond\n"
108 " .macro itttt, cond\n"
110 " .macro ittte, cond\n"
112 " .macro ittet, cond\n"
114 " .macro ittee, cond\n"
116 " .macro itett, cond\n"
118 " .macro itete, cond\n"
120 " .macro iteet, cond\n"
122 " .macro iteee, cond\n"
124 #endif /* __ASSEMBLY__ */
126 #endif /* CONFIG_ARM_ASM_UNIFIED */
128 #endif /* !__ASM_UNIFIED_H */