Skip to content

Commit f9507ab

Browse files
Masmiseim36JonatanAntoni
authored andcommitted
use a single core folder for all ARM architectures.
This should reduce code duplication.
1 parent 1e8d111 commit f9507ab

70 files changed

Lines changed: 222 additions & 154 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -738,7 +738,7 @@ typedef struct
738738
#endif
739739

740740
#if (__GIC_PRESENT == 1U) || defined(DOXYGEN)
741-
#include "../../Core/gic_v20.h"
741+
#include "gic_v20.h"
742742
#endif /* (__GIC_PRESENT == 1U) || defined(DOXYGEN) */
743743

744744
#if (__TIM_PRESENT == 1U) || defined(DOXYGEN)
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**************************************************************************//**
2-
* @file cmsis_cp15.h
2+
* @file armv7a_cp15.h
33
* @brief CMSIS compiler specific macros, functions, instructions
44
* @version V1.0.2
55
* @date 19. December 2022
Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,15 @@
147147
#warning "__VIC_PRESENT not defined in device header file; using default!"
148148
#endif
149149

150+
#ifndef __GIC_PRESENT
151+
#define __GIC_PRESENT 1U
152+
#warning "__GIC_PRESENT not defined in device header file; using default!"
153+
#endif
154+
155+
#if (__GIC_PRESENT == 1U) && (__VIC_PRESENT == 1U)
156+
#error "Only one Interrupt Controller can be used"
157+
#endif
158+
150159
#ifndef __MPU_PRESENT
151160
#define __MPU_PRESENT 0U
152161
#warning "__MPU_PRESENT not defined in device header file; using default!"
@@ -450,13 +459,9 @@ typedef union
450459
#endif /* (__VIC_PRESENT == 1U) || defined(DOXYGEN) */
451460

452461
#if (__GIC_PRESENT == 1U) || defined(DOXYGEN)
453-
#include "../../Core/gic_v20.h"
462+
#include "gic_v20.h"
454463
#endif /* (__GIC_PRESENT == 1U) || defined(DOXYGEN) */
455464

456-
#if (__GIC_PRESENT == 1U) && (__VIC_PRESENT == 1U)
457-
#error "Only one Interrupt Controller can be used"
458-
#endif
459-
460465
#ifdef __cplusplus
461466
}
462467
#endif
Lines changed: 54 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,38 +31,86 @@
3131
* Arm Compiler 4/5
3232
*/
3333
#if defined ( __CC_ARM )
34-
#include "cmsis_armcc.h"
34+
#if defined __CORTEX_A
35+
#include "cmsis_cortexa_armcc.h"
36+
#elif defined __CORTEX_R
37+
#include "cmsis_cortexr_armcc.h"
38+
#elif defined __CORTEX_M
39+
#include "cmsis_cortexm_armcc.h"
40+
#else
41+
#error "Unknown architecture"
42+
#endif
3543

3644

3745
/*
3846
* Arm Compiler 6.6 LTM (armclang)
3947
*/
4048
#elif defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) && (__ARMCC_VERSION < 6100100)
41-
#include "cmsis_armclang_ltm.h"
49+
#if defined __CORTEX_A
50+
#error "Core-R is not supported for this compiler"
51+
#elif defined __CORTEX_R
52+
#error "Core-R is not supported for this compiler"
53+
#elif defined __CORTEX_M
54+
#include "cmsis_corem_armclang_ltm.h"
55+
#else
56+
#error "Unknown architecture"
57+
#endif
4258

4359
/*
4460
* Arm Compiler above 6.10.1 (armclang)
4561
*/
4662
#elif defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6100100)
47-
#include "cmsis_armclang.h"
63+
#if defined __CORTEX_A
64+
#include "cmsis_corema_armclang.h"
65+
#elif defined __CORTEX_R
66+
#include "cmsis_corer_armclang.h"
67+
#elif defined __CORTEX_M
68+
#include "cmsis_corem_armclang.h"
69+
#else
70+
#error "Unknown architecture"
71+
#endif
4872

