The official Mbed 2 C/C++ SDK provides the software platform and libraries to build your applications.
Dependents: hello SerialTestv11 SerialTestv12 Sierpinski ... more
mbed 2
This is the mbed 2 library. If you'd like to learn about Mbed OS please see the mbed-os docs.
TARGET_SAKURAIO_EVB_01/cmsis_compiler.h@159:7130f322cb7e, 2017-12-21 (annotated)
- Committer:
- mbed_official
- Date:
- Thu Dec 21 18:20:02 2017 +0000
- Revision:
- 159:7130f322cb7e
mbed library version 157
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
mbed_official | 159:7130f322cb7e | 1 | /**************************************************************************//** |
mbed_official | 159:7130f322cb7e | 2 | * @file cmsis_compiler.h |
mbed_official | 159:7130f322cb7e | 3 | * @brief CMSIS compiler generic header file |
mbed_official | 159:7130f322cb7e | 4 | * @version V5.0.2 |
mbed_official | 159:7130f322cb7e | 5 | * @date 13. February 2017 |
mbed_official | 159:7130f322cb7e | 6 | ******************************************************************************/ |
mbed_official | 159:7130f322cb7e | 7 | /* |
mbed_official | 159:7130f322cb7e | 8 | * Copyright (c) 2009-2017 ARM Limited. All rights reserved. |
mbed_official | 159:7130f322cb7e | 9 | * |
mbed_official | 159:7130f322cb7e | 10 | * SPDX-License-Identifier: Apache-2.0 |
mbed_official | 159:7130f322cb7e | 11 | * |
mbed_official | 159:7130f322cb7e | 12 | * Licensed under the Apache License, Version 2.0 (the License); you may |
mbed_official | 159:7130f322cb7e | 13 | * not use this file except in compliance with the License. |
mbed_official | 159:7130f322cb7e | 14 | * You may obtain a copy of the License at |
mbed_official | 159:7130f322cb7e | 15 | * |
mbed_official | 159:7130f322cb7e | 16 | * www.apache.org/licenses/LICENSE-2.0 |
mbed_official | 159:7130f322cb7e | 17 | * |
mbed_official | 159:7130f322cb7e | 18 | * Unless required by applicable law or agreed to in writing, software |
mbed_official | 159:7130f322cb7e | 19 | * distributed under the License is distributed on an AS IS BASIS, WITHOUT |
mbed_official | 159:7130f322cb7e | 20 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
mbed_official | 159:7130f322cb7e | 21 | * See the License for the specific language governing permissions and |
mbed_official | 159:7130f322cb7e | 22 | * limitations under the License. |
mbed_official | 159:7130f322cb7e | 23 | */ |
mbed_official | 159:7130f322cb7e | 24 | |
mbed_official | 159:7130f322cb7e | 25 | #ifndef __CMSIS_COMPILER_H |
mbed_official | 159:7130f322cb7e | 26 | #define __CMSIS_COMPILER_H |
mbed_official | 159:7130f322cb7e | 27 | |
mbed_official | 159:7130f322cb7e | 28 | #include <stdint.h> |
mbed_official | 159:7130f322cb7e | 29 | |
mbed_official | 159:7130f322cb7e | 30 | /* |
mbed_official | 159:7130f322cb7e | 31 | * ARM Compiler 4/5 |
mbed_official | 159:7130f322cb7e | 32 | */ |
mbed_official | 159:7130f322cb7e | 33 | #if defined ( __CC_ARM ) |
mbed_official | 159:7130f322cb7e | 34 | #include "cmsis_armcc.h" |
mbed_official | 159:7130f322cb7e | 35 | |
mbed_official | 159:7130f322cb7e | 36 | |
mbed_official | 159:7130f322cb7e | 37 | /* |
mbed_official | 159:7130f322cb7e | 38 | * ARM Compiler 6 (armclang) |
mbed_official | 159:7130f322cb7e | 39 | */ |
mbed_official | 159:7130f322cb7e | 40 | #elif defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) |
mbed_official | 159:7130f322cb7e | 41 | #include "cmsis_armclang.h" |
mbed_official | 159:7130f322cb7e | 42 | |
mbed_official | 159:7130f322cb7e | 43 | |
mbed_official | 159:7130f322cb7e | 44 | /* |
mbed_official | 159:7130f322cb7e | 45 | * GNU Compiler |
mbed_official | 159:7130f322cb7e | 46 | */ |
mbed_official | 159:7130f322cb7e | 47 | #elif defined ( __GNUC__ ) |
mbed_official | 159:7130f322cb7e | 48 | #include "cmsis_gcc.h" |
mbed_official | 159:7130f322cb7e | 49 | |
mbed_official | 159:7130f322cb7e | 50 | |
mbed_official | 159:7130f322cb7e | 51 | /* |
mbed_official | 159:7130f322cb7e | 52 | * IAR Compiler |
mbed_official | 159:7130f322cb7e | 53 | */ |
mbed_official | 159:7130f322cb7e | 54 | #elif defined ( __ICCARM__ ) |
mbed_official | 159:7130f322cb7e | 55 | |
mbed_official | 159:7130f322cb7e | 56 | #ifndef __ASM |
mbed_official | 159:7130f322cb7e | 57 | #define __ASM __asm |
mbed_official | 159:7130f322cb7e | 58 | #endif |
mbed_official | 159:7130f322cb7e | 59 | #ifndef __INLINE |
mbed_official | 159:7130f322cb7e | 60 | #define __INLINE inline |
mbed_official | 159:7130f322cb7e | 61 | #endif |
mbed_official | 159:7130f322cb7e | 62 | #ifndef __STATIC_INLINE |
mbed_official | 159:7130f322cb7e | 63 | #define __STATIC_INLINE static inline |
mbed_official | 159:7130f322cb7e | 64 | #endif |
mbed_official | 159:7130f322cb7e | 65 | |
mbed_official | 159:7130f322cb7e | 66 | #include <cmsis_iar.h> |
mbed_official | 159:7130f322cb7e | 67 | |
mbed_official | 159:7130f322cb7e | 68 | /* CMSIS compiler control architecture macros */ |
mbed_official | 159:7130f322cb7e | 69 | #if (__CORE__ == __ARM6M__) || (__CORE__ == __ARM6SM__) |
mbed_official | 159:7130f322cb7e | 70 | #ifndef __ARM_ARCH_6M__ |
mbed_official | 159:7130f322cb7e | 71 | #define __ARM_ARCH_6M__ 1 |
mbed_official | 159:7130f322cb7e | 72 | #endif |
mbed_official | 159:7130f322cb7e | 73 | #elif (__CORE__ == __ARM7M__) |
mbed_official | 159:7130f322cb7e | 74 | #ifndef __ARM_ARCH_7M__ |
mbed_official | 159:7130f322cb7e | 75 | #define __ARM_ARCH_7M__ 1 |
mbed_official | 159:7130f322cb7e | 76 | #endif |
mbed_official | 159:7130f322cb7e | 77 | #elif (__CORE__ == __ARM7EM__) |
mbed_official | 159:7130f322cb7e | 78 | #ifndef __ARM_ARCH_7EM__ |
mbed_official | 159:7130f322cb7e | 79 | #define __ARM_ARCH_7EM__ 1 |
mbed_official | 159:7130f322cb7e | 80 | #endif |
mbed_official | 159:7130f322cb7e | 81 | #elif (__CORE__ == __ARM8M_BASELINE__) |
mbed_official | 159:7130f322cb7e | 82 | #ifndef __ARM_ARCH_8M_BASE__ |
mbed_official | 159:7130f322cb7e | 83 | #define __ARM_ARCH_8M_BASE__ 1 |
mbed_official | 159:7130f322cb7e | 84 | #endif |
mbed_official | 159:7130f322cb7e | 85 | #elif (__CORE__ == __ARM8M_MAINLINE__) |
mbed_official | 159:7130f322cb7e | 86 | #ifndef __ARM_ARCH_8M_MAIN__ |
mbed_official | 159:7130f322cb7e | 87 | #define __ARM_ARCH_8M_MAIN__ 1 |
mbed_official | 159:7130f322cb7e | 88 | #endif |
mbed_official | 159:7130f322cb7e | 89 | #endif |
mbed_official | 159:7130f322cb7e | 90 | |
mbed_official | 159:7130f322cb7e | 91 | // IAR version 7.8.1 and earlier do not include __ALIGNED |
mbed_official | 159:7130f322cb7e | 92 | #ifndef __ALIGNED |
mbed_official | 159:7130f322cb7e | 93 | #define __ALIGNED(x) __attribute__((aligned(x))) |
mbed_official | 159:7130f322cb7e | 94 | #endif |
mbed_official | 159:7130f322cb7e | 95 | |
mbed_official | 159:7130f322cb7e | 96 | #ifndef __NO_RETURN |
mbed_official | 159:7130f322cb7e | 97 | #define __NO_RETURN __noreturn |
mbed_official | 159:7130f322cb7e | 98 | #endif |
mbed_official | 159:7130f322cb7e | 99 | #ifndef __USED |
mbed_official | 159:7130f322cb7e | 100 | #define __USED __root |
mbed_official | 159:7130f322cb7e | 101 | #endif |
mbed_official | 159:7130f322cb7e | 102 | #ifndef __WEAK |
mbed_official | 159:7130f322cb7e | 103 | #define __WEAK __weak |
mbed_official | 159:7130f322cb7e | 104 | #endif |
mbed_official | 159:7130f322cb7e | 105 | #ifndef __PACKED |
mbed_official | 159:7130f322cb7e | 106 | #define __PACKED __packed |
mbed_official | 159:7130f322cb7e | 107 | #endif |
mbed_official | 159:7130f322cb7e | 108 | #ifndef __PACKED_STRUCT |
mbed_official | 159:7130f322cb7e | 109 | #define __PACKED_STRUCT __packed struct |
mbed_official | 159:7130f322cb7e | 110 | #endif |
mbed_official | 159:7130f322cb7e | 111 | #ifndef __UNALIGNED_UINT32 /* deprecated */ |
mbed_official | 159:7130f322cb7e | 112 | __packed struct T_UINT32 { uint32_t v; }; |
mbed_official | 159:7130f322cb7e | 113 | #define __UNALIGNED_UINT32(x) (((struct T_UINT32 *)(x))->v) |
mbed_official | 159:7130f322cb7e | 114 | #endif |
mbed_official | 159:7130f322cb7e | 115 | #ifndef __UNALIGNED_UINT16_WRITE |
mbed_official | 159:7130f322cb7e | 116 | __PACKED_STRUCT T_UINT16_WRITE { uint16_t v; }; |
mbed_official | 159:7130f322cb7e | 117 | #define __UNALIGNED_UINT16_WRITE(addr, val) (void)((((struct T_UINT16_WRITE *)(void *)(addr))->v) = (val)) |
mbed_official | 159:7130f322cb7e | 118 | #endif |
mbed_official | 159:7130f322cb7e | 119 | #ifndef __UNALIGNED_UINT16_READ |
mbed_official | 159:7130f322cb7e | 120 | __PACKED_STRUCT T_UINT16_READ { uint16_t v; }; |
mbed_official | 159:7130f322cb7e | 121 | #define __UNALIGNED_UINT16_READ(addr) (((const struct T_UINT16_READ *)(const void *)(addr))->v) |
mbed_official | 159:7130f322cb7e | 122 | #endif |
mbed_official | 159:7130f322cb7e | 123 | #ifndef __UNALIGNED_UINT32_WRITE |
mbed_official | 159:7130f322cb7e | 124 | __PACKED_STRUCT T_UINT32_WRITE { uint32_t v; }; |
mbed_official | 159:7130f322cb7e | 125 | #define __UNALIGNED_UINT32_WRITE(addr, val) (void)((((struct T_UINT32_WRITE *)(void *)(addr))->v) = (val)) |
mbed_official | 159:7130f322cb7e | 126 | #endif |
mbed_official | 159:7130f322cb7e | 127 | #ifndef __UNALIGNED_UINT32_READ |
mbed_official | 159:7130f322cb7e | 128 | __PACKED_STRUCT T_UINT32_READ { uint32_t v; }; |
mbed_official | 159:7130f322cb7e | 129 | #define __UNALIGNED_UINT32_READ(addr) (((const struct T_UINT32_READ *)(const void *)(addr))->v) |
mbed_official | 159:7130f322cb7e | 130 | #endif |
mbed_official | 159:7130f322cb7e | 131 | #ifndef __ALIGNED |
mbed_official | 159:7130f322cb7e | 132 | #warning No compiler specific solution for __ALIGNED. __ALIGNED is ignored. |
mbed_official | 159:7130f322cb7e | 133 | #define __ALIGNED(x) |
mbed_official | 159:7130f322cb7e | 134 | #endif |
mbed_official | 159:7130f322cb7e | 135 | |
mbed_official | 159:7130f322cb7e | 136 | |
mbed_official | 159:7130f322cb7e | 137 | /* |
mbed_official | 159:7130f322cb7e | 138 | * TI ARM Compiler |
mbed_official | 159:7130f322cb7e | 139 | */ |
mbed_official | 159:7130f322cb7e | 140 | #elif defined ( __TI_ARM__ ) |
mbed_official | 159:7130f322cb7e | 141 | #include <cmsis_ccs.h> |
mbed_official | 159:7130f322cb7e | 142 | |
mbed_official | 159:7130f322cb7e | 143 | #ifndef __ASM |
mbed_official | 159:7130f322cb7e | 144 | #define __ASM __asm |
mbed_official | 159:7130f322cb7e | 145 | #endif |
mbed_official | 159:7130f322cb7e | 146 | #ifndef __INLINE |
mbed_official | 159:7130f322cb7e | 147 | #define __INLINE inline |
mbed_official | 159:7130f322cb7e | 148 | #endif |
mbed_official | 159:7130f322cb7e | 149 | #ifndef __STATIC_INLINE |
mbed_official | 159:7130f322cb7e | 150 | #define __STATIC_INLINE static inline |
mbed_official | 159:7130f322cb7e | 151 | #endif |
mbed_official | 159:7130f322cb7e | 152 | #ifndef __NO_RETURN |
mbed_official | 159:7130f322cb7e | 153 | #define __NO_RETURN __attribute__((noreturn)) |
mbed_official | 159:7130f322cb7e | 154 | #endif |
mbed_official | 159:7130f322cb7e | 155 | #ifndef __USED |
mbed_official | 159:7130f322cb7e | 156 | #define __USED __attribute__((used)) |
mbed_official | 159:7130f322cb7e | 157 | #endif |
mbed_official | 159:7130f322cb7e | 158 | #ifndef __WEAK |
mbed_official | 159:7130f322cb7e | 159 | #define __WEAK __attribute__((weak)) |
mbed_official | 159:7130f322cb7e | 160 | #endif |
mbed_official | 159:7130f322cb7e | 161 | #ifndef __PACKED |
mbed_official | 159:7130f322cb7e | 162 | #define __PACKED __attribute__((packed)) |
mbed_official | 159:7130f322cb7e | 163 | #endif |
mbed_official | 159:7130f322cb7e | 164 | #ifndef __PACKED_STRUCT |
mbed_official | 159:7130f322cb7e | 165 | #define __PACKED_STRUCT struct __attribute__((packed)) |
mbed_official | 159:7130f322cb7e | 166 | #endif |
mbed_official | 159:7130f322cb7e | 167 | #ifndef __UNALIGNED_UINT32 /* deprecated */ |
mbed_official | 159:7130f322cb7e | 168 | struct __attribute__((packed)) T_UINT32 { uint32_t v; }; |
mbed_official | 159:7130f322cb7e | 169 | #define __UNALIGNED_UINT32(x) (((struct T_UINT32 *)(x))->v) |
mbed_official | 159:7130f322cb7e | 170 | #endif |
mbed_official | 159:7130f322cb7e | 171 | #ifndef __UNALIGNED_UINT16_WRITE |
mbed_official | 159:7130f322cb7e | 172 | __PACKED_STRUCT T_UINT16_WRITE { uint16_t v; }; |
mbed_official | 159:7130f322cb7e | 173 | #define __UNALIGNED_UINT16_WRITE(addr, val) (void)((((struct T_UINT16_WRITE *)(void*)(addr))->v) = (val)) |
mbed_official | 159:7130f322cb7e | 174 | #endif |
mbed_official | 159:7130f322cb7e | 175 | #ifndef __UNALIGNED_UINT16_READ |
mbed_official | 159:7130f322cb7e | 176 | __PACKED_STRUCT T_UINT16_READ { uint16_t v; }; |
mbed_official | 159:7130f322cb7e | 177 | #define __UNALIGNED_UINT16_READ(addr) (((const struct T_UINT16_READ *)(const void *)(addr))->v) |
mbed_official | 159:7130f322cb7e | 178 | #endif |
mbed_official | 159:7130f322cb7e | 179 | #ifndef __UNALIGNED_UINT32_WRITE |
mbed_official | 159:7130f322cb7e | 180 | __PACKED_STRUCT T_UINT32_WRITE { uint32_t v; }; |
mbed_official | 159:7130f322cb7e | 181 | #define __UNALIGNED_UINT32_WRITE(addr, val) (void)((((struct T_UINT32_WRITE *)(void *)(addr))->v) = (val)) |
mbed_official | 159:7130f322cb7e | 182 | #endif |
mbed_official | 159:7130f322cb7e | 183 | #ifndef __UNALIGNED_UINT32_READ |
mbed_official | 159:7130f322cb7e | 184 | __PACKED_STRUCT T_UINT32_READ { uint32_t v; }; |
mbed_official | 159:7130f322cb7e | 185 | #define __UNALIGNED_UINT32_READ(addr) (((const struct T_UINT32_READ *)(const void *)(addr))->v) |
mbed_official | 159:7130f322cb7e | 186 | #endif |
mbed_official | 159:7130f322cb7e | 187 | #ifndef __ALIGNED |
mbed_official | 159:7130f322cb7e | 188 | #define __ALIGNED(x) __attribute__((aligned(x))) |
mbed_official | 159:7130f322cb7e | 189 | #endif |
mbed_official | 159:7130f322cb7e | 190 | |
mbed_official | 159:7130f322cb7e | 191 | |
mbed_official | 159:7130f322cb7e | 192 | /* |
mbed_official | 159:7130f322cb7e | 193 | * TASKING Compiler |
mbed_official | 159:7130f322cb7e | 194 | */ |
mbed_official | 159:7130f322cb7e | 195 | #elif defined ( __TASKING__ ) |
mbed_official | 159:7130f322cb7e | 196 | /* |
mbed_official | 159:7130f322cb7e | 197 | * The CMSIS functions have been implemented as intrinsics in the compiler. |
mbed_official | 159:7130f322cb7e | 198 | * Please use "carm -?i" to get an up to date list of all intrinsics, |
mbed_official | 159:7130f322cb7e | 199 | * Including the CMSIS ones. |
mbed_official | 159:7130f322cb7e | 200 | */ |
mbed_official | 159:7130f322cb7e | 201 | |
mbed_official | 159:7130f322cb7e | 202 | #ifndef __ASM |
mbed_official | 159:7130f322cb7e | 203 | #define __ASM __asm |
mbed_official | 159:7130f322cb7e | 204 | #endif |
mbed_official | 159:7130f322cb7e | 205 | #ifndef __INLINE |
mbed_official | 159:7130f322cb7e | 206 | #define __INLINE inline |
mbed_official | 159:7130f322cb7e | 207 | #endif |
mbed_official | 159:7130f322cb7e | 208 | #ifndef __STATIC_INLINE |
mbed_official | 159:7130f322cb7e | 209 | #define __STATIC_INLINE static inline |
mbed_official | 159:7130f322cb7e | 210 | #endif |
mbed_official | 159:7130f322cb7e | 211 | #ifndef __NO_RETURN |
mbed_official | 159:7130f322cb7e | 212 | #define __NO_RETURN __attribute__((noreturn)) |
mbed_official | 159:7130f322cb7e | 213 | #endif |
mbed_official | 159:7130f322cb7e | 214 | #ifndef __USED |
mbed_official | 159:7130f322cb7e | 215 | #define __USED __attribute__((used)) |
mbed_official | 159:7130f322cb7e | 216 | #endif |
mbed_official | 159:7130f322cb7e | 217 | #ifndef __WEAK |
mbed_official | 159:7130f322cb7e | 218 | #define __WEAK __attribute__((weak)) |
mbed_official | 159:7130f322cb7e | 219 | #endif |
mbed_official | 159:7130f322cb7e | 220 | #ifndef __PACKED |
mbed_official | 159:7130f322cb7e | 221 | #define __PACKED __packed__ |
mbed_official | 159:7130f322cb7e | 222 | #endif |
mbed_official | 159:7130f322cb7e | 223 | #ifndef __PACKED_STRUCT |
mbed_official | 159:7130f322cb7e | 224 | #define __PACKED_STRUCT struct __packed__ |
mbed_official | 159:7130f322cb7e | 225 | #endif |
mbed_official | 159:7130f322cb7e | 226 | #ifndef __UNALIGNED_UINT32 /* deprecated */ |
mbed_official | 159:7130f322cb7e | 227 | struct __packed__ T_UINT32 { uint32_t v; }; |
mbed_official | 159:7130f322cb7e | 228 | #define __UNALIGNED_UINT32(x) (((struct T_UINT32 *)(x))->v) |
mbed_official | 159:7130f322cb7e | 229 | #endif |
mbed_official | 159:7130f322cb7e | 230 | #ifndef __UNALIGNED_UINT16_WRITE |
mbed_official | 159:7130f322cb7e | 231 | __PACKED_STRUCT T_UINT16_WRITE { uint16_t v; }; |
mbed_official | 159:7130f322cb7e | 232 | #define __UNALIGNED_UINT16_WRITE(addr, val) (void)((((struct T_UINT16_WRITE *)(void *)(addr))->v) = (val)) |
mbed_official | 159:7130f322cb7e | 233 | #endif |
mbed_official | 159:7130f322cb7e | 234 | #ifndef __UNALIGNED_UINT16_READ |
mbed_official | 159:7130f322cb7e | 235 | __PACKED_STRUCT T_UINT16_READ { uint16_t v; }; |
mbed_official | 159:7130f322cb7e | 236 | #define __UNALIGNED_UINT16_READ(addr) (((const struct T_UINT16_READ *)(const void *)(addr))->v) |
mbed_official | 159:7130f322cb7e | 237 | #endif |
mbed_official | 159:7130f322cb7e | 238 | #ifndef __UNALIGNED_UINT32_WRITE |
mbed_official | 159:7130f322cb7e | 239 | __PACKED_STRUCT T_UINT32_WRITE { uint32_t v; }; |
mbed_official | 159:7130f322cb7e | 240 | #define __UNALIGNED_UINT32_WRITE(addr, val) (void)((((struct T_UINT32_WRITE *)(void *)(addr))->v) = (val)) |
mbed_official | 159:7130f322cb7e | 241 | #endif |
mbed_official | 159:7130f322cb7e | 242 | #ifndef __UNALIGNED_UINT32_READ |
mbed_official | 159:7130f322cb7e | 243 | __PACKED_STRUCT T_UINT32_READ { uint32_t v; }; |
mbed_official | 159:7130f322cb7e | 244 | #define __UNALIGNED_UINT32_READ(addr) (((const struct T_UINT32_READ *)(const void *)(addr))->v) |
mbed_official | 159:7130f322cb7e | 245 | #endif |
mbed_official | 159:7130f322cb7e | 246 | #ifndef __ALIGNED |
mbed_official | 159:7130f322cb7e | 247 | #define __ALIGNED(x) __align(x) |
mbed_official | 159:7130f322cb7e | 248 | #endif |
mbed_official | 159:7130f322cb7e | 249 | |
mbed_official | 159:7130f322cb7e | 250 | |
mbed_official | 159:7130f322cb7e | 251 | /* |
mbed_official | 159:7130f322cb7e | 252 | * COSMIC Compiler |
mbed_official | 159:7130f322cb7e | 253 | */ |
mbed_official | 159:7130f322cb7e | 254 | #elif defined ( __CSMC__ ) |
mbed_official | 159:7130f322cb7e | 255 | #include <cmsis_csm.h> |
mbed_official | 159:7130f322cb7e | 256 | |
mbed_official | 159:7130f322cb7e | 257 | #ifndef __ASM |
mbed_official | 159:7130f322cb7e | 258 | #define __ASM _asm |
mbed_official | 159:7130f322cb7e | 259 | #endif |
mbed_official | 159:7130f322cb7e | 260 | #ifndef __INLINE |
mbed_official | 159:7130f322cb7e | 261 | #define __INLINE inline |
mbed_official | 159:7130f322cb7e | 262 | #endif |
mbed_official | 159:7130f322cb7e | 263 | #ifndef __STATIC_INLINE |
mbed_official | 159:7130f322cb7e | 264 | #define __STATIC_INLINE static inline |
mbed_official | 159:7130f322cb7e | 265 | #endif |
mbed_official | 159:7130f322cb7e | 266 | #ifndef __NO_RETURN |
mbed_official | 159:7130f322cb7e | 267 | // NO RETURN is automatically detected hence no warning here |
mbed_official | 159:7130f322cb7e | 268 | #define __NO_RETURN |
mbed_official | 159:7130f322cb7e | 269 | #endif |
mbed_official | 159:7130f322cb7e | 270 | #ifndef __USED |
mbed_official | 159:7130f322cb7e | 271 | #warning No compiler specific solution for __USED. __USED is ignored. |
mbed_official | 159:7130f322cb7e | 272 | #define __USED |
mbed_official | 159:7130f322cb7e | 273 | #endif |
mbed_official | 159:7130f322cb7e | 274 | #ifndef __WEAK |
mbed_official | 159:7130f322cb7e | 275 | #define __WEAK __weak |
mbed_official | 159:7130f322cb7e | 276 | #endif |
mbed_official | 159:7130f322cb7e | 277 | #ifndef __PACKED |
mbed_official | 159:7130f322cb7e | 278 | #define __PACKED @packed |
mbed_official | 159:7130f322cb7e | 279 | #endif |
mbed_official | 159:7130f322cb7e | 280 | #ifndef __PACKED_STRUCT |
mbed_official | 159:7130f322cb7e | 281 | #define __PACKED_STRUCT @packed struct |
mbed_official | 159:7130f322cb7e | 282 | #endif |
mbed_official | 159:7130f322cb7e | 283 | #ifndef __UNALIGNED_UINT32 /* deprecated */ |
mbed_official | 159:7130f322cb7e | 284 | @packed struct T_UINT32 { uint32_t v; }; |
mbed_official | 159:7130f322cb7e | 285 | #define __UNALIGNED_UINT32(x) (((struct T_UINT32 *)(x))->v) |
mbed_official | 159:7130f322cb7e | 286 | #endif |
mbed_official | 159:7130f322cb7e | 287 | #ifndef __UNALIGNED_UINT16_WRITE |
mbed_official | 159:7130f322cb7e | 288 | __PACKED_STRUCT T_UINT16_WRITE { uint16_t v; }; |
mbed_official | 159:7130f322cb7e | 289 | #define __UNALIGNED_UINT16_WRITE(addr, val) (void)((((struct T_UINT16_WRITE *)(void *)(addr))->v) = (val)) |
mbed_official | 159:7130f322cb7e | 290 | #endif |
mbed_official | 159:7130f322cb7e | 291 | #ifndef __UNALIGNED_UINT16_READ |
mbed_official | 159:7130f322cb7e | 292 | __PACKED_STRUCT T_UINT16_READ { uint16_t v; }; |
mbed_official | 159:7130f322cb7e | 293 | #define __UNALIGNED_UINT16_READ(addr) (((const struct T_UINT16_READ *)(const void *)(addr))->v) |
mbed_official | 159:7130f322cb7e | 294 | #endif |
mbed_official | 159:7130f322cb7e | 295 | #ifndef __UNALIGNED_UINT32_WRITE |
mbed_official | 159:7130f322cb7e | 296 | __PACKED_STRUCT T_UINT32_WRITE { uint32_t v; }; |
mbed_official | 159:7130f322cb7e | 297 | #define __UNALIGNED_UINT32_WRITE(addr, val) (void)((((struct T_UINT32_WRITE *)(void *)(addr))->v) = (val)) |
mbed_official | 159:7130f322cb7e | 298 | #endif |
mbed_official | 159:7130f322cb7e | 299 | #ifndef __UNALIGNED_UINT32_READ |
mbed_official | 159:7130f322cb7e | 300 | __PACKED_STRUCT T_UINT32_READ { uint32_t v; }; |
mbed_official | 159:7130f322cb7e | 301 | #define __UNALIGNED_UINT32_READ(addr) (((const struct T_UINT32_READ *)(const void *)(addr))->v) |
mbed_official | 159:7130f322cb7e | 302 | #endif |
mbed_official | 159:7130f322cb7e | 303 | #ifndef __ALIGNED |
mbed_official | 159:7130f322cb7e | 304 | #warning No compiler specific solution for __ALIGNED. __ALIGNED is ignored. |
mbed_official | 159:7130f322cb7e | 305 | #define __ALIGNED(x) |
mbed_official | 159:7130f322cb7e | 306 | #endif |
mbed_official | 159:7130f322cb7e | 307 | |
mbed_official | 159:7130f322cb7e | 308 | |
mbed_official | 159:7130f322cb7e | 309 | #else |
mbed_official | 159:7130f322cb7e | 310 | #error Unknown compiler. |
mbed_official | 159:7130f322cb7e | 311 | #endif |
mbed_official | 159:7130f322cb7e | 312 | |
mbed_official | 159:7130f322cb7e | 313 | |
mbed_official | 159:7130f322cb7e | 314 | #endif /* __CMSIS_COMPILER_H */ |
mbed_official | 159:7130f322cb7e | 315 |