]> git.sur5r.net Git - freertos/blobdiff - FreeRTOS/Demo/CORTEX_MPU_STM32L4_Discovery_GCC_IAR_Keil/ST_Code/Drivers/CMSIS/Include/cmsis_compiler.h
Rename STM32Cube to GCC for STM32L4 Discovery projects as GCC is
[freertos] / FreeRTOS / Demo / CORTEX_MPU_STM32L4_Discovery_GCC_IAR_Keil / ST_Code / Drivers / CMSIS / Include / cmsis_compiler.h
diff --git a/FreeRTOS/Demo/CORTEX_MPU_STM32L4_Discovery_GCC_IAR_Keil/ST_Code/Drivers/CMSIS/Include/cmsis_compiler.h b/FreeRTOS/Demo/CORTEX_MPU_STM32L4_Discovery_GCC_IAR_Keil/ST_Code/Drivers/CMSIS/Include/cmsis_compiler.h
new file mode 100644 (file)
index 0000000..79a2cac
--- /dev/null
@@ -0,0 +1,266 @@
+/**************************************************************************//**\r
+ * @file     cmsis_compiler.h\r
+ * @brief    CMSIS compiler generic header file\r
+ * @version  V5.0.4\r
+ * @date     10. January 2018\r
+ ******************************************************************************/\r
+/*\r
+ * Copyright (c) 2009-2018 Arm Limited. All rights reserved.\r
+ *\r
+ * SPDX-License-Identifier: Apache-2.0\r
+ *\r
+ * Licensed under the Apache License, Version 2.0 (the License); you may\r
+ * not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ * www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT\r
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ */\r
+\r
+#ifndef __CMSIS_COMPILER_H\r
+#define __CMSIS_COMPILER_H\r
+\r
+#include <stdint.h>\r
+\r
+/*\r
+ * Arm Compiler 4/5\r
+ */\r
+#if   defined ( __CC_ARM )\r
+  #include "cmsis_armcc.h"\r
+\r
+\r
+/*\r
+ * Arm Compiler 6 (armclang)\r
+ */\r
+#elif defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)\r
+  #include "cmsis_armclang.h"\r
+\r
+\r
+/*\r
+ * GNU Compiler\r
+ */\r
+#elif defined ( __GNUC__ )\r
+  #include "cmsis_gcc.h"\r
+\r
+\r
+/*\r
+ * IAR Compiler\r
+ */\r
+#elif defined ( __ICCARM__ )\r
+  #include <cmsis_iccarm.h>\r
+\r
+\r
+/*\r
+ * TI Arm Compiler\r
+ */\r
+#elif defined ( __TI_ARM__ )\r
+  #include <cmsis_ccs.h>\r
+\r
+  #ifndef   __ASM\r
+    #define __ASM                                  __asm\r
+  #endif\r
+  #ifndef   __INLINE\r
+    #define __INLINE                               inline\r
+  #endif\r
+  #ifndef   __STATIC_INLINE\r
+    #define __STATIC_INLINE                        static inline\r
+  #endif\r
+  #ifndef   __STATIC_FORCEINLINE\r
+    #define __STATIC_FORCEINLINE                   __STATIC_INLINE\r
+  #endif\r
+  #ifndef   __NO_RETURN\r
+    #define __NO_RETURN                            __attribute__((noreturn))\r
+  #endif\r
+  #ifndef   __USED\r
+    #define __USED                                 __attribute__((used))\r
+  #endif\r
+  #ifndef   __WEAK\r
+    #define __WEAK                                 __attribute__((weak))\r
+  #endif\r
+  #ifndef   __PACKED\r
+    #define __PACKED                               __attribute__((packed))\r
+  #endif\r
+  #ifndef   __PACKED_STRUCT\r
+    #define __PACKED_STRUCT                        struct __attribute__((packed))\r
+  #endif\r
+  #ifndef   __PACKED_UNION\r
+    #define __PACKED_UNION                         union __attribute__((packed))\r
+  #endif\r
+  #ifndef   __UNALIGNED_UINT32        /* deprecated */\r
+    struct __attribute__((packed)) T_UINT32 { uint32_t v; };\r
+    #define __UNALIGNED_UINT32(x)                  (((struct T_UINT32 *)(x))->v)\r
+  #endif\r
+  #ifndef   __UNALIGNED_UINT16_WRITE\r
+    __PACKED_STRUCT T_UINT16_WRITE { uint16_t v; };\r
+    #define __UNALIGNED_UINT16_WRITE(addr, val)    (void)((((struct T_UINT16_WRITE *)(void*)(addr))->v) = (val))\r
+  #endif\r
+  #ifndef   __UNALIGNED_UINT16_READ\r
+    __PACKED_STRUCT T_UINT16_READ { uint16_t v; };\r
+    #define __UNALIGNED_UINT16_READ(addr)          (((const struct T_UINT16_READ *)(const void *)(addr))->v)\r
+  #endif\r
+  #ifndef   __UNALIGNED_UINT32_WRITE\r
+    __PACKED_STRUCT T_UINT32_WRITE { uint32_t v; };\r
+    #define __UNALIGNED_UINT32_WRITE(addr, val)    (void)((((struct T_UINT32_WRITE *)(void *)(addr))->v) = (val))\r
+  #endif\r
+  #ifndef   __UNALIGNED_UINT32_READ\r
+    __PACKED_STRUCT T_UINT32_READ { uint32_t v; };\r
+    #define __UNALIGNED_UINT32_READ(addr)          (((const struct T_UINT32_READ *)(const void *)(addr))->v)\r
+  #endif\r
+  #ifndef   __ALIGNED\r
+    #define __ALIGNED(x)                           __attribute__((aligned(x)))\r
+  #endif\r
+  #ifndef   __RESTRICT\r
+    #warning No compiler specific solution for __RESTRICT. __RESTRICT is ignored.\r
+    #define __RESTRICT\r
+  #endif\r
+\r
+\r
+/*\r
+ * TASKING Compiler\r
+ */\r
+#elif defined ( __TASKING__ )\r
+  /*\r
+   * The CMSIS functions have been implemented as intrinsics in the compiler.\r
+   * Please use "carm -?i" to get an up to date list of all intrinsics,\r
+   * Including the CMSIS ones.\r
+   */\r
+\r
+  #ifndef   __ASM\r
+    #define __ASM                                  __asm\r
+  #endif\r
+  #ifndef   __INLINE\r
+    #define __INLINE                               inline\r
+  #endif\r
+  #ifndef   __STATIC_INLINE\r
+    #define __STATIC_INLINE                        static inline\r
+  #endif\r
+  #ifndef   __STATIC_FORCEINLINE\r
+    #define __STATIC_FORCEINLINE                   __STATIC_INLINE\r
+  #endif\r
+  #ifndef   __NO_RETURN\r
+    #define __NO_RETURN                            __attribute__((noreturn))\r
+  #endif\r
+  #ifndef   __USED\r
+    #define __USED                                 __attribute__((used))\r
+  #endif\r
+  #ifndef   __WEAK\r
+    #define __WEAK                                 __attribute__((weak))\r
+  #endif\r
+  #ifndef   __PACKED\r
+    #define __PACKED                               __packed__\r
+  #endif\r
+  #ifndef   __PACKED_STRUCT\r
+    #define __PACKED_STRUCT                        struct __packed__\r
+  #endif\r
+  #ifndef   __PACKED_UNION\r
+    #define __PACKED_UNION                         union __packed__\r
+  #endif\r
+  #ifndef   __UNALIGNED_UINT32        /* deprecated */\r
+    struct __packed__ T_UINT32 { uint32_t v; };\r
+    #define __UNALIGNED_UINT32(x)                  (((struct T_UINT32 *)(x))->v)\r
+  #endif\r
+  #ifndef   __UNALIGNED_UINT16_WRITE\r
+    __PACKED_STRUCT T_UINT16_WRITE { uint16_t v; };\r
+    #define __UNALIGNED_UINT16_WRITE(addr, val)    (void)((((struct T_UINT16_WRITE *)(void *)(addr))->v) = (val))\r
+  #endif\r
+  #ifndef   __UNALIGNED_UINT16_READ\r
+    __PACKED_STRUCT T_UINT16_READ { uint16_t v; };\r
+    #define __UNALIGNED_UINT16_READ(addr)          (((const struct T_UINT16_READ *)(const void *)(addr))->v)\r
+  #endif\r
+  #ifndef   __UNALIGNED_UINT32_WRITE\r
+    __PACKED_STRUCT T_UINT32_WRITE { uint32_t v; };\r
+    #define __UNALIGNED_UINT32_WRITE(addr, val)    (void)((((struct T_UINT32_WRITE *)(void *)(addr))->v) = (val))\r
+  #endif\r
+  #ifndef   __UNALIGNED_UINT32_READ\r
+    __PACKED_STRUCT T_UINT32_READ { uint32_t v; };\r
+    #define __UNALIGNED_UINT32_READ(addr)          (((const struct T_UINT32_READ *)(const void *)(addr))->v)\r
+  #endif\r
+  #ifndef   __ALIGNED\r
+    #define __ALIGNED(x)              __align(x)\r
+  #endif\r
+  #ifndef   __RESTRICT\r
+    #warning No compiler specific solution for __RESTRICT. __RESTRICT is ignored.\r
+    #define __RESTRICT\r
+  #endif\r
+\r
+\r
+/*\r
+ * COSMIC Compiler\r
+ */\r
+#elif defined ( __CSMC__ )\r
+   #include <cmsis_csm.h>\r
+\r
+ #ifndef   __ASM\r
+    #define __ASM                                  _asm\r
+  #endif\r
+  #ifndef   __INLINE\r
+    #define __INLINE                               inline\r
+  #endif\r
+  #ifndef   __STATIC_INLINE\r
+    #define __STATIC_INLINE                        static inline\r
+  #endif\r
+  #ifndef   __STATIC_FORCEINLINE\r
+    #define __STATIC_FORCEINLINE                   __STATIC_INLINE\r
+  #endif\r
+  #ifndef   __NO_RETURN\r
+    // NO RETURN is automatically detected hence no warning here\r
+    #define __NO_RETURN\r
+  #endif\r
+  #ifndef   __USED\r
+    #warning No compiler specific solution for __USED. __USED is ignored.\r
+    #define __USED\r
+  #endif\r
+  #ifndef   __WEAK\r
+    #define __WEAK                                 __weak\r
+  #endif\r
+  #ifndef   __PACKED\r
+    #define __PACKED                               @packed\r
+  #endif\r
+  #ifndef   __PACKED_STRUCT\r
+    #define __PACKED_STRUCT                        @packed struct\r
+  #endif\r
+  #ifndef   __PACKED_UNION\r
+    #define __PACKED_UNION                         @packed union\r
+  #endif\r
+  #ifndef   __UNALIGNED_UINT32        /* deprecated */\r
+    @packed struct T_UINT32 { uint32_t v; };\r
+    #define __UNALIGNED_UINT32(x)                  (((struct T_UINT32 *)(x))->v)\r
+  #endif\r
+  #ifndef   __UNALIGNED_UINT16_WRITE\r
+    __PACKED_STRUCT T_UINT16_WRITE { uint16_t v; };\r
+    #define __UNALIGNED_UINT16_WRITE(addr, val)    (void)((((struct T_UINT16_WRITE *)(void *)(addr))->v) = (val))\r
+  #endif\r
+  #ifndef   __UNALIGNED_UINT16_READ\r
+    __PACKED_STRUCT T_UINT16_READ { uint16_t v; };\r
+    #define __UNALIGNED_UINT16_READ(addr)          (((const struct T_UINT16_READ *)(const void *)(addr))->v)\r
+  #endif\r
+  #ifndef   __UNALIGNED_UINT32_WRITE\r
+    __PACKED_STRUCT T_UINT32_WRITE { uint32_t v; };\r
+    #define __UNALIGNED_UINT32_WRITE(addr, val)    (void)((((struct T_UINT32_WRITE *)(void *)(addr))->v) = (val))\r
+  #endif\r
+  #ifndef   __UNALIGNED_UINT32_READ\r
+    __PACKED_STRUCT T_UINT32_READ { uint32_t v; };\r
+    #define __UNALIGNED_UINT32_READ(addr)          (((const struct T_UINT32_READ *)(const void *)(addr))->v)\r
+  #endif\r
+  #ifndef   __ALIGNED\r
+    #warning No compiler specific solution for __ALIGNED. __ALIGNED is ignored.\r
+    #define __ALIGNED(x)\r
+  #endif\r
+  #ifndef   __RESTRICT\r
+    #warning No compiler specific solution for __RESTRICT. __RESTRICT is ignored.\r
+    #define __RESTRICT\r
+  #endif\r
+\r
+\r
+#else\r
+  #error Unknown compiler.\r
+#endif\r
+\r
+\r
+#endif /* __CMSIS_COMPILER_H */\r
+\r