Skip to content

Commit d8cb72a

Browse files
authored
Merge pull request #6273 from bulislaw/update_cmsis_5.3
Update cmsis/rtx to version 5.3
2 parents 863259e + 076cd42 commit d8cb72a

File tree

99 files changed

+5477
-4049
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

99 files changed

+5477
-4049
lines changed

cmsis/RTE_Components.h

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,7 @@
1818

1919
#define CMSIS_device_header <cmsis.h>
2020

21-
#ifndef MBED_CONF_TZ_PROCESS_STACK_SIZE
22-
#define MBED_CONF_TZ_PROCESS_STACK_SIZE 512
23-
#endif
24-
#ifndef MBED_CONF_TZ_PROCESS_STACK_SLOTS
25-
#define MBED_CONF_TZ_PROCESS_STACK_SLOTS 8
26-
#endif
27-
28-
#define TZ_PROCESS_STACK_SLOTS MBED_CONF_TZ_PROCESS_STACK_SLOTS
29-
#define TZ_PROCESS_STACK_SIZE MBED_CONF_TZ_PROCESS_STACK_SIZE
21+
#include "mbed_rtx_conf.h"
22+
#include "mbed_cmsis_conf.h"
3023

3124
#endif
32-
33-

cmsis/TARGET_CORTEX_A/cmsis_armcc.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
/**************************************************************************//**
22
* @file cmsis_armcc.h
33
* @brief CMSIS compiler specific macros, functions, instructions
4-
* @version V1.0.1
5-
* @date 07. Sep 2017
4+
* @version V1.0.2
5+
* @date 10. January 2018
66
******************************************************************************/
77
/*
8-
* Copyright (c) 2009-2017 ARM Limited. All rights reserved.
8+
* Copyright (c) 2009-2018 Arm Limited. All rights reserved.
99
*
1010
* SPDX-License-Identifier: Apache-2.0
1111
*
@@ -26,7 +26,7 @@
2626
#define __CMSIS_ARMCC_H
2727

2828
#if defined(__ARMCC_VERSION) && (__ARMCC_VERSION < 400677)
29-
#error "Please use ARM Compiler Toolchain V4.0.677 or later!"
29+
#error "Please use Arm Compiler Toolchain V4.0.677 or later!"
3030
#endif
3131

3232
/* CMSIS compiler control architecture macros */

cmsis/TARGET_CORTEX_A/cmsis_armclang.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
/**************************************************************************//**
22
* @file cmsis_armclang.h
33
* @brief CMSIS compiler specific macros, functions, instructions
4-
* @version V1.0.1
5-
* @date 07. Sep 2017
4+
* @version V1.0.2
5+
* @date 10. January 2018
66
******************************************************************************/
77
/*
8-
* Copyright (c) 2009-2017 ARM Limited. All rights reserved.
8+
* Copyright (c) 2009-2018 Arm Limited. All rights reserved.
99
*
1010
* SPDX-License-Identifier: Apache-2.0
1111
*
@@ -28,7 +28,7 @@
2828
#pragma clang system_header /* treat file as system include file */
2929

3030
#ifndef __ARM_COMPAT_H
31-
#include <arm_compat.h> /* Compatibility header for ARM Compiler 5 intrinsics */
31+
#include <arm_compat.h> /* Compatibility header for Arm Compiler 5 intrinsics */
3232
#endif
3333

3434
/* CMSIS compiler specific defines */

cmsis/TARGET_CORTEX_A/cmsis_compiler.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
/**************************************************************************//**
22
* @file cmsis_compiler.h
33
* @brief CMSIS compiler specific macros, functions, instructions
4-
* @version V1.0.1
5-
* @date 01. December 2017
4+
* @version V1.0.2
5+
* @date 10. January 2018
66
******************************************************************************/
77
/*
8-
* Copyright (c) 2009-2017 ARM Limited. All rights reserved.
8+
* Copyright (c) 2009-2018 Arm Limited. All rights reserved.
99
*
1010
* SPDX-License-Identifier: Apache-2.0
1111
*
@@ -28,14 +28,14 @@
2828
#include <stdint.h>
2929

3030
/*
31-
* ARM Compiler 4/5
31+
* Arm Compiler 4/5
3232
*/
3333
#if defined ( __CC_ARM )
3434
#include "cmsis_armcc.h"
3535

3636

3737
/*
38-
* ARM Compiler 6 (armclang)
38+
* Arm Compiler 6 (armclang)
3939
*/
4040
#elif defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)
4141
#include "cmsis_armclang.h"
@@ -56,7 +56,7 @@
5656

5757

5858
/*
59-
* TI ARM Compiler
59+
* TI Arm Compiler
6060
*/
6161
#elif defined ( __TI_ARM__ )
6262
#include <cmsis_ccs.h>

