1*45051539SThomas Gleixner /* SPDX-License-Identifier: GPL-2.0-only */ 20becb088SCatalin Marinas /* 30becb088SCatalin Marinas * include/asm-arm/unified.h - Unified Assembler Syntax helper macros 40becb088SCatalin Marinas * 50becb088SCatalin Marinas * Copyright (C) 2008 ARM Limited 60becb088SCatalin Marinas */ 70becb088SCatalin Marinas 80becb088SCatalin Marinas #ifndef __ASM_UNIFIED_H 90becb088SCatalin Marinas #define __ASM_UNIFIED_H 100becb088SCatalin Marinas 1175fea300SNicolas Pitre #if defined(__ASSEMBLY__) 120becb088SCatalin Marinas .syntax unified 1375fea300SNicolas Pitre #else 1475fea300SNicolas Pitre __asm__(".syntax unified"); 150becb088SCatalin Marinas #endif 160becb088SCatalin Marinas 17c20611dfSJoachim Eastwood #ifdef CONFIG_CPU_V7M 18c20611dfSJoachim Eastwood #define AR_CLASS(x...) 19c20611dfSJoachim Eastwood #define M_CLASS(x...) x 20c20611dfSJoachim Eastwood #else 21c20611dfSJoachim Eastwood #define AR_CLASS(x...) x 22c20611dfSJoachim Eastwood #define M_CLASS(x...) 23c20611dfSJoachim Eastwood #endif 24c20611dfSJoachim Eastwood 250becb088SCatalin Marinas #ifdef CONFIG_THUMB2_KERNEL 260becb088SCatalin Marinas 270becb088SCatalin Marinas /* The CPSR bit describing the instruction set (Thumb) */ 280becb088SCatalin Marinas #define PSR_ISETSTATE PSR_T_BIT 290becb088SCatalin Marinas 300becb088SCatalin Marinas #define ARM(x...) 310becb088SCatalin Marinas #define THUMB(x...) x 3274109b89SAlexey Dobriyan #ifdef __ASSEMBLY__ 330becb088SCatalin Marinas #define W(instr) instr.w 3427a84793SWill Deacon #else 3527a84793SWill Deacon #define WASM(instr) #instr ".w" 36efb963dcSRob Herring #endif 370becb088SCatalin Marinas 380becb088SCatalin Marinas #else /* !CONFIG_THUMB2_KERNEL */ 390becb088SCatalin Marinas 400becb088SCatalin Marinas /* The CPSR bit describing the instruction set (ARM) */ 410becb088SCatalin Marinas #define PSR_ISETSTATE 0 420becb088SCatalin Marinas 430becb088SCatalin Marinas #define ARM(x...) x 440becb088SCatalin Marinas #define THUMB(x...) 4574109b89SAlexey Dobriyan #ifdef __ASSEMBLY__ 460becb088SCatalin Marinas #define W(instr) instr 4727a84793SWill Deacon #else 4827a84793SWill Deacon #define WASM(instr) #instr 49efb963dcSRob Herring #endif 500becb088SCatalin Marinas 510becb088SCatalin Marinas #endif /* CONFIG_THUMB2_KERNEL */ 520becb088SCatalin Marinas 530becb088SCatalin Marinas #endif /* !__ASM_UNIFIED_H */ 54