]> git.sur5r.net Git - freertos/blob - FreeRTOS/Demo/CORTEX_M7_M4_AMP_STM32H745I_Discovery_IAR/ST_code/CMSIS/Include/cmsis_compiler.h
Add M7/M4 AMP demo.
[freertos] / FreeRTOS / Demo / CORTEX_M7_M4_AMP_STM32H745I_Discovery_IAR / ST_code / CMSIS / Include / cmsis_compiler.h
1 /**************************************************************************//**\r
2  * @file     cmsis_compiler.h\r
3  * @brief    CMSIS compiler generic header file\r
4  * @version  V5.0.1\r
5  * @date     30. January 2017\r
6  ******************************************************************************/\r
7 /*\r
8  * Copyright (c) 2009-2017 ARM Limited. All rights reserved.\r
9  *\r
10  * SPDX-License-Identifier: Apache-2.0\r
11  *\r
12  * Licensed under the Apache License, Version 2.0 (the License); you may\r
13  * not use this file except in compliance with the License.\r
14  * You may obtain a copy of the License at\r
15  *\r
16  * www.apache.org/licenses/LICENSE-2.0\r
17  *\r
18  * Unless required by applicable law or agreed to in writing, software\r
19  * distributed under the License is distributed on an AS IS BASIS, WITHOUT\r
20  * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
21  * See the License for the specific language governing permissions and\r
22  * limitations under the License.\r
23  */\r
24 \r
25 #ifndef __CMSIS_COMPILER_H\r
26 #define __CMSIS_COMPILER_H\r
27 \r
28 #include <stdint.h>\r
29 \r
30 /*\r
31  * ARM Compiler 4/5\r
32  */\r
33 #if   defined ( __CC_ARM )\r
34   #include "cmsis_armcc.h"\r
35 \r
36 \r
37 /*\r
38  * ARM Compiler 6 (armclang)\r
39  */\r
40 #elif defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)\r
41   #include "cmsis_armclang.h"\r
42 \r
43 \r
44 /*\r
45  * GNU Compiler\r
46  */\r
47 #elif defined ( __GNUC__ )\r
48   #include "cmsis_gcc.h"\r
49 \r
50 \r
51 /*\r
52  * IAR Compiler\r
53  */\r
54 #elif defined ( __ICCARM__ )\r
55 \r
56   #ifndef   __ASM\r
57     #define __ASM                     __asm\r
58   #endif\r
59   #ifndef   __INLINE\r
60     #define __INLINE                  inline\r
61   #endif\r
62   #ifndef   __STATIC_INLINE\r
63     #define __STATIC_INLINE           static inline\r
64   #endif\r
65 \r
66   #include <cmsis_iar.h>\r
67 \r
68   #ifndef   __NO_RETURN\r
69     #define __NO_RETURN               __noreturn\r
70   #endif\r
71   #ifndef   __USED\r
72     #define __USED                    __root\r
73   #endif\r
74   #ifndef   __WEAK\r
75     #define __WEAK                    __weak\r
76   #endif\r
77   #ifndef   __UNALIGNED_UINT32\r
78     __packed struct T_UINT32 { uint32_t v; };\r
79       #define __UNALIGNED_UINT32(x)     (((struct T_UINT32 *)(x))->v)\r
80   #endif\r
81   #ifndef   __ALIGNED\r
82     #warning No compiler specific solution for __ALIGNED. __ALIGNED is ignored.\r
83     #define __ALIGNED(x)\r
84   #endif\r
85   #ifndef   __PACKED\r
86     #define __PACKED                  __packed\r
87   #endif\r
88   #ifndef   __PACKED_STRUCT\r
89     #define __PACKED_STRUCT           __packed struct\r
90   #endif\r
91 \r
92 \r
93 /*\r
94  * TI ARM Compiler\r
95  */\r
96 #elif defined ( __TI_ARM__ )\r
97   #include <cmsis_ccs.h>\r
98 \r
99   #ifndef   __ASM\r
100     #define __ASM                     __asm\r
101   #endif\r
102   #ifndef   __INLINE\r
103     #define __INLINE                  inline\r
104   #endif\r
105   #ifndef   __STATIC_INLINE\r
106     #define __STATIC_INLINE           static inline\r
107   #endif\r
108   #ifndef   __NO_RETURN\r
109     #define __NO_RETURN               __attribute__((noreturn))\r
110   #endif\r
111   #ifndef   __USED\r
112     #define __USED                    __attribute__((used))\r
113   #endif\r
114   #ifndef   __WEAK\r
115     #define __WEAK                    __attribute__((weak))\r
116   #endif\r
117   #ifndef   __UNALIGNED_UINT32\r
118     struct __attribute__((packed)) T_UINT32 { uint32_t v; };\r
119     #define __UNALIGNED_UINT32(x)     (((struct T_UINT32 *)(x))->v)\r
120   #endif\r
121   #ifndef   __ALIGNED\r
122     #define __ALIGNED(x)              __attribute__((aligned(x)))\r
123   #endif\r
124   #ifndef   __PACKED\r
125     #define __PACKED                  __attribute__((packed))\r
126   #endif\r
127   #ifndef   __PACKED_STRUCT\r
128     #define __PACKED_STRUCT           struct __attribute__((packed))\r
129   #endif\r
130 \r
131 \r
132 /*\r
133  * TASKING Compiler\r
134  */\r
135 #elif defined ( __TASKING__ )\r
136   /*\r
137    * The CMSIS functions have been implemented as intrinsics in the compiler.\r
138    * Please use "carm -?i" to get an up to date list of all intrinsics,\r
139    * Including the CMSIS ones.\r
140    */\r
141 \r
142   #ifndef   __ASM\r
143     #define __ASM                     __asm\r
144   #endif\r
145   #ifndef   __INLINE\r
146     #define __INLINE                  inline\r
147   #endif\r
148   #ifndef   __STATIC_INLINE\r
149     #define __STATIC_INLINE           static inline\r
150   #endif\r
151   #ifndef   __NO_RETURN\r
152     #define __NO_RETURN               __attribute__((noreturn))\r
153   #endif\r
154   #ifndef   __USED\r
155     #define __USED                    __attribute__((used))\r
156   #endif\r
157   #ifndef   __WEAK\r
158     #define __WEAK                    __attribute__((weak))\r
159   #endif\r
160   #ifndef   __UNALIGNED_UINT32\r
161     struct __packed__ T_UINT32 { uint32_t v; };\r
162     #define __UNALIGNED_UINT32(x)     (((struct T_UINT32 *)(x))->v)\r
163   #endif\r
164   #ifndef   __ALIGNED\r
165     #define __ALIGNED(x)              __align(x)\r
166   #endif\r
167   #ifndef   __PACKED\r
168     #define __PACKED                  __packed__\r
169   #endif\r
170   #ifndef   __PACKED_STRUCT\r
171     #define __PACKED_STRUCT           struct __packed__\r
172   #endif\r
173 \r
174 \r
175 /*\r
176  * COSMIC Compiler\r
177  */\r
178 #elif defined ( __CSMC__ )\r
179    #include <cmsis_csm.h>\r
180 \r
181  #ifndef   __ASM\r
182     #define __ASM                     _asm\r
183   #endif\r
184   #ifndef   __INLINE\r
185     #define __INLINE                  inline\r
186   #endif\r
187   #ifndef   __STATIC_INLINE\r
188     #define __STATIC_INLINE           static inline\r
189   #endif\r
190   #ifndef   __NO_RETURN\r
191     // NO RETURN is automatically detected hence no warning here\r
192     #define __NO_RETURN\r
193   #endif\r
194   #ifndef   __USED\r
195     #warning No compiler specific solution for __USED. __USED is ignored.\r
196     #define __USED\r
197   #endif\r
198   #ifndef   __WEAK\r
199     #define __WEAK                    __weak\r
200   #endif\r
201   #ifndef   __UNALIGNED_UINT32\r
202     @packed struct T_UINT32 { uint32_t v; };\r
203     #define __UNALIGNED_UINT32(x)     (((struct T_UINT32 *)(x))->v)\r
204   #endif\r
205   #ifndef   __ALIGNED\r
206     #warning No compiler specific solution for __ALIGNED. __ALIGNED is ignored.\r
207     #define __ALIGNED(x)\r
208   #endif\r
209   #ifndef   __PACKED\r
210     #define __PACKED                  @packed\r
211   #endif\r
212   #ifndef   __PACKED_STRUCT\r
213     #define __PACKED_STRUCT           @packed struct\r
214   #endif\r
215 \r
216 \r
217 #else\r
218   #error Unknown compiler.\r
219 #endif\r
220 \r
221 \r
222 #endif /* __CMSIS_COMPILER_H */\r
223 \r