cmsis/TARGET_CORTEX_A/cmsis_cp15.h

Lines changed: 47 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ __STATIC_FORCEINLINE uint32_t __get_MPIDR(void)
223223
return result;
224224
}
225225

226-
/** \brief Get VBAR
226+
/** \brief Get VBAR
227227
228228
This function returns the value of the Vector Base Address Register.
229229
@@ -244,7 +244,31 @@ __STATIC_FORCEINLINE uint32_t __get_VBAR(void)
244244
*/
245245
__STATIC_FORCEINLINE void __set_VBAR(uint32_t vbar)
246246
{
247-
__set_CP(15, 0, vbar, 12, 0, 1);
247+
__set_CP(15, 0, vbar, 12, 0, 0);
248+
}
249+
250+
/** \brief Get MVBAR
251+
252+
This function returns the value of the Monitor Vector Base Address Register.
253+
254+
\return Monitor Vector Base Address Register
255+
*/
256+
__STATIC_FORCEINLINE uint32_t __get_MVBAR(void)
257+
{
258+
uint32_t result;
259+
__get_CP(15, 0, result, 12, 0, 1);
260+
return result;
261+
}
262+
263+
/** \brief Set MVBAR
264+
265+
This function assigns the given value to the Monitor Vector Base Address Register.
266+
267+
\param [in] mvbar Monitor Vector Base Address Register value to set
268+
*/
269+
__STATIC_FORCEINLINE void __set_MVBAR(uint32_t mvbar)
270+
{
271+
__set_CP(15, 0, mvbar, 12, 0, 1);
248272
}
249273

250274
#if (defined(__CORTEX_A) && (__CORTEX_A == 7U) && \
@@ -413,13 +437,32 @@ __STATIC_FORCEINLINE void __set_DCCIMVAC(uint32_t value)
413437
__set_CP(15, 0, value, 7, 14, 1);
414438
}
415439

440+
/** \brief Set CSSELR
441+
*/
442+
__STATIC_FORCEINLINE void __set_CSSELR(uint32_t value)
443+
{
444+
// __ASM volatile("MCR p15, 2, %0, c0, c0, 0" : : "r"(value) : "memory");
445+
__set_CP(15, 2, value, 0, 0, 0);
446+
}
447+
448+
/** \brief Get CSSELR
449+
\return CSSELR Register value
450+
*/
451+
__STATIC_FORCEINLINE uint32_t __get_CSSELR(void)
452+
{
453+
uint32_t result;
454+
// __ASM volatile("MRC p15, 2, %0, c0, c0, 0" : "=r"(result) : : "memory");
455+
__get_CP(15, 2, result, 0, 0, 0);
456+
return result;
457+
}
416458

417459
/** \brief Set CCSIDR
460+
\deprecated CCSIDR itself is read-only. Use __set_CSSELR to select cache level instead.
418461
*/
462+
CMSIS_DEPRECATED
419463
__STATIC_FORCEINLINE void __set_CCSIDR(uint32_t value)
420464
{
421-
// __ASM volatile("MCR p15, 2, %0, c0, c0, 0" : : "r"(value) : "memory");
422-
__set_CP(15, 2, value, 0, 0, 0);
465+
__set_CSSELR(value);
423466
}
424467

425468
/** \brief Get CCSIDR

cmsis/TARGET_CORTEX_A/cmsis_gcc.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -642,7 +642,7 @@ __STATIC_INLINE void __FPU_Enable(void)
642642
" VMOV D14,R2,R2 \n"
643643
" VMOV D15,R2,R2 \n"
644644

645-
#if __ARM_NEON == 1
645+
#if (defined(__ARM_NEON) && (__ARM_NEON == 1))
646646
//Initialise D32 registers to 0
647647
" VMOV D16,R2,R2 \n"
648648
" VMOV D17,R2,R2 \n"

cmsis/TARGET_CORTEX_A/cmsis_iccarm.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
/**************************************************************************//**
22
* @file cmsis_iccarm.h
3-
* @brief CMSIS compiler ICCARM (IAR compiler) header file
4-
* @version V5.0.4
5-
* @date 01. December 2017
3+
* @brief CMSIS compiler ICCARM (IAR Compiler for Arm) header file
4+
* @version V5.0.5
5+
* @date 10. January 2018
66
******************************************************************************/
77

88
//------------------------------------------------------------------------------
99
//
10-
// Copyright (c) 2017 IAR Systems
10+
// Copyright (c) 2017-2018 IAR Systems
1111
//
1212
// Licensed under the Apache License, Version 2.0 (the "License")
1313
// you may not use this file except in compliance with the License.

