Skip to content

Commit d8151ca

Browse files
GuentherMartinJonatanAntoni
authored andcommitted
Core: Clean up header files
1 parent 7002cdf commit d8151ca

22 files changed

Lines changed: 203 additions & 270 deletions

CMSIS/Core/Include/a-profile/cmsis_armclang_a.h

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
1-
/**************************************************************************//**
2-
* @file cmsis_armclang_a.h
3-
* @brief CMSIS compiler armclang (Arm Compiler 6) header file
4-
* @version V1.2.3
5-
* @date 11. October 2023
6-
******************************************************************************/
71
/*
82
* Copyright (c) 2009-2023 Arm Limited. All rights reserved.
93
*
@@ -22,6 +16,10 @@
2216
* limitations under the License.
2317
*/
2418

19+
/*
20+
* CMSIS-Core(A) Compiler ARMClang (Arm Compiler 6) Header File
21+
*/
22+
2523
#ifndef __CMSIS_ARMCLANG_A_H
2624
#define __CMSIS_ARMCLANG_A_H
2725

@@ -102,13 +100,15 @@
102100
#define __COMPILER_BARRIER() __ASM volatile("":::"memory")
103101
#endif
104102

103+
105104
/* ########################## Core Instruction Access ######################### */
106105
/**
107106
\brief No Operation
108107
\details No Operation does nothing. This instruction can be used for code alignment purposes.
109108
*/
110109
#define __NOP __builtin_arm_nop
111110

111+
112112
/**
113113
\brief Wait For Interrupt
114114
\details Wait For Interrupt is a hint instruction that suspends execution until one of a number of events occurs.
@@ -218,6 +218,7 @@ __STATIC_FORCEINLINE uint32_t __ROR(uint32_t op1, uint32_t op2)
218218
*/
219219
#define __RBIT __builtin_arm_rbit
220220

