Back to home page

LXR

 
 

    


0001 /*
0002  * include/asm-arm/unified.h - Unified Assembler Syntax helper macros
0003  *
0004  * Copyright (C) 2008 ARM Limited
0005  *
0006  * This program is free software; you can redistribute it and/or modify
0007  * it under the terms of the GNU General Public License version 2 as
0008  * published by the Free Software Foundation.
0009  *
0010  * This program is distributed in the hope that it will be useful,
0011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
0012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0013  * GNU General Public License for more details.
0014  *
0015  * You should have received a copy of the GNU General Public License
0016  * along with this program; if not, write to the Free Software
0017  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
0018  */
0019 
0020 #ifndef __ASM_UNIFIED_H
0021 #define __ASM_UNIFIED_H
0022 
0023 #if defined(__ASSEMBLY__) && defined(CONFIG_ARM_ASM_UNIFIED)
0024     .syntax unified
0025 #endif
0026 
0027 #ifdef CONFIG_CPU_V7M
0028 #define AR_CLASS(x...)
0029 #define M_CLASS(x...)   x
0030 #else
0031 #define AR_CLASS(x...)  x
0032 #define M_CLASS(x...)
0033 #endif
0034 
0035 #ifdef CONFIG_THUMB2_KERNEL
0036 
0037 #if __GNUC__ < 4
0038 #error Thumb-2 kernel requires gcc >= 4
0039 #endif
0040 
0041 /* The CPSR bit describing the instruction set (Thumb) */
0042 #define PSR_ISETSTATE   PSR_T_BIT
0043 
0044 #define ARM(x...)
0045 #define THUMB(x...) x
0046 #ifdef __ASSEMBLY__
0047 #define W(instr)    instr.w
0048 #else
0049 #define WASM(instr) #instr ".w"
0050 #endif
0051 
0052 #else   /* !CONFIG_THUMB2_KERNEL */
0053 
0054 /* The CPSR bit describing the instruction set (ARM) */
0055 #define PSR_ISETSTATE   0
0056 
0057 #define ARM(x...)   x
0058 #define THUMB(x...)
0059 #ifdef __ASSEMBLY__
0060 #define W(instr)    instr
0061 #else
0062 #define WASM(instr) #instr
0063 #endif
0064 
0065 #endif  /* CONFIG_THUMB2_KERNEL */
0066 
0067 #ifndef CONFIG_ARM_ASM_UNIFIED
0068 
0069 /*
0070  * If the unified assembly syntax isn't used (in ARM mode), these
0071  * macros expand to an empty string
0072  */
0073 #ifdef __ASSEMBLY__
0074     .macro  it, cond
0075     .endm
0076     .macro  itt, cond
0077     .endm
0078     .macro  ite, cond
0079     .endm
0080     .macro  ittt, cond
0081     .endm
0082     .macro  itte, cond
0083     .endm
0084     .macro  itet, cond
0085     .endm
0086     .macro  itee, cond
0087     .endm
0088     .macro  itttt, cond
0089     .endm
0090     .macro  ittte, cond
0091     .endm
0092     .macro  ittet, cond
0093     .endm
0094     .macro  ittee, cond
0095     .endm
0096     .macro  itett, cond
0097     .endm
0098     .macro  itete, cond
0099     .endm
0100     .macro  iteet, cond
0101     .endm
0102     .macro  iteee, cond
0103     .endm
0104 #else   /* !__ASSEMBLY__ */
0105 __asm__(
0106 "   .macro  it, cond\n"
0107 "   .endm\n"
0108 "   .macro  itt, cond\n"
0109 "   .endm\n"
0110 "   .macro  ite, cond\n"
0111 "   .endm\n"
0112 "   .macro  ittt, cond\n"
0113 "   .endm\n"
0114 "   .macro  itte, cond\n"
0115 "   .endm\n"
0116 "   .macro  itet, cond\n"
0117 "   .endm\n"
0118 "   .macro  itee, cond\n"
0119 "   .endm\n"
0120 "   .macro  itttt, cond\n"
0121 "   .endm\n"
0122 "   .macro  ittte, cond\n"
0123 "   .endm\n"
0124 "   .macro  ittet, cond\n"
0125 "   .endm\n"
0126 "   .macro  ittee, cond\n"
0127 "   .endm\n"
0128 "   .macro  itett, cond\n"
0129 "   .endm\n"
0130 "   .macro  itete, cond\n"
0131 "   .endm\n"
0132 "   .macro  iteet, cond\n"
0133 "   .endm\n"
0134 "   .macro  iteee, cond\n"
0135 "   .endm\n");
0136 #endif  /* __ASSEMBLY__ */
0137 
0138 #endif  /* CONFIG_ARM_ASM_UNIFIED */
0139 
0140 #endif  /* !__ASM_UNIFIED_H */