Catalin Marinas | 0becb08 | 2009-07-24 12:32:53 +0100 | [diff] [blame] | 1 | /* |
| 2 | * include/asm-arm/unified.h - Unified Assembler Syntax helper macros |
| 3 | * |
| 4 | * Copyright (C) 2008 ARM Limited |
| 5 | * |
| 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. |
| 9 | * |
| 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. |
| 14 | * |
| 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 |
| 18 | */ |
| 19 | |
| 20 | #ifndef __ASM_UNIFIED_H |
| 21 | #define __ASM_UNIFIED_H |
| 22 | |
Nicolas Pitre | 75fea30 | 2017-11-29 07:52:52 +0100 | [diff] [blame] | 23 | #if defined(__ASSEMBLY__) |
Catalin Marinas | 0becb08 | 2009-07-24 12:32:53 +0100 | [diff] [blame] | 24 | .syntax unified |
Nicolas Pitre | 75fea30 | 2017-11-29 07:52:52 +0100 | [diff] [blame] | 25 | #else |
| 26 | __asm__(".syntax unified"); |
Catalin Marinas | 0becb08 | 2009-07-24 12:32:53 +0100 | [diff] [blame] | 27 | #endif |
| 28 | |
Joachim Eastwood | c20611d | 2015-03-25 08:47:18 +0100 | [diff] [blame] | 29 | #ifdef CONFIG_CPU_V7M |
| 30 | #define AR_CLASS(x...) |
| 31 | #define M_CLASS(x...) x |
| 32 | #else |
| 33 | #define AR_CLASS(x...) x |
| 34 | #define M_CLASS(x...) |
| 35 | #endif |
| 36 | |
Catalin Marinas | 0becb08 | 2009-07-24 12:32:53 +0100 | [diff] [blame] | 37 | #ifdef CONFIG_THUMB2_KERNEL |
| 38 | |
| 39 | #if __GNUC__ < 4 |
| 40 | #error Thumb-2 kernel requires gcc >= 4 |
| 41 | #endif |
| 42 | |
| 43 | /* The CPSR bit describing the instruction set (Thumb) */ |
| 44 | #define PSR_ISETSTATE PSR_T_BIT |
| 45 | |
| 46 | #define ARM(x...) |
| 47 | #define THUMB(x...) x |
Alexey Dobriyan | 74109b8 | 2009-09-18 15:09:33 +0100 | [diff] [blame] | 48 | #ifdef __ASSEMBLY__ |
Catalin Marinas | 0becb08 | 2009-07-24 12:32:53 +0100 | [diff] [blame] | 49 | #define W(instr) instr.w |
Will Deacon | 27a8479 | 2013-07-02 12:10:42 +0100 | [diff] [blame] | 50 | #else |
| 51 | #define WASM(instr) #instr ".w" |
Rob Herring | efb963d | 2012-01-09 15:43:20 -0600 | [diff] [blame] | 52 | #endif |
Catalin Marinas | 0becb08 | 2009-07-24 12:32:53 +0100 | [diff] [blame] | 53 | |
| 54 | #else /* !CONFIG_THUMB2_KERNEL */ |
| 55 | |
| 56 | /* The CPSR bit describing the instruction set (ARM) */ |
| 57 | #define PSR_ISETSTATE 0 |
| 58 | |
| 59 | #define ARM(x...) x |
| 60 | #define THUMB(x...) |
Alexey Dobriyan | 74109b8 | 2009-09-18 15:09:33 +0100 | [diff] [blame] | 61 | #ifdef __ASSEMBLY__ |
Catalin Marinas | 0becb08 | 2009-07-24 12:32:53 +0100 | [diff] [blame] | 62 | #define W(instr) instr |
Will Deacon | 27a8479 | 2013-07-02 12:10:42 +0100 | [diff] [blame] | 63 | #else |
| 64 | #define WASM(instr) #instr |
Rob Herring | efb963d | 2012-01-09 15:43:20 -0600 | [diff] [blame] | 65 | #endif |
Catalin Marinas | 0becb08 | 2009-07-24 12:32:53 +0100 | [diff] [blame] | 66 | |
| 67 | #endif /* CONFIG_THUMB2_KERNEL */ |
| 68 | |
Catalin Marinas | 0becb08 | 2009-07-24 12:32:53 +0100 | [diff] [blame] | 69 | #endif /* !__ASM_UNIFIED_H */ |