2 * include/asm-arm/unified.h - Unified Assembler Syntax helper macros
4 * Copyright (C) 2008 ARM Limited
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 #ifndef __ASM_UNIFIED_H
21 #define __ASM_UNIFIED_H
23 #if defined(__ASSEMBLY__) && defined(CONFIG_ARM_ASM_UNIFIED)
28 #define AR_CLASS(x...)
29 #define M_CLASS(x...) x
31 #define AR_CLASS(x...) x
35 #ifdef CONFIG_THUMB2_KERNEL
38 #error Thumb-2 kernel requires gcc >= 4
41 /* The CPSR bit describing the instruction set (Thumb) */
42 #define PSR_ISETSTATE PSR_T_BIT
47 #define W(instr) instr.w
49 #define WASM(instr) #instr ".w"
52 #else /* !CONFIG_THUMB2_KERNEL */
54 /* The CPSR bit describing the instruction set (ARM) */
55 #define PSR_ISETSTATE 0
60 #define W(instr) instr
62 #define WASM(instr) #instr
65 #endif /* CONFIG_THUMB2_KERNEL */
67 #ifndef CONFIG_ARM_ASM_UNIFIED
70 * If the unified assembly syntax isn't used (in ARM mode), these
71 * macros expand to an empty string
104 #else /* !__ASSEMBLY__ */
108 " .macro itt, cond\n"
110 " .macro ite, cond\n"
112 " .macro ittt, cond\n"
114 " .macro itte, cond\n"
116 " .macro itet, cond\n"
118 " .macro itee, cond\n"
120 " .macro itttt, cond\n"
122 " .macro ittte, cond\n"
124 " .macro ittet, cond\n"
126 " .macro ittee, cond\n"
128 " .macro itett, cond\n"
130 " .macro itete, cond\n"
132 " .macro iteet, cond\n"
134 " .macro iteee, cond\n"
136 #endif /* __ASSEMBLY__ */
138 #endif /* CONFIG_ARM_ASM_UNIFIED */
140 #endif /* !__ASM_UNIFIED_H */