Skip to content
This repository was archived by the owner on Dec 18, 2025. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions CMSIS/Core/Include/cmsis_armcc.h
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -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
Expand Down
20 changes: 18 additions & 2 deletions CMSIS/Core/Include/cmsis_armclang.h
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -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
Expand Down
20 changes: 18 additions & 2 deletions CMSIS/Core/Include/cmsis_armclang_ltm.h
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -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
Expand Down
28 changes: 26 additions & 2 deletions CMSIS/Core/Include/cmsis_compiler.h
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down
20 changes: 18 additions & 2 deletions CMSIS/Core/Include/cmsis_gcc.h
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -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
Expand Down
30 changes: 26 additions & 4 deletions CMSIS/Core/Include/cmsis_iccarm.h
Original file line number Diff line number Diff line change
@@ -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
******************************************************************************/

//------------------------------------------------------------------------------
Expand Down Expand Up @@ -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)
Expand All @@ -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)
Expand All @@ -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)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@TTornblom, please cross check changes to IAR compiler header files.

{
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))
Expand Down
10 changes: 8 additions & 2 deletions CMSIS/Core_A/Include/cmsis_armcc.h
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -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
Expand Down
20 changes: 18 additions & 2 deletions CMSIS/Core_A/Include/cmsis_armclang.h
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -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
Expand Down
19 changes: 17 additions & 2 deletions CMSIS/Core_A/Include/cmsis_gcc.h
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -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
Expand Down
30 changes: 26 additions & 4 deletions CMSIS/Core_A/Include/cmsis_iccarm.h
Original file line number Diff line number Diff line change
@@ -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
******************************************************************************/

//------------------------------------------------------------------------------
Expand Down Expand Up @@ -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)
Expand All @@ -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
Expand Down