cmsis/TARGET_CORTEX_A/core_ca.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -950,8 +950,8 @@ __STATIC_FORCEINLINE uint8_t __log2_up(uint32_t n)
950950
*/
951951
__STATIC_FORCEINLINE void __L1C_MaintainDCacheSetWay(uint32_t level, uint32_t maint)
952952
{
953-
register volatile uint32_t Dummy;
954-
register volatile uint32_t ccsidr;
953+
uint32_t Dummy;
954+
uint32_t ccsidr;
955955
uint32_t num_sets;
956956
uint32_t num_ways;
957957
uint32_t shift_way;
@@ -960,7 +960,7 @@ __STATIC_FORCEINLINE void __L1C_MaintainDCacheSetWay(uint32_t level, uint32_t ma
960960

961961
Dummy = level << 1U;
962962
/* set csselr, select ccsidr register */
963-
__set_CCSIDR(Dummy);
963+
__set_CSSELR(Dummy);
964964
/* get current ccsidr register */
965965
ccsidr = __get_CCSIDR();
966966
num_sets = ((ccsidr & 0x0FFFE000U) >> 13U) + 1U;
@@ -992,7 +992,7 @@ __STATIC_FORCEINLINE void __L1C_MaintainDCacheSetWay(uint32_t level, uint32_t ma
992992
* \param [in] op 0 - invalidate, 1 - clean, otherwise - invalidate and clean
993993
*/
994994
__STATIC_FORCEINLINE void L1C_CleanInvalidateCache(uint32_t op) {
995-
register volatile uint32_t clidr;
995+
uint32_t clidr;
996996
uint32_t cache_type;
997997
clidr = __get_CLIDR();
998998
for(uint32_t i = 0U; i<7U; i++)

cmsis/TARGET_CORTEX_A/irq_ctrl.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,12 @@
2222
* limitations under the License.
2323
*/
2424

25+
#if defined ( __ICCARM__ )
26+
#pragma system_include /* treat file as system include file for MISRA check */
27+
#elif defined (__clang__)
28+
#pragma clang system_header /* treat file as system include file */
29+
#endif
30+
2531
#ifndef IRQ_CTRL_H_
2632
#define IRQ_CTRL_H_
2733

cmsis/TARGET_CORTEX_A/irq_ctrl_gic.c

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@
2424

2525
#include <stddef.h>
2626

27-
#include <cmsis.h>
27+
#include "RTE_Components.h"
28+
#include CMSIS_device_header
2829

2930
#include "irq_ctrl.h"
3031

@@ -125,13 +126,11 @@ __WEAK uint32_t IRQ_GetEnableState (IRQn_ID_t irqn) {
125126

126127
/// Configure interrupt request mode.
127128
__WEAK int32_t IRQ_SetMode (IRQn_ID_t irqn, uint32_t mode) {
128-
int32_t status;
129129
uint32_t val;
130130
uint8_t cfg;
131131
uint8_t secure;
132132
uint8_t cpu;
133-
134-
status = 0;
133+
int32_t status = 0;
135134

136135
if ((irqn >= 0) && (irqn < (IRQn_ID_t)IRQ_GIC_LINE_COUNT)) {
137136
// Check triggering mode
@@ -142,6 +141,7 @@ __WEAK int32_t IRQ_SetMode (IRQn_ID_t irqn, uint32_t mode) {
142141
} else if (val == IRQ_MODE_TRIG_EDGE) {
143142
cfg = 0x02U;
144143
} else {
144+
cfg = 0x00U;
145145
status = -1;
146146
}
147147

@@ -156,15 +156,16 @@ __WEAK int32_t IRQ_SetMode (IRQn_ID_t irqn, uint32_t mode) {
156156
val = mode & IRQ_MODE_DOMAIN_Msk;
157157

158158
if (val == IRQ_MODE_DOMAIN_NONSECURE) {
159-
secure = 0;
159+
secure = 0U;
160160
} else {
161161
// Check security extensions support
162162
val = GIC_DistributorInfo() & (1UL << 10U);
163163

164164
if (val != 0U) {
165165
// Security extensions are supported
166-
secure = 1;
166+
secure = 1U;
167167
} else {
168+
secure = 0U;
168169
status = -1;
169170
}
170171
}
@@ -173,7 +174,7 @@ __WEAK int32_t IRQ_SetMode (IRQn_ID_t irqn, uint32_t mode) {
173174
val = mode & IRQ_MODE_CPU_Msk;
174175

175176
if (val == IRQ_MODE_CPU_ALL) {
176-
cpu = 0xFF;
177+
cpu = 0xFFU;
177178
} else {
178179
cpu = val >> IRQ_MODE_CPU_Pos;
179180
}

0 commit comments

Comments
 (0)