221+
221222
/**
222223
\brief Count leading zeros
223224
\details Counts the number of leading zeros of a data value.
@@ -242,6 +243,7 @@ __STATIC_FORCEINLINE uint8_t __CLZ(uint32_t value)
242243
return __builtin_clz(value);
243244
}
244245

246+
245247
/**
246248
\brief LDR Exclusive (8 bit)
247249
\details Executes a exclusive LDR instruction for 8 bit value.
@@ -502,7 +504,7 @@ __STATIC_FORCEINLINE int32_t __SMMLA (int32_t op1, int32_t op2, int32_t op3)
502504
int32_t result;
503505

504506
__ASM volatile ("smmla %0, %1, %2, %3" : "=r" (result): "r" (op1), "r" (op2), "r" (op3) );
505-
return(result);
507+
return (result);
506508
}
507509

508510
#endif /* (__ARM_FEATURE_DSP == 1) */
@@ -707,23 +709,23 @@ __STATIC_FORCEINLINE void __set_FPEXC(uint32_t fpexc)
707709
__STATIC_INLINE void __FPU_Enable(void)
708710
{
709711
__ASM volatile(
710-
//Permit access to VFP/NEON, registers by modifying CPACR
712+
// Permit access to VFP/NEON, registers by modifying CPACR
711713
" MRC p15,0,R1,c1,c0,2 \n"
712714
" ORR R1,R1,#0x00F00000 \n"
713715
" MCR p15,0,R1,c1,c0,2 \n"
714716

715-
//Ensure that subsequent instructions occur in the context of VFP/NEON access permitted
717+
// Ensure that subsequent instructions occur in the context of VFP/NEON access permitted
716718
" ISB \n"
717719

718-
//Enable VFP/NEON
720+
// Enable VFP/NEON
719721
" VMRS R1,FPEXC \n"
720722
" ORR R1,R1,#0x40000000 \n"
721723
" VMSR FPEXC,R1 \n"
722724

723-
//Initialise VFP/NEON registers to 0
725+
// Initialise VFP/NEON registers to 0
724726
" MOV R2,#0 \n"
725727

726-
//Initialise D16 registers to 0
728+
// Initialise D16 registers to 0
727729
" VMOV D0, R2,R2 \n"
728730
" VMOV D1, R2,R2 \n"
729731
" VMOV D2, R2,R2 \n"
@@ -742,7 +744,7 @@ __STATIC_INLINE void __FPU_Enable(void)
742744
" VMOV D15,R2,R2 \n"
743745

744746
#if (defined(__ARM_NEON) && (__ARM_NEON == 1))
745-
//Initialise D32 registers to 0
747+
// Initialise D32 registers to 0
746748
" VMOV D16,R2,R2 \n"
747749
" VMOV D17,R2,R2 \n"
748750
" VMOV D18,R2,R2 \n"
@@ -761,7 +763,7 @@ __STATIC_INLINE void __FPU_Enable(void)
761763
" VMOV D31,R2,R2 \n"
762764
#endif
763765

764-
//Initialise FPSCR to a known state
766+
// Initialise FPSCR to a known state
765767
" VMRS R1,FPSCR \n"
766768
" LDR R2,=0x00086060 \n" //Mask off all bits that do not have to be preserved. Non-preserved bits can/should be zero.
767769
" AND R1,R1,R2 \n"

CMSIS/Core/Include/a-profile/cmsis_clang_a.h

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
1-
/**************************************************************************//**
2-
* @file cmsis_clang_a.h
3-
* @brief CMSIS compiler Clang header file
4-
* @version V0.1.0
5-
* @date 24. October 2023
6-
******************************************************************************/
71
/*
82
* Copyright (c) 2023 Arm Limited. All rights reserved.
93
*
@@ -22,6 +16,10 @@
2216
* limitations under the License.
2317
*/
2418

19+
/*
20+
* CMSIS-Core(A) Compiler LLVM/Clang Header File
21+
*/
22+
2523
#ifndef __CMSIS_CLANG_A_H
2624
#define __CMSIS_CLANG_A_H
2725

@@ -113,6 +111,7 @@
113111
*/
114112
#define __NOP() __ASM volatile ("nop")
115113

114+
116115
/**
117116
\brief Wait For Interrupt
118117
\details Wait For Interrupt is a hint instruction that suspends execution until one of a number of events occurs.
@@ -285,6 +284,7 @@ __STATIC_FORCEINLINE uint8_t __CLZ(uint32_t value)
285284
return __builtin_clz(value);
286285
}
287286

287+
288288
/**
289289
\brief LDR Exclusive (8 bit)
290290
\details Executes a exclusive LDR instruction for 8 bit value.
@@ -600,7 +600,8 @@ __STATIC_FORCEINLINE void __set_FPSCR(uint32_t fpscr)
600600

601601
/* ################### Compiler specific Intrinsics ########################### */
602602

603-
#if (__ARM_FEATURE_DSP == 1)
603+
#if (defined (__ARM_FEATURE_DSP) && (__ARM_FEATURE_DSP == 1))
604+
604605
#define __SADD8 __builtin_arm_sadd8
605606
#define __QADD8 __builtin_arm_qadd8
606607
#define __SHADD8 __builtin_arm_shadd8

CMSIS/Core/Include/a-profile/cmsis_cp15.h

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
1-
/**************************************************************************//**
2-
* @file cmsis_cp15.h
3-
* @brief CMSIS compiler specific macros, functions, instructions
4-
* @version V1.0.2
5-
* @date 19. December 2022
6-
******************************************************************************/
71
/*
82
* Copyright (c) 2009-2017 ARM Limited. All rights reserved.
93
*
@@ -22,13 +16,17 @@
2216
* limitations under the License.
2317
*/
2418

19+
/*
20+
* CMSIS-Core(A) Compiler Specific Macros, Functions, Instructions
21+
*/
22+
2523
#ifndef __CMSIS_CP15_H
2624
#define __CMSIS_CP15_H
2725

2826
#if defined ( __ICCARM__ )
2927
#pragma system_include /* treat file as system include file for MISRA check */
3028
#elif defined (__clang__)
31-
#pragma clang system_header /* treat file as system include file */
29+
#pragma clang system_header /* treat file as system include file */
3230
#endif
3331

3432
/** \brief Get ACTLR

CMSIS/Core/Include/a-profile/cmsis_gcc_a.h

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
1-
/**************************************************************************//**
2-
* @file cmsis_gcc_a.h
3-
* @brief CMSIS compiler GCC header file
4-
* @version V1.3.4
5-
* @date 11. October 2023
6-
******************************************************************************/
71
/*
82
* Copyright (c) 2009-2023 Arm Limited. All rights reserved.
93
*
@@ -22,6 +16,10 @@
2216
* limitations under the License.
2317
*/
2418

19+
/*
20+
* CMSIS-Core(A) Compiler GCC Header File
21+
*/
22+
2523
#ifndef __CMSIS_GCC_A_H
2624
#define __CMSIS_GCC_A_H
2725

@@ -120,6 +118,7 @@
120118
*/
121119
#define __NOP() __ASM volatile ("nop")
122120

121+
123122
/**
124123
\brief Wait For Interrupt
125124
\details Wait For Interrupt is a hint instruction that suspends execution until one of a number of events occurs.
@@ -294,6 +293,7 @@ __STATIC_FORCEINLINE uint8_t __CLZ(uint32_t value)
294293
return __builtin_clz(value);
295294
}
296295

296+
297297
/**
298298
\brief LDR Exclusive (8 bit)
299299
\details Executes a exclusive LDR instruction for 8 bit value.
@@ -623,7 +623,8 @@ __STATIC_FORCEINLINE void __set_FPSCR(uint32_t fpscr)
623623

624624
/* ################### Compiler specific Intrinsics ########################### */
625625

626-
#if (__ARM_FEATURE_DSP == 1)
626+
#if (defined (__ARM_FEATURE_DSP) && (__ARM_FEATURE_DSP == 1))
627+
627628
#define __SADD8 __builtin_arm_sadd8
628629
#define __QADD8 __builtin_arm_qadd8
629630
#define __SHADD8 __builtin_arm_shadd8

CMSIS/Core/Include/a-profile/cmsis_iccarm_a.h

Lines changed: 21 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,25 @@
1-
/**************************************************************************//**
2-
* @file cmsis_iccarm_a.h
3-
* @brief CMSIS compiler ICCARM (IAR Compiler for Arm) header file
4-
* @version V5.0.8
5-
* @date 13. November 2022
6-
******************************************************************************/
7-
8-
//------------------------------------------------------------------------------
9-
//
10-
// Copyright (c) 2017-2018 IAR Systems
11-
// Copyright (c) 2018-2019 Arm Limited
12-
//
13-
// SPDX-License-Identifier: Apache-2.0
14-
//
15-
// Licensed under the Apache License, Version 2.0 (the "License")
16-
// you may not use this file except in compliance with the License.
17-
// You may obtain a copy of the License at
18-
// http://www.apache.org/licenses/LICENSE-2.0
19-
//
20-
// Unless required by applicable law or agreed to in writing, software
21-
// distributed under the License is distributed on an "AS IS" BASIS,
22-
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
23-
// See the License for the specific language governing permissions and
24-
// limitations under the License.
25-
//
26-
//------------------------------------------------------------------------------
1+
/*
2+
* Copyright (c) 2017-2018 IAR Systems
3+
* Copyright (c) 2018-2023 Arm Limited. All rights reserved.
4+
*
5+
* SPDX-License-Identifier: Apache-2.0
6+
*
7+
* Licensed under the Apache License, Version 2.0 (the License); you may
8+
* not use this file except in compliance with the License.
9+
* You may obtain a copy of the License at
10+
*
11+
* www.apache.org/licenses/LICENSE-2.0
12+
*
13+
* Unless required by applicable law or agreed to in writing, software
14+
* distributed under the License is distributed on an AS IS BASIS, WITHOUT
15+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
* See the License for the specific language governing permissions and
17+
* limitations under the License.
18+
*/
2719

20+
/*
21+
* CMSIS-Core(A) Compiler ICCARM (IAR Compiler for Arm) Header File
22+
*/
2823

2924
#ifndef __CMSIS_ICCARM_A_H__
3025
#define __CMSIS_ICCARM_A_H__
@@ -185,16 +180,6 @@
185180
#define __UNALIGNED_UINT32_WRITE(PTR,VAL) __iar_uint32_write(PTR,VAL)
186181
#endif
187182

188-
#if 0
189-
#ifndef __UNALIGNED_UINT32 /* deprecated */
190-
#pragma language=save
191-
#pragma language=extended
192-
__packed struct __iar_u32 { uint32_t v; };
193-
#pragma language=restore
194-
#define __UNALIGNED_UINT32(PTR) (((struct __iar_u32 *)(PTR))->v)
195-
#endif
196-
#endif
197-
198183
#ifndef __USED
199184
#if __ICCARM_V8
200185
#define __USED __attribute__((used))

CMSIS/Core/Include/a-profile/irq_ctrl.h

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
1-
/**************************************************************************//**
2-
* @file irq_ctrl.h
3-
* @brief Interrupt Controller API header file
4-
* @version V1.1.0
5-
* @date 03. March 2020
6-
******************************************************************************/
71
/*
82
* Copyright (c) 2017-2020 ARM Limited. All rights reserved.
93
*
@@ -22,13 +16,17 @@
2216
* limitations under the License.
2317
*/
2418

19+
/*
20+
* CMSIS-Core(A) Interrupt Controller API Header File
21+
*/
22+
2523
#ifndef IRQ_CTRL_H_
2624
#define IRQ_CTRL_H_
2725

2826
#if defined ( __ICCARM__ )
2927
#pragma system_include /* treat file as system include file for MISRA check */
3028
#elif defined (__clang__)
31-
#pragma clang system_header /* treat file as system include file */
29+
#pragma clang system_header /* treat file as system include file */
3230
#endif
3331

3432
#include <stdint.h>

CMSIS/Core/Include/cmsis_compiler.h

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
1-
/**************************************************************************//**
2-
* @file cmsis_compiler.h
3-
* @brief CMSIS compiler generic header file
4-
* @version V6.0.0
5-
* @date 23. November 2023
6-
******************************************************************************/
71
/*
82
* Copyright (c) 2009-2023 Arm Limited. All rights reserved.
93
*
@@ -22,6 +16,10 @@
2216
* limitations under the License.
2317
*/
2418

19+
/*
20+
* CMSIS Compiler Generic Header File
21+
*/
22+
2523
#ifndef __CMSIS_COMPILER_H
2624
#define __CMSIS_COMPILER_H
2725

@@ -137,10 +135,6 @@
137135
#ifndef __PACKED_UNION
138136
#define __PACKED_UNION union __attribute__((packed))
139137
#endif
140-
#ifndef __UNALIGNED_UINT32 /* deprecated */
141-
struct __attribute__((packed)) T_UINT32 { uint32_t v; };
142-
#define __UNALIGNED_UINT32(x) (((struct T_UINT32 *)(x))->v)
143-
#endif
144138
#ifndef __UNALIGNED_UINT16_WRITE
145139
__PACKED_STRUCT T_UINT16_WRITE { uint16_t v; };
146140
#define __UNALIGNED_UINT16_WRITE(addr, val) (void)((((struct T_UINT16_WRITE *)(void*)(addr))->v) = (val))
@@ -214,10 +208,6 @@
214208
#ifndef __PACKED_UNION
215209
#define __PACKED_UNION union __packed__
216210
#endif
217-
#ifndef __UNALIGNED_UINT32 /* deprecated */
218-
struct __packed__ T_UINT32 { uint32_t v; };
219-
#define __UNALIGNED_UINT32(x) (((struct T_UINT32 *)(x))->v)
220-
#endif
221211
#ifndef __UNALIGNED_UINT16_WRITE
222212
__PACKED_STRUCT T_UINT16_WRITE { uint16_t v; };
223213
#define __UNALIGNED_UINT16_WRITE(addr, val) (void)((((struct T_UINT16_WRITE *)(void *)(addr))->v) = (val))
@@ -290,10 +280,6 @@
290280
#ifndef __PACKED_UNION
291281
#define __PACKED_UNION @packed union
292282
#endif
293-
#ifndef __UNALIGNED_UINT32 /* deprecated */
294-
@packed struct T_UINT32 { uint32_t v; };
295-
#define __UNALIGNED_UINT32(x) (((struct T_UINT32 *)(x))->v)
296-
#endif
297283
#ifndef __UNALIGNED_UINT16_WRITE
298284
__PACKED_STRUCT T_UINT16_WRITE { uint16_t v; };
299285
#define __UNALIGNED_UINT16_WRITE(addr, val) (void)((((struct T_UINT16_WRITE *)(void *)(addr))->v) = (val))

CMSIS/Core/Include/cmsis_version.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
*/
1818

1919
/*
20-
* CMSIS Core Version definitions
20+
* CMSIS Core Version Definitions
2121
*/
2222

2323
#if defined ( __ICCARM__ )

0 commit comments

Comments
 (0)