Initial commit
mbed-dev-master/cmsis/TARGET_CORTEX_A/cmsis_compiler.h@0:bb348c97df44, 2020-09-16 (annotated)
- Committer:
- lypinator
- Date:
- Wed Sep 16 01:11:49 2020 +0000
- Revision:
- 0:bb348c97df44
Added PWM
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
lypinator | 0:bb348c97df44 | 1 | /**************************************************************************//** |
lypinator | 0:bb348c97df44 | 2 | * @file cmsis_compiler.h |
lypinator | 0:bb348c97df44 | 3 | * @brief CMSIS compiler specific macros, functions, instructions |
lypinator | 0:bb348c97df44 | 4 | * @version V1.0.2 |
lypinator | 0:bb348c97df44 | 5 | * @date 10. January 2018 |
lypinator | 0:bb348c97df44 | 6 | ******************************************************************************/ |
lypinator | 0:bb348c97df44 | 7 | /* |
lypinator | 0:bb348c97df44 | 8 | * Copyright (c) 2009-2018 Arm Limited. All rights reserved. |
lypinator | 0:bb348c97df44 | 9 | * |
lypinator | 0:bb348c97df44 | 10 | * SPDX-License-Identifier: Apache-2.0 |
lypinator | 0:bb348c97df44 | 11 | * |
lypinator | 0:bb348c97df44 | 12 | * Licensed under the Apache License, Version 2.0 (the License); you may |
lypinator | 0:bb348c97df44 | 13 | * not use this file except in compliance with the License. |
lypinator | 0:bb348c97df44 | 14 | * You may obtain a copy of the License at |
lypinator | 0:bb348c97df44 | 15 | * |
lypinator | 0:bb348c97df44 | 16 | * www.apache.org/licenses/LICENSE-2.0 |
lypinator | 0:bb348c97df44 | 17 | * |
lypinator | 0:bb348c97df44 | 18 | * Unless required by applicable law or agreed to in writing, software |
lypinator | 0:bb348c97df44 | 19 | * distributed under the License is distributed on an AS IS BASIS, WITHOUT |
lypinator | 0:bb348c97df44 | 20 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
lypinator | 0:bb348c97df44 | 21 | * See the License for the specific language governing permissions and |
lypinator | 0:bb348c97df44 | 22 | * limitations under the License. |
lypinator | 0:bb348c97df44 | 23 | */ |
lypinator | 0:bb348c97df44 | 24 | |
lypinator | 0:bb348c97df44 | 25 | #ifndef __CMSIS_COMPILER_H |
lypinator | 0:bb348c97df44 | 26 | #define __CMSIS_COMPILER_H |
lypinator | 0:bb348c97df44 | 27 | |
lypinator | 0:bb348c97df44 | 28 | #include <stdint.h> |
lypinator | 0:bb348c97df44 | 29 | |
lypinator | 0:bb348c97df44 | 30 | /* |
lypinator | 0:bb348c97df44 | 31 | * Arm Compiler 4/5 |
lypinator | 0:bb348c97df44 | 32 | */ |
lypinator | 0:bb348c97df44 | 33 | #if defined ( __CC_ARM ) |
lypinator | 0:bb348c97df44 | 34 | #include "cmsis_armcc.h" |
lypinator | 0:bb348c97df44 | 35 | |
lypinator | 0:bb348c97df44 | 36 | |
lypinator | 0:bb348c97df44 | 37 | /* |
lypinator | 0:bb348c97df44 | 38 | * Arm Compiler 6 (armclang) |
lypinator | 0:bb348c97df44 | 39 | */ |
lypinator | 0:bb348c97df44 | 40 | #elif defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) |
lypinator | 0:bb348c97df44 | 41 | #include "cmsis_armclang.h" |
lypinator | 0:bb348c97df44 | 42 | |
lypinator | 0:bb348c97df44 | 43 | |
lypinator | 0:bb348c97df44 | 44 | /* |
lypinator | 0:bb348c97df44 | 45 | * GNU Compiler |
lypinator | 0:bb348c97df44 | 46 | */ |
lypinator | 0:bb348c97df44 | 47 | #elif defined ( __GNUC__ ) |
lypinator | 0:bb348c97df44 | 48 | #include "cmsis_gcc.h" |
lypinator | 0:bb348c97df44 | 49 | |
lypinator | 0:bb348c97df44 | 50 | |
lypinator | 0:bb348c97df44 | 51 | /* |
lypinator | 0:bb348c97df44 | 52 | * IAR Compiler |
lypinator | 0:bb348c97df44 | 53 | */ |
lypinator | 0:bb348c97df44 | 54 | #elif defined ( __ICCARM__ ) |
lypinator | 0:bb348c97df44 | 55 | #include "cmsis_iccarm.h" |
lypinator | 0:bb348c97df44 | 56 | |
lypinator | 0:bb348c97df44 | 57 | |
lypinator | 0:bb348c97df44 | 58 | /* |
lypinator | 0:bb348c97df44 | 59 | * TI Arm Compiler |
lypinator | 0:bb348c97df44 | 60 | */ |
lypinator | 0:bb348c97df44 | 61 | #elif defined ( __TI_ARM__ ) |
lypinator | 0:bb348c97df44 | 62 | #include <cmsis_ccs.h> |
lypinator | 0:bb348c97df44 | 63 | |
lypinator | 0:bb348c97df44 | 64 | #ifndef __ASM |
lypinator | 0:bb348c97df44 | 65 | #define __ASM __asm |
lypinator | 0:bb348c97df44 | 66 | #endif |
lypinator | 0:bb348c97df44 | 67 | #ifndef __INLINE |
lypinator | 0:bb348c97df44 | 68 | #define __INLINE inline |
lypinator | 0:bb348c97df44 | 69 | #endif |
lypinator | 0:bb348c97df44 | 70 | #ifndef __STATIC_INLINE |
lypinator | 0:bb348c97df44 | 71 | #define __STATIC_INLINE static inline |
lypinator | 0:bb348c97df44 | 72 | #endif |
lypinator | 0:bb348c97df44 | 73 | #ifndef __STATIC_INLINE |
lypinator | 0:bb348c97df44 | 74 | #define __STATIC_INLINE static inline |
lypinator | 0:bb348c97df44 | 75 | #endif |
lypinator | 0:bb348c97df44 | 76 | #ifndef __STATIC_FORCEINLINE |
lypinator | 0:bb348c97df44 | 77 | #define __STATIC_FORCEINLINE __STATIC_INLINE |
lypinator | 0:bb348c97df44 | 78 | #endif |
lypinator | 0:bb348c97df44 | 79 | #ifndef __NO_RETURN |
lypinator | 0:bb348c97df44 | 80 | #define __NO_RETURN __attribute__((noreturn)) |
lypinator | 0:bb348c97df44 | 81 | #endif |
lypinator | 0:bb348c97df44 | 82 | #ifndef CMSIS_DEPRECATED |
lypinator | 0:bb348c97df44 | 83 | #define CMSIS_DEPRECATED __attribute__((deprecated)) |
lypinator | 0:bb348c97df44 | 84 | #endif |
lypinator | 0:bb348c97df44 | 85 | #ifndef __USED |
lypinator | 0:bb348c97df44 | 86 | #define __USED __attribute__((used)) |
lypinator | 0:bb348c97df44 | 87 | #endif |
lypinator | 0:bb348c97df44 | 88 | #ifndef __WEAK |
lypinator | 0:bb348c97df44 | 89 | #define __WEAK __attribute__((weak)) |
lypinator | 0:bb348c97df44 | 90 | #endif |
lypinator | 0:bb348c97df44 | 91 | #ifndef __UNALIGNED_UINT32 |
lypinator | 0:bb348c97df44 | 92 | struct __attribute__((packed)) T_UINT32 { uint32_t v; }; |
lypinator | 0:bb348c97df44 | 93 | #define __UNALIGNED_UINT32(x) (((struct T_UINT32 *)(x))->v) |
lypinator | 0:bb348c97df44 | 94 | #endif |
lypinator | 0:bb348c97df44 | 95 | #ifndef __ALIGNED |
lypinator | 0:bb348c97df44 | 96 | #define __ALIGNED(x) __attribute__((aligned(x))) |
lypinator | 0:bb348c97df44 | 97 | #endif |
lypinator | 0:bb348c97df44 | 98 | #ifndef __PACKED |
lypinator | 0:bb348c97df44 | 99 | #define __PACKED __attribute__((packed)) |
lypinator | 0:bb348c97df44 | 100 | #endif |
lypinator | 0:bb348c97df44 | 101 | |
lypinator | 0:bb348c97df44 | 102 | |
lypinator | 0:bb348c97df44 | 103 | /* |
lypinator | 0:bb348c97df44 | 104 | * TASKING Compiler |
lypinator | 0:bb348c97df44 | 105 | */ |
lypinator | 0:bb348c97df44 | 106 | #elif defined ( __TASKING__ ) |
lypinator | 0:bb348c97df44 | 107 | /* |
lypinator | 0:bb348c97df44 | 108 | * The CMSIS functions have been implemented as intrinsics in the compiler. |
lypinator | 0:bb348c97df44 | 109 | * Please use "carm -?i" to get an up to date list of all intrinsics, |
lypinator | 0:bb348c97df44 | 110 | * Including the CMSIS ones. |
lypinator | 0:bb348c97df44 | 111 | */ |
lypinator | 0:bb348c97df44 | 112 | |
lypinator | 0:bb348c97df44 | 113 | #ifndef __ASM |
lypinator | 0:bb348c97df44 | 114 | #define __ASM __asm |
lypinator | 0:bb348c97df44 | 115 | #endif |
lypinator | 0:bb348c97df44 | 116 | #ifndef __INLINE |
lypinator | 0:bb348c97df44 | 117 | #define __INLINE inline |
lypinator | 0:bb348c97df44 | 118 | #endif |
lypinator | 0:bb348c97df44 | 119 | #ifndef __STATIC_INLINE |
lypinator | 0:bb348c97df44 | 120 | #define __STATIC_INLINE static inline |
lypinator | 0:bb348c97df44 | 121 | #endif |
lypinator | 0:bb348c97df44 | 122 | #ifndef __STATIC_FORCEINLINE |
lypinator | 0:bb348c97df44 | 123 | #define __STATIC_FORCEINLINE __STATIC_INLINE |
lypinator | 0:bb348c97df44 | 124 | #endif |
lypinator | 0:bb348c97df44 | 125 | #ifndef __NO_RETURN |
lypinator | 0:bb348c97df44 | 126 | #define __NO_RETURN __attribute__((noreturn)) |
lypinator | 0:bb348c97df44 | 127 | #endif |
lypinator | 0:bb348c97df44 | 128 | #ifndef CMSIS_DEPRECATED |
lypinator | 0:bb348c97df44 | 129 | #define CMSIS_DEPRECATED __attribute__((deprecated)) |
lypinator | 0:bb348c97df44 | 130 | #endif |
lypinator | 0:bb348c97df44 | 131 | #ifndef __USED |
lypinator | 0:bb348c97df44 | 132 | #define __USED __attribute__((used)) |
lypinator | 0:bb348c97df44 | 133 | #endif |
lypinator | 0:bb348c97df44 | 134 | #ifndef __WEAK |
lypinator | 0:bb348c97df44 | 135 | #define __WEAK __attribute__((weak)) |
lypinator | 0:bb348c97df44 | 136 | #endif |
lypinator | 0:bb348c97df44 | 137 | #ifndef __UNALIGNED_UINT32 |
lypinator | 0:bb348c97df44 | 138 | struct __packed__ T_UINT32 { uint32_t v; }; |
lypinator | 0:bb348c97df44 | 139 | #define __UNALIGNED_UINT32(x) (((struct T_UINT32 *)(x))->v) |
lypinator | 0:bb348c97df44 | 140 | #endif |
lypinator | 0:bb348c97df44 | 141 | #ifndef __ALIGNED |
lypinator | 0:bb348c97df44 | 142 | #define __ALIGNED(x) __align(x) |
lypinator | 0:bb348c97df44 | 143 | #endif |
lypinator | 0:bb348c97df44 | 144 | #ifndef __PACKED |
lypinator | 0:bb348c97df44 | 145 | #define __PACKED __packed__ |
lypinator | 0:bb348c97df44 | 146 | #endif |
lypinator | 0:bb348c97df44 | 147 | |
lypinator | 0:bb348c97df44 | 148 | |
lypinator | 0:bb348c97df44 | 149 | /* |
lypinator | 0:bb348c97df44 | 150 | * COSMIC Compiler |
lypinator | 0:bb348c97df44 | 151 | */ |
lypinator | 0:bb348c97df44 | 152 | #elif defined ( __CSMC__ ) |
lypinator | 0:bb348c97df44 | 153 | #include <cmsis_csm.h> |
lypinator | 0:bb348c97df44 | 154 | |
lypinator | 0:bb348c97df44 | 155 | #ifndef __ASM |
lypinator | 0:bb348c97df44 | 156 | #define __ASM _asm |
lypinator | 0:bb348c97df44 | 157 | #endif |
lypinator | 0:bb348c97df44 | 158 | #ifndef __INLINE |
lypinator | 0:bb348c97df44 | 159 | #define __INLINE inline |
lypinator | 0:bb348c97df44 | 160 | #endif |
lypinator | 0:bb348c97df44 | 161 | #ifndef __STATIC_INLINE |
lypinator | 0:bb348c97df44 | 162 | #define __STATIC_INLINE static inline |
lypinator | 0:bb348c97df44 | 163 | #endif |
lypinator | 0:bb348c97df44 | 164 | #ifndef __STATIC_FORCEINLINE |
lypinator | 0:bb348c97df44 | 165 | #define __STATIC_FORCEINLINE __STATIC_INLINE |
lypinator | 0:bb348c97df44 | 166 | #endif |
lypinator | 0:bb348c97df44 | 167 | #ifndef __NO_RETURN |
lypinator | 0:bb348c97df44 | 168 | // NO RETURN is automatically detected hence no warning here |
lypinator | 0:bb348c97df44 | 169 | #define __NO_RETURN |
lypinator | 0:bb348c97df44 | 170 | #endif |
lypinator | 0:bb348c97df44 | 171 | #ifndef __USED |
lypinator | 0:bb348c97df44 | 172 | #warning No compiler specific solution for __USED. __USED is ignored. |
lypinator | 0:bb348c97df44 | 173 | #define __USED |
lypinator | 0:bb348c97df44 | 174 | #endif |
lypinator | 0:bb348c97df44 | 175 | #ifndef CMSIS_DEPRECATED |
lypinator | 0:bb348c97df44 | 176 | #warning No compiler specific solution for CMSIS_DEPRECATED. CMSIS_DEPRECATED is ignored. |
lypinator | 0:bb348c97df44 | 177 | #define CMSIS_DEPRECATED |
lypinator | 0:bb348c97df44 | 178 | #endif |
lypinator | 0:bb348c97df44 | 179 | #ifndef __WEAK |
lypinator | 0:bb348c97df44 | 180 | #define __WEAK __weak |
lypinator | 0:bb348c97df44 | 181 | #endif |
lypinator | 0:bb348c97df44 | 182 | #ifndef __UNALIGNED_UINT32 |
lypinator | 0:bb348c97df44 | 183 | @packed struct T_UINT32 { uint32_t v; }; |
lypinator | 0:bb348c97df44 | 184 | #define __UNALIGNED_UINT32(x) (((struct T_UINT32 *)(x))->v) |
lypinator | 0:bb348c97df44 | 185 | #endif |
lypinator | 0:bb348c97df44 | 186 | #ifndef __ALIGNED |
lypinator | 0:bb348c97df44 | 187 | #warning No compiler specific solution for __ALIGNED. __ALIGNED is ignored. |
lypinator | 0:bb348c97df44 | 188 | #define __ALIGNED(x) |
lypinator | 0:bb348c97df44 | 189 | #endif |
lypinator | 0:bb348c97df44 | 190 | #ifndef __PACKED |
lypinator | 0:bb348c97df44 | 191 | #define __PACKED @packed |
lypinator | 0:bb348c97df44 | 192 | #endif |
lypinator | 0:bb348c97df44 | 193 | |
lypinator | 0:bb348c97df44 | 194 | |
lypinator | 0:bb348c97df44 | 195 | #else |
lypinator | 0:bb348c97df44 | 196 | #error Unknown compiler. |
lypinator | 0:bb348c97df44 | 197 | #endif |
lypinator | 0:bb348c97df44 | 198 | |
lypinator | 0:bb348c97df44 | 199 | |
lypinator | 0:bb348c97df44 | 200 | #endif /* __CMSIS_COMPILER_H */ |
lypinator | 0:bb348c97df44 | 201 |