diff --git a/CMSIS/Core/Include/cmsis_armcc.h b/CMSIS/Core/Include/cmsis_armcc.h index 548250bfae..21dc8a4c23 100644 --- a/CMSIS/Core/Include/cmsis_armcc.h +++ b/CMSIS/Core/Include/cmsis_armcc.h @@ -1,8 +1,8 @@ /**************************************************************************//** * @file cmsis_armcc.h * @brief CMSIS compiler ARMCC (Arm Compiler 5) header file - * @version V5.1.1 - * @date 30. July 2019 + * @version V5.2.0 + * @date 19. December 2019 ******************************************************************************/ /* * Copyright (c) 2009-2019 Arm Limited. All rights reserved. @@ -98,6 +98,12 @@ #ifndef __UNALIGNED_UINT32_READ #define __UNALIGNED_UINT32_READ(addr) (*((const __packed uint32_t *)(addr))) #endif +#ifndef __UNALIGNED_UINT64_WRITE + #define __UNALIGNED_UINT64_WRITE(addr, val) ((*((__packed uint64_t *)(addr))) = (val)) +#endif +#ifndef __UNALIGNED_UINT64_READ + #define __UNALIGNED_UINT64_READ(addr) (*((const __packed uint64_t *)(addr))) +#endif #ifndef __ALIGNED #define __ALIGNED(x) __attribute__((aligned(x))) #endif diff --git a/CMSIS/Core/Include/cmsis_armclang.h b/CMSIS/Core/Include/cmsis_armclang.h index f037dfe05b..1618be3c78 100644 --- a/CMSIS/Core/Include/cmsis_armclang.h +++ b/CMSIS/Core/Include/cmsis_armclang.h @@ -1,8 +1,8 @@ /**************************************************************************//** * @file cmsis_armclang.h * @brief CMSIS compiler armclang (Arm Compiler 6) header file - * @version V5.2.1 - * @date 30. July 2019 + * @version V5.3.0 + * @date 19. December 2019 ******************************************************************************/ /* * Copyright (c) 2009-2019 Arm Limited. All rights reserved. @@ -104,6 +104,22 @@ #pragma clang diagnostic pop #define __UNALIGNED_UINT32_READ(addr) (((const struct T_UINT32_READ *)(const void *)(addr))->v) #endif +#ifndef __UNALIGNED_UINT64_WRITE + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wpacked" +/*lint -esym(9058, T_UINT64_WRITE)*/ /* disable MISRA 2012 Rule 2.4 for T_UINT64_WRITE */ + __PACKED_STRUCT T_UINT64_WRITE { uint64_t v; }; + #pragma clang diagnostic pop + #define __UNALIGNED_UINT64_WRITE(addr, val) (void)((((struct T_UINT64_WRITE *)(void *)(addr))->v) = (val)) +#endif +#ifndef __UNALIGNED_UINT64_READ + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wpacked" +/*lint -esym(9058, T_UINT64_READ)*/ /* disable MISRA 2012 Rule 2.4 for T_UINT64_READ */ + __PACKED_STRUCT T_UINT64_READ { uint64_t v; }; + #pragma clang diagnostic pop + #define __UNALIGNED_UINT64_READ(addr) (((const struct T_UINT64_READ *)(const void *)(addr))->v) +#endif #ifndef __ALIGNED #define __ALIGNED(x) __attribute__((aligned(x))) #endif diff --git a/CMSIS/Core/Include/cmsis_armclang_ltm.h b/CMSIS/Core/Include/cmsis_armclang_ltm.h index d9f8b8b541..dea59007e1 100644 --- a/CMSIS/Core/Include/cmsis_armclang_ltm.h +++ b/CMSIS/Core/Include/cmsis_armclang_ltm.h @@ -1,8 +1,8 @@ /**************************************************************************//** * @file cmsis_armclang_ltm.h * @brief CMSIS compiler armclang (Arm Compiler 6) header file - * @version V1.2.1 - * @date 30. July 2019 + * @version V1.3.0 + * @date 19. December 2019 ******************************************************************************/ /* * Copyright (c) 2018-2019 Arm Limited. All rights reserved. @@ -104,6 +104,22 @@ #pragma clang diagnostic pop #define __UNALIGNED_UINT32_READ(addr) (((const struct T_UINT32_READ *)(const void *)(addr))->v) #endif +#ifndef __UNALIGNED_UINT64_WRITE + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wpacked" +/*lint -esym(9058, T_UINT64_WRITE)*/ /* disable MISRA 2012 Rule 2.4 for T_UINT64_WRITE */ + __PACKED_STRUCT T_UINT64_WRITE { uint64_t v; }; + #pragma clang diagnostic pop + #define __UNALIGNED_UINT64_WRITE(addr, val) (void)((((struct T_UINT64_WRITE *)(void *)(addr))->v) = (val)) +#endif +#ifndef __UNALIGNED_UINT64_READ + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wpacked" +/*lint -esym(9058, T_UINT64_READ)*/ /* disable MISRA 2012 Rule 2.4 for T_UINT64_READ */ + __PACKED_STRUCT T_UINT64_READ { uint64_t v; }; + #pragma clang diagnostic pop + #define __UNALIGNED_UINT64_READ(addr) (((const struct T_UINT64_READ *)(const void *)(addr))->v) +#endif #ifndef __ALIGNED #define __ALIGNED(x) __attribute__((aligned(x))) #endif diff --git a/CMSIS/Core/Include/cmsis_compiler.h b/CMSIS/Core/Include/cmsis_compiler.h index adbf296f15..97047b58ba 100644 --- a/CMSIS/Core/Include/cmsis_compiler.h +++ b/CMSIS/Core/Include/cmsis_compiler.h @@ -1,8 +1,8 @@ /**************************************************************************//** * @file cmsis_compiler.h * @brief CMSIS compiler generic header file - * @version V5.1.0 - * @date 09. October 2018 + * @version V5.2.0 + * @date 19. December 2019 ******************************************************************************/ /* * Copyright (c) 2009-2018 Arm Limited. All rights reserved. @@ -117,6 +117,14 @@ __PACKED_STRUCT T_UINT32_READ { uint32_t v; }; #define __UNALIGNED_UINT32_READ(addr) (((const struct T_UINT32_READ *)(const void *)(addr))->v) #endif + #ifndef __UNALIGNED_UINT64_WRITE + __PACKED_STRUCT T_UINT64_WRITE { uint64_t v; }; + #define __UNALIGNED_UINT64_WRITE(addr, val) (void)((((struct T_UINT64_WRITE *)(void *)(addr))->v) = (val)) + #endif + #ifndef __UNALIGNED_UINT64_READ + __PACKED_STRUCT T_UINT64_READ { uint64_t v; }; + #define __UNALIGNED_UINT64_READ(addr) (((const struct T_UINT64_READ *)(const void *)(addr))->v) + #endif #ifndef __ALIGNED #define __ALIGNED(x) __attribute__((aligned(x))) #endif @@ -189,6 +197,14 @@ __PACKED_STRUCT T_UINT32_READ { uint32_t v; }; #define __UNALIGNED_UINT32_READ(addr) (((const struct T_UINT32_READ *)(const void *)(addr))->v) #endif + #ifndef __UNALIGNED_UINT64_WRITE + __PACKED_STRUCT T_UINT64_WRITE { uint64_t v; }; + #define __UNALIGNED_UINT64_WRITE(addr, val) (void)((((struct T_UINT64_WRITE *)(void *)(addr))->v) = (val)) + #endif + #ifndef __UNALIGNED_UINT64_READ + __PACKED_STRUCT T_UINT64_READ { uint64_t v; }; + #define __UNALIGNED_UINT64_READ(addr) (((const struct T_UINT64_READ *)(const void *)(addr))->v) + #endif #ifndef __ALIGNED #define __ALIGNED(x) __align(x) #endif @@ -260,6 +276,14 @@ __PACKED_STRUCT T_UINT32_READ { uint32_t v; }; #define __UNALIGNED_UINT32_READ(addr) (((const struct T_UINT32_READ *)(const void *)(addr))->v) #endif + #ifndef __UNALIGNED_UINT64_WRITE + __PACKED_STRUCT T_UINT64_WRITE { uint64_t v; }; + #define __UNALIGNED_UINT64_WRITE(addr, val) (void)((((struct T_UINT64_WRITE *)(void *)(addr))->v) = (val)) + #endif + #ifndef __UNALIGNED_UINT64_READ + __PACKED_STRUCT T_UINT64_READ { uint64_t v; }; + #define __UNALIGNED_UINT64_READ(addr) (((const struct T_UINT64_READ *)(const void *)(addr))->v) + #endif #ifndef __ALIGNED #warning No compiler specific solution for __ALIGNED. __ALIGNED is ignored. #define __ALIGNED(x) diff --git a/CMSIS/Core/Include/cmsis_gcc.h b/CMSIS/Core/Include/cmsis_gcc.h index 6cfd831851..e4a60942e4 100644 --- a/CMSIS/Core/Include/cmsis_gcc.h +++ b/CMSIS/Core/Include/cmsis_gcc.h @@ -1,8 +1,8 @@ /**************************************************************************//** * @file cmsis_gcc.h * @brief CMSIS compiler GCC header file - * @version V5.2.1 - * @date 30. July 2019 + * @version V5.3.0 + * @date 19. December 2019 ******************************************************************************/ /* * Copyright (c) 2009-2019 Arm Limited. All rights reserved. @@ -107,6 +107,22 @@ #pragma GCC diagnostic pop #define __UNALIGNED_UINT32_READ(addr) (((const struct T_UINT32_READ *)(const void *)(addr))->v) #endif +#ifndef __UNALIGNED_UINT64_WRITE + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wpacked" + #pragma GCC diagnostic ignored "-Wattributes" + __PACKED_STRUCT T_UINT64_WRITE { uint64_t v; }; + #pragma GCC diagnostic pop + #define __UNALIGNED_UINT64_WRITE(addr, val) (void)((((struct T_UINT64_WRITE *)(void *)(addr))->v) = (val)) +#endif +#ifndef __UNALIGNED_UINT64_READ + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wpacked" + #pragma GCC diagnostic ignored "-Wattributes" + __PACKED_STRUCT T_UINT64_READ { uint64_t v; }; + #pragma GCC diagnostic pop + #define __UNALIGNED_UINT64_READ(addr) (((const struct T_UINT64_READ *)(const void *)(addr))->v) +#endif #ifndef __ALIGNED #define __ALIGNED(x) __attribute__((aligned(x))) #endif diff --git a/CMSIS/Core/Include/cmsis_iccarm.h b/CMSIS/Core/Include/cmsis_iccarm.h index 4020ad76e7..7f284a9b08 100644 --- a/CMSIS/Core/Include/cmsis_iccarm.h +++ b/CMSIS/Core/Include/cmsis_iccarm.h @@ -1,8 +1,8 @@ /**************************************************************************//** * @file cmsis_iccarm.h * @brief CMSIS compiler ICCARM (IAR Compiler for Arm) header file - * @version V5.1.1 - * @date 30. July 2019 + * @version V5.2.0 + * @date 19. December 2019 ******************************************************************************/ //------------------------------------------------------------------------------ @@ -192,7 +192,7 @@ __IAR_FT uint16_t __iar_uint16_read(void const *ptr) #pragma language=extended __IAR_FT void __iar_uint16_write(void const *ptr, uint16_t val) { - *(__packed uint16_t*)(ptr) = val;; + *(__packed uint16_t*)(ptr) = val; } #pragma language=restore #define __UNALIGNED_UINT16_WRITE(PTR,VAL) __iar_uint16_write(PTR,VAL) @@ -214,7 +214,7 @@ __IAR_FT uint32_t __iar_uint32_read(void const *ptr) #pragma language=extended __IAR_FT void __iar_uint32_write(void const *ptr, uint32_t val) { - *(__packed uint32_t*)(ptr) = val;; + *(__packed uint32_t*)(ptr) = val; } #pragma language=restore #define __UNALIGNED_UINT32_WRITE(PTR,VAL) __iar_uint32_write(PTR,VAL) @@ -228,6 +228,28 @@ __packed struct __iar_u32 { uint32_t v; }; #define __UNALIGNED_UINT32(PTR) (((struct __iar_u32 *)(PTR))->v) #endif +#ifndef __UNALIGNED_UINT64_READ +#pragma language=save +#pragma language=extended +__IAR_FT uint64_t __iar_uint64_read(void const *ptr) +{ + return *(__packed uint64_t*)(ptr); +} +#pragma language=restore +#define __UNALIGNED_UINT64_READ(PTR) __iar_uint64_read(PTR) +#endif + +#ifndef __UNALIGNED_UINT64_WRITE +#pragma language=save +#pragma language=extended +__IAR_FT void __iar_uint64_write(void const *ptr, uint64_t val) +{ + *(__packed uint64_t*)(ptr) = val; +} +#pragma language=restore +#define __UNALIGNED_UINT64_WRITE(PTR,VAL) __iar_uint64_write(PTR,VAL) +#endif + #ifndef __USED #if __ICCARM_V8 #define __USED __attribute__((used)) diff --git a/CMSIS/Core_A/Include/cmsis_armcc.h b/CMSIS/Core_A/Include/cmsis_armcc.h index cc11ada353..4a4f5632be 100644 --- a/CMSIS/Core_A/Include/cmsis_armcc.h +++ b/CMSIS/Core_A/Include/cmsis_armcc.h @@ -1,8 +1,8 @@ /**************************************************************************//** * @file cmsis_armcc.h * @brief CMSIS compiler specific macros, functions, instructions - * @version V1.0.4 - * @date 30. July 2019 + * @version V1.1.0 + * @date 19. December 2019 ******************************************************************************/ /* * Copyright (c) 2009-2019 Arm Limited. All rights reserved. @@ -80,6 +80,12 @@ #ifndef __UNALIGNED_UINT32_READ #define __UNALIGNED_UINT32_READ(addr) (*((const __packed uint32_t *)(addr))) #endif +#ifndef __UNALIGNED_UINT64_WRITE + #define __UNALIGNED_UINT64_WRITE(addr, val) ((*((__packed uint64_t *)(addr))) = (val)) +#endif +#ifndef __UNALIGNED_UINT64_READ + #define __UNALIGNED_UINT64_READ(addr) (*((const __packed uint64_t *)(addr))) +#endif #ifndef __ALIGNED #define __ALIGNED(x) __attribute__((aligned(x))) #endif diff --git a/CMSIS/Core_A/Include/cmsis_armclang.h b/CMSIS/Core_A/Include/cmsis_armclang.h index 232a76aa85..e0917d1c64 100644 --- a/CMSIS/Core_A/Include/cmsis_armclang.h +++ b/CMSIS/Core_A/Include/cmsis_armclang.h @@ -1,8 +1,8 @@ /**************************************************************************//** * @file cmsis_armclang.h * @brief CMSIS compiler specific macros, functions, instructions - * @version V1.1.2 - * @date 30. July 2019 + * @version V1.2.0 + * @date 19. December 2019 ******************************************************************************/ /* * Copyright (c) 2009-2019 Arm Limited. All rights reserved. @@ -96,6 +96,22 @@ #pragma clang diagnostic pop #define __UNALIGNED_UINT32_READ(addr) (((const struct T_UINT32_READ *)(const void *)(addr))->v) #endif +#ifndef __UNALIGNED_UINT64_WRITE + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wpacked" +/*lint -esym(9058, T_UINT64_WRITE)*/ /* disable MISRA 2012 Rule 2.4 for T_UINT64_WRITE */ + __PACKED_STRUCT T_UINT64_WRITE { uint64_t v; }; + #pragma clang diagnostic pop + #define __UNALIGNED_UINT64_WRITE(addr, val) (void)((((struct T_UINT64_WRITE *)(void *)(addr))->v) = (val)) +#endif +#ifndef __UNALIGNED_UINT64_READ + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wpacked" +/*lint -esym(9058, T_UINT64_READ)*/ /* disable MISRA 2012 Rule 2.4 for T_UINT64_READ */ + __PACKED_STRUCT T_UINT64_READ { uint64_t v; }; + #pragma clang diagnostic pop + #define __UNALIGNED_UINT64_READ(addr) (((const struct T_UINT64_READ *)(const void *)(addr))->v) +#endif #ifndef __ALIGNED #define __ALIGNED(x) __attribute__((aligned(x))) #endif diff --git a/CMSIS/Core_A/Include/cmsis_gcc.h b/CMSIS/Core_A/Include/cmsis_gcc.h index 3c9bdfb825..61b634dc0a 100644 --- a/CMSIS/Core_A/Include/cmsis_gcc.h +++ b/CMSIS/Core_A/Include/cmsis_gcc.h @@ -1,8 +1,8 @@ /**************************************************************************//** * @file cmsis_gcc.h * @brief CMSIS compiler specific macros, functions, instructions - * @version V1.2.1 - * @date 30. July 2019 + * @version V1.3.0 + * @date 19. December 2019 ******************************************************************************/ /* * Copyright (c) 2009-2019 Arm Limited. All rights reserved. @@ -102,6 +102,21 @@ #pragma GCC diagnostic pop #define __UNALIGNED_UINT32_READ(addr) (((const struct T_UINT32_READ *)(const void *)(addr))->v) #endif +#ifndef __UNALIGNED_UINT64_WRITE + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wpacked" +/*lint -esym(9058, T_UINT64_WRITE)*/ /* disable MISRA 2012 Rule 2.4 for T_UINT64_WRITE */ + __PACKED_STRUCT T_UINT64_WRITE { uint64_t v; }; + #pragma GCC diagnostic pop + #define __UNALIGNED_UINT64_WRITE(addr, val) (void)((((struct T_UINT64_WRITE *)(void *)(addr))->v) = (val)) +#endif +#ifndef __UNALIGNED_UINT64_READ + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wpacked" + __PACKED_STRUCT T_UINT64_READ { uint64_t v; }; + #pragma GCC diagnostic pop + #define __UNALIGNED_UINT64_READ(addr) (((const struct T_UINT64_READ *)(const void *)(addr))->v) +#endif #ifndef __ALIGNED #define __ALIGNED(x) __attribute__((aligned(x))) #endif diff --git a/CMSIS/Core_A/Include/cmsis_iccarm.h b/CMSIS/Core_A/Include/cmsis_iccarm.h index 7d44107897..537f04d5df 100644 --- a/CMSIS/Core_A/Include/cmsis_iccarm.h +++ b/CMSIS/Core_A/Include/cmsis_iccarm.h @@ -1,8 +1,8 @@ /**************************************************************************//** * @file cmsis_iccarm.h * @brief CMSIS compiler ICCARM (IAR Compiler for Arm) header file - * @version V5.0.7 - * @date 15. May 2019 + * @version V5.1.0 + * @date 19. December 2019 ******************************************************************************/ //------------------------------------------------------------------------------ @@ -155,7 +155,7 @@ #pragma language=extended __IAR_FT void __iar_uint16_write(void const *ptr, uint16_t val) { - *(__packed uint16_t*)(ptr) = val;; + *(__packed uint16_t*)(ptr) = val; } #pragma language=restore #define __UNALIGNED_UINT16_WRITE(PTR,VAL) __iar_uint16_write(PTR,VAL) @@ -177,12 +177,34 @@ #pragma language=extended __IAR_FT void __iar_uint32_write(void const *ptr, uint32_t val) { - *(__packed uint32_t*)(ptr) = val;; + *(__packed uint32_t*)(ptr) = val; } #pragma language=restore #define __UNALIGNED_UINT32_WRITE(PTR,VAL) __iar_uint32_write(PTR,VAL) #endif +#ifndef __UNALIGNED_UINT64_READ + #pragma language=save + #pragma language=extended + __IAR_FT uint64_t __iar_uint64_read(void const *ptr) + { + return *(__packed uint64_t*)(ptr); + } + #pragma language=restore + #define __UNALIGNED_UINT64_READ(PTR) __iar_uint64_read(PTR) +#endif + +#ifndef __UNALIGNED_UINT64_WRITE + #pragma language=save + #pragma language=extended + __IAR_FT void __iar_uint64_write(void const *ptr, uint64_t val) + { + *(__packed uint64_t*)(ptr) = val; + } + #pragma language=restore + #define __UNALIGNED_UINT64_WRITE(PTR,VAL) __iar_uint64_write(PTR,VAL) +#endif + #if 0 #ifndef __UNALIGNED_UINT32 /* deprecated */ #pragma language=save