4973
/*
5074
* TI Arm Clang Compiler (tiarmclang)
5175
*/
5276
#elif defined (__ti__)
53-
#include "cmsis_tiarmclang.h"
77+
#if defined __CORTEX_A
78+
#error "Core-R is not supported for this compiler"
79+
#elif defined __CORTEX_R
80+
#error "Core-R is not supported for this compiler"
81+
#elif defined __CORTEX_M
82+
#include "cmsis_corem_tiarmclang.h"
83+
#else
84+
#error "Unknown architecture"
85+
#endif
5486

5587
/*
5688
* GNU Compiler
5789
*/
5890
#elif defined ( __GNUC__ )
59-
#include "cmsis_gcc.h"
91+
#if defined __CORTEX_A
92+
#include "cmsis_corea_gcc.h"
93+
#elif defined __CORTEX_R
94+
#include "cmsis_corer_gcc.h"
95+
#elif defined __CORTEX_M
96+
#include "cmsis_corem_gcc.h"
97+
#else
98+
#error "Unknown architecture"
99+
#endif
60100

61101
/*
62102
* IAR Compiler
63103
*/
64104
#elif defined ( __ICCARM__ )
65-
#include <cmsis_iccarm.h>
105+
#if defined __CORTEX_A
106+
#include "cmsis_corea_iccarm.h"
107+
#elif defined __CORTEX_R
108+
#include "cmsis_corer_iccarm.h"
109+
#elif defined __CORTEX_M
110+
#include "cmsis_corem_iccarm.h"
111+
#else
112+
#error "Unknown architecture"
113+
#endif
66114

67115

68116
/*
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
#define __CMSIS_ARMCC_H
2727

2828
// Include the generic settigs:
29-
#include "../../Core/cmsis_generic_armcc.h"
29+
#include "cmsis_generic_armcc.h"
3030

3131

3232
/** \brief Get CPSR (Current Program Status Register)
@@ -162,7 +162,7 @@ __STATIC_INLINE void __set_FPEXC(uint32_t fpexc)
162162
__ASM volatile("MCRR p" # cp ", " # op1 ", ltmp, htmp, c" # CRm); \
163163
} while(0)
164164

165-
#include "cmsis_cp15.h"
165+
#include "armv7a_cp15.h"
166166

167167
/** \brief Enable Floating Point Unit
168168
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
#pragma clang system_header /* treat file as system include file */
3131

3232
// Include the generic settigs:
33-
#include "../../Core/cmsis_generic_armclang.h"
33+
#include "cmsis_generic_armclang.h"
3434

3535

3636
/* ########################### Core Function Access ########################### */
@@ -157,7 +157,7 @@ __STATIC_FORCEINLINE void __set_FPEXC(uint32_t fpexc)
157157
#define __get_CP64(cp, op1, Rt, CRm) __ASM volatile("MRRC p" # cp ", " # op1 ", %Q0, %R0, c" # CRm : "=r" (Rt) : : "memory" )
158158
#define __set_CP64(cp, op1, Rt, CRm) __ASM volatile("MCRR p" # cp ", " # op1 ", %Q0, %R0, c" # CRm : : "r" (Rt) : "memory" )
159159

160-
#include "cmsis_cp15.h"
160+
#include "armv7a_cp15.h"
161161

162162
/** \brief Enable Floating Point Unit
163163
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
#define __CMSIS_GCC_H
2727

2828
// Include the generic settigs:
29-
#include "../../Core/cmsis_generic_gcc.h"
29+
#include "cmsis_generic_gcc.h"
3030

3131
/* ignore some GCC warnings */
3232
#pragma GCC diagnostic push
@@ -266,7 +266,7 @@ __STATIC_FORCEINLINE void __set_FPEXC(uint32_t fpexc)
266266
#define __get_CP64(cp, op1, Rt, CRm) __ASM volatile("MRRC p" # cp ", " # op1 ", %Q0, %R0, c" # CRm : "=r" (Rt) : : "memory" )
267267
#define __set_CP64(cp, op1, Rt, CRm) __ASM volatile("MCRR p" # cp ", " # op1 ", %Q0, %R0, c" # CRm : : "r" (Rt) : "memory" )
268268

269-
#include "cmsis_cp15.h"
269+
#include "armv7a_cp15.h"
270270

271271
/** \brief Enable Floating Point Unit
272272

0 commit comments

Comments
 (0)