56
56
#define __VECTOR_TABLE_ATTRIBUTE __attribute__((used, section("RESET")))
57
57
#endif
58
58
59
- #if (__ARM_FEATURE_CMSE == 3 )
59
+ #if defined ( __ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3 )
60
60
#ifndef __STACK_SEAL
61
61
#define __STACK_SEAL Image$$STACKSEAL$$ZI$$Base
62
62
#endif
69
69
#define __TZ_STACK_SEAL_VALUE 0xFEF5EDA5FEF5EDA5ULL
70
70
#endif
71
71
72
-
73
- __STATIC_FORCEINLINE void __TZ_set_STACKSEAL_S ( uint32_t * stackTop ) {
72
+ __STATIC_FORCEINLINE void __TZ_set_STACKSEAL_S ( uint32_t * stackTop )
73
+ {
74
74
* ((uint64_t * )stackTop ) = __TZ_STACK_SEAL_VALUE ;
75
- }
75
+ }
76
76
#endif
77
77
78
+
78
79
#if (__ARM_ARCH_ISA_THUMB >= 2 )
79
80
/**
80
81
\brief STRT Unprivileged (8 bit)
@@ -119,7 +120,6 @@ __STATIC_FORCEINLINE void __STRT(uint32_t value, volatile uint32_t *ptr)
119
120
@{
120
121
*/
121
122
122
-
123
123
/**
124
124
\brief Get Control Register
125
125
\details Returns the content of the Control Register.
@@ -134,7 +134,7 @@ __STATIC_FORCEINLINE uint32_t __get_CONTROL(void)
134
134
}
135
135
136
136
137
- #if (__ARM_FEATURE_CMSE == 3 )
137
+ #if defined ( __ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3 )
138
138
/**
139
139
\brief Get Control Register (non-secure)
140
140
\details Returns the content of the non-secure Control Register when in secure mode.
@@ -162,7 +162,7 @@ __STATIC_FORCEINLINE void __set_CONTROL(uint32_t control)
162
162
}
163
163
164
164
165
- #if (__ARM_FEATURE_CMSE == 3 )
165
+ #if defined ( __ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3 )
166
166
/**
167
167
\brief Set Control Register (non-secure)
168
168
\details Writes the given value to the non-secure Control Register when in secure state.
@@ -232,7 +232,7 @@ __STATIC_FORCEINLINE uint32_t __get_PSP(void)
232
232
}
233
233
234
234
235
- #if (__ARM_FEATURE_CMSE == 3 )
235
+ #if defined ( __ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3 )
236
236
/**
237
237
\brief Get Process Stack Pointer (non-secure)
238
238
\details Returns the current value of the non-secure Process Stack Pointer (PSP) when in secure state.
@@ -259,7 +259,7 @@ __STATIC_FORCEINLINE void __set_PSP(uint32_t topOfProcStack)
259
259
}
260
260
261
261
262
- #if (__ARM_FEATURE_CMSE == 3 )
262
+ #if defined ( __ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3 )
263
263
/**
264
264
\brief Set Process Stack Pointer (non-secure)
265
265
\details Assigns the given value to the non-secure Process Stack Pointer (PSP) when in secure state.
@@ -286,7 +286,7 @@ __STATIC_FORCEINLINE uint32_t __get_MSP(void)
286
286
}
287
287
288
288
289
- #if (__ARM_FEATURE_CMSE == 3 )
289
+ #if defined ( __ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3 )
290
290
/**
291
291
\brief Get Main Stack Pointer (non-secure)
292
292
\details Returns the current value of the non-secure Main Stack Pointer (MSP) when in secure state.
@@ -313,7 +313,7 @@ __STATIC_FORCEINLINE void __set_MSP(uint32_t topOfMainStack)
313
313
}
314
314
315
315
316
- #if (__ARM_FEATURE_CMSE == 3 )
316
+ #if defined ( __ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3 )
317
317
/**
318
318
\brief Set Main Stack Pointer (non-secure)
319
319
\details Assigns the given value to the non-secure Main Stack Pointer (MSP) when in secure state.
@@ -326,7 +326,7 @@ __STATIC_FORCEINLINE void __TZ_set_MSP_NS(uint32_t topOfMainStack)
326
326
#endif
327
327
328
328
329
- #if (__ARM_FEATURE_CMSE == 3 )
329
+ #if defined ( __ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3 )
330
330
/**
331
331
\brief Get Stack Pointer (non-secure)
332
332
\details Returns the current value of the non-secure Stack Pointer (SP) when in secure state.
@@ -367,7 +367,7 @@ __STATIC_FORCEINLINE uint32_t __get_PRIMASK(void)
367
367
}
368
368
369
369
370
- #if (__ARM_FEATURE_CMSE == 3 )
370
+ #if defined ( __ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3 )
371
371
/**
372
372
\brief Get Priority Mask (non-secure)
373
373
\details Returns the current state of the non-secure priority mask bit from the Priority Mask Register when in secure state.
@@ -394,7 +394,7 @@ __STATIC_FORCEINLINE void __set_PRIMASK(uint32_t priMask)
394
394
}
395
395
396
396
397
- #if (__ARM_FEATURE_CMSE == 3 )
397
+ #if defined ( __ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3 )
398
398
/**
399
399
\brief Set Priority Mask (non-secure)
400
400
\details Assigns the given value to the non-secure Priority Mask Register when in secure state.
@@ -422,7 +422,7 @@ __STATIC_FORCEINLINE uint32_t __get_BASEPRI(void)
422
422
}
423
423
424
424
425
- #if (__ARM_FEATURE_CMSE == 3 )
425
+ #if defined ( __ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3 )
426
426
/**
427
427
\brief Get Base Priority (non-secure)
428
428
\details Returns the current value of the non-secure Base Priority register when in secure state.
@@ -449,7 +449,7 @@ __STATIC_FORCEINLINE void __set_BASEPRI(uint32_t basePri)
449
449
}
450
450
451
451
452
- #if (__ARM_FEATURE_CMSE == 3 )
452
+ #if defined ( __ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3 )
453
453
/**
454
454
\brief Set Base Priority (non-secure)
455
455
\details Assigns the given value to the non-secure Base Priority register when in secure state.
@@ -488,7 +488,7 @@ __STATIC_FORCEINLINE uint32_t __get_FAULTMASK(void)
488
488
}
489
489
490
490
491
- #if (__ARM_FEATURE_CMSE == 3 )
491
+ #if defined ( __ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3 )
492
492
/**
493
493
\brief Get Fault Mask (non-secure)
494
494
\details Returns the current value of the non-secure Fault Mask register when in secure state.
@@ -515,7 +515,7 @@ __STATIC_FORCEINLINE void __set_FAULTMASK(uint32_t faultMask)
515
515
}
516
516
517
517
518
- #if (__ARM_FEATURE_CMSE == 3 )
518
+ #if defined ( __ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3 )
519
519
/**
520
520
\brief Set Fault Mask (non-secure)
521
521
\details Assigns the given value to the non-secure Fault Mask register when in secure state.
@@ -542,9 +542,9 @@ __STATIC_FORCEINLINE void __TZ_set_FAULTMASK_NS(uint32_t faultMask)
542
542
*/
543
543
__STATIC_FORCEINLINE uint32_t __get_PSPLIM (void )
544
544
{
545
- #if (( (__ARM_ARCH_8M_MAIN__ < 1 ) && \
546
- (__ARM_ARCH_8_1M_MAIN__ < 1 ) ) && \
547
- (__ARM_FEATURE_CMSE < 3 ) )
545
+ #if (!(defined (__ARM_ARCH_8M_MAIN__ ) && ( __ARM_ARCH_8M_MAIN__ == 1 ) ) && \
546
+ !(defined (__ARM_ARCH_8_1M_MAIN__ ) && ( __ARM_ARCH_8_1M_MAIN__ == 1 ) ) && \
547
+ (!defined ( __ARM_FEATURE_CMSE ) || ( __ARM_FEATURE_CMSE < 3 )) )
548
548
/* without main extensions, the non-secure PSPLIM is RAZ/WI */
549
549
return (0U );
550
550
#else
@@ -554,7 +554,7 @@ __STATIC_FORCEINLINE uint32_t __get_PSPLIM(void)
554
554
#endif
555
555
}
556
556
557
- #if (__ARM_FEATURE_CMSE == 3 )
557
+ #if defined ( __ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3 )
558
558
/**
559
559
\brief Get Process Stack Pointer Limit (non-secure)
560
560
Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure
@@ -565,8 +565,8 @@ __STATIC_FORCEINLINE uint32_t __get_PSPLIM(void)
565
565
*/
566
566
__STATIC_FORCEINLINE uint32_t __TZ_get_PSPLIM_NS (void )
567
567
{
568
- #if (( __ARM_ARCH_8M_MAIN__ < 1 ) && \
569
- ( __ARM_ARCH_8_1M_MAIN__ < 1 ) )
568
+ #if (!(defined ( __ARM_ARCH_8M_MAIN__ ) && ( __ARM_ARCH_8M_MAIN__ == 1 ) ) && \
569
+ !(defined ( __ARM_ARCH_8_1M_MAIN__ ) && ( __ARM_ARCH_8_1M_MAIN__ == 1 )) )
570
570
/* without main extensions, the non-secure PSPLIM is RAZ/WI */
571
571
return (0U );
572
572
#else
@@ -589,9 +589,9 @@ __STATIC_FORCEINLINE uint32_t __TZ_get_PSPLIM_NS(void)
589
589
*/
590
590
__STATIC_FORCEINLINE void __set_PSPLIM (uint32_t ProcStackPtrLimit )
591
591
{
592
- #if (( (__ARM_ARCH_8M_MAIN__ < 1 ) && \
593
- (__ARM_ARCH_8_1M_MAIN__ < 1 ) ) && \
594
- (__ARM_FEATURE_CMSE < 3 ) )
592
+ #if (!(defined (__ARM_ARCH_8M_MAIN__ ) && ( __ARM_ARCH_8M_MAIN__ == 1 ) ) && \
593
+ !(defined (__ARM_ARCH_8_1M_MAIN__ ) && ( __ARM_ARCH_8_1M_MAIN__ == 1 ) ) && \
594
+ (!defined ( __ARM_FEATURE_CMSE ) || ( __ARM_FEATURE_CMSE < 3 )) )
595
595
/* without main extensions, the non-secure PSPLIM is RAZ/WI */
596
596
(void )ProcStackPtrLimit ;
597
597
#else
@@ -600,7 +600,7 @@ __STATIC_FORCEINLINE void __set_PSPLIM(uint32_t ProcStackPtrLimit)
600
600
}
601
601
602
602
603
- #if (__ARM_FEATURE_CMSE == 3 )
603
+ #if defined ( __ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3 )
604
604
/**
605
605
\brief Set Process Stack Pointer (non-secure)
606
606
Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure
@@ -611,8 +611,8 @@ __STATIC_FORCEINLINE void __set_PSPLIM(uint32_t ProcStackPtrLimit)
611
611
*/
612
612
__STATIC_FORCEINLINE void __TZ_set_PSPLIM_NS (uint32_t ProcStackPtrLimit )
613
613
{
614
- #if (( __ARM_ARCH_8M_MAIN__ < 1 ) && \
615
- ( __ARM_ARCH_8_1M_MAIN__ < 1 ) )
614
+ #if (!(defined ( __ARM_ARCH_8M_MAIN__ ) && ( __ARM_ARCH_8M_MAIN__ == 1 ) ) && \
615
+ !(defined ( __ARM_ARCH_8_1M_MAIN__ ) && ( __ARM_ARCH_8_1M_MAIN__ == 1 )) )
616
616
/* without main extensions, the non-secure PSPLIM is RAZ/WI */
617
617
(void )ProcStackPtrLimit ;
618
618
#else
@@ -632,9 +632,9 @@ __STATIC_FORCEINLINE void __TZ_set_PSPLIM_NS(uint32_t ProcStackPtrLimit)
632
632
*/
633
633
__STATIC_FORCEINLINE uint32_t __get_MSPLIM (void )
634
634
{
635
- #if (( (__ARM_ARCH_8M_MAIN__ < 1 ) && \
636
- (__ARM_ARCH_8_1M_MAIN__ < 1 ) ) && \
637
- (__ARM_FEATURE_CMSE < 3 ) )
635
+ #if (!(defined (__ARM_ARCH_8M_MAIN__ ) && ( __ARM_ARCH_8M_MAIN__ == 1 ) ) && \
636
+ !(defined (__ARM_ARCH_8_1M_MAIN__ ) && ( __ARM_ARCH_8_1M_MAIN__ == 1 ) ) && \
637
+ (!defined ( __ARM_FEATURE_CMSE ) || ( __ARM_FEATURE_CMSE < 3 )) )
638
638
/* without main extensions, the non-secure MSPLIM is RAZ/WI */
639
639
return (0U );
640
640
#else
@@ -645,7 +645,7 @@ __STATIC_FORCEINLINE uint32_t __get_MSPLIM(void)
645
645
}
646
646
647
647
648
- #if (__ARM_FEATURE_CMSE == 3 )
648
+ #if defined ( __ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3 )
649
649
/**
650
650
\brief Get Main Stack Pointer Limit (non-secure)
651
651
Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure
@@ -656,8 +656,8 @@ __STATIC_FORCEINLINE uint32_t __get_MSPLIM(void)
656
656
*/
657
657
__STATIC_FORCEINLINE uint32_t __TZ_get_MSPLIM_NS (void )
658
658
{
659
- #if (( __ARM_ARCH_8M_MAIN__ < 1 ) && \
660
- ( __ARM_ARCH_8_1M_MAIN__ < 1 ) )
659
+ #if (!(defined ( __ARM_ARCH_8M_MAIN__ ) && ( __ARM_ARCH_8M_MAIN__ == 1 ) ) && \
660
+ !(defined ( __ARM_ARCH_8_1M_MAIN__ ) && ( __ARM_ARCH_8_1M_MAIN__ == 1 )) )
661
661
/* without main extensions, the non-secure MSPLIM is RAZ/WI */
662
662
return (0U );
663
663
#else
@@ -679,9 +679,9 @@ __STATIC_FORCEINLINE uint32_t __TZ_get_MSPLIM_NS(void)
679
679
*/
680
680
__STATIC_FORCEINLINE void __set_MSPLIM (uint32_t MainStackPtrLimit )
681
681
{
682
- #if (( (__ARM_ARCH_8M_MAIN__ < 1 ) && \
683
- (__ARM_ARCH_8_1M_MAIN__ < 1 ) ) && \
684
- (__ARM_FEATURE_CMSE < 3 ) )
682
+ #if (!(defined (__ARM_ARCH_8M_MAIN__ ) && ( __ARM_ARCH_8M_MAIN__ == 1 ) ) && \
683
+ !(defined (__ARM_ARCH_8_1M_MAIN__ ) && ( __ARM_ARCH_8_1M_MAIN__ == 1 ) ) && \
684
+ (!defined ( __ARM_FEATURE_CMSE ) || ( __ARM_FEATURE_CMSE < 3 )) )
685
685
/* without main extensions, the non-secure MSPLIM is RAZ/WI */
686
686
(void )MainStackPtrLimit ;
687
687
#else
@@ -690,7 +690,7 @@ __STATIC_FORCEINLINE void __set_MSPLIM(uint32_t MainStackPtrLimit)
690
690
}
691
691
692
692
693
- #if (__ARM_FEATURE_CMSE == 3 )
693
+ #if defined ( __ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3 )
694
694
/**
695
695
\brief Set Main Stack Pointer Limit (non-secure)
696
696
Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure
@@ -701,15 +701,16 @@ __STATIC_FORCEINLINE void __set_MSPLIM(uint32_t MainStackPtrLimit)
701
701
*/
702
702
__STATIC_FORCEINLINE void __TZ_set_MSPLIM_NS (uint32_t MainStackPtrLimit )
703
703
{
704
- #if (( __ARM_ARCH_8M_MAIN__ < 1 ) && \
705
- ( __ARM_ARCH_8_1M_MAIN__ < 1 ) )
704
+ #if (!(defined ( __ARM_ARCH_8M_MAIN__ ) && ( __ARM_ARCH_8M_MAIN__ == 1 ) ) && \
705
+ !(defined ( __ARM_ARCH_8_1M_MAIN__ ) && ( __ARM_ARCH_8_1M_MAIN__ == 1 )) )
706
706
/* without main extensions, the non-secure MSPLIM is RAZ/WI */
707
707
(void )MainStackPtrLimit ;
708
708
#else
709
709
__ASM volatile ("MSR msplim_ns, %0" : : "r" (MainStackPtrLimit ));
710
710
#endif
711
711
}
712
712
#endif
713
+
713
714
#endif /* (__ARM_ARCH >= 8) */
714
715
/** @} end of CMSIS_Core_RegAccFunctions */
715
716
@@ -812,7 +813,7 @@ __STATIC_FORCEINLINE int32_t __SMMLA (int32_t op1, int32_t op2, int32_t op3)
812
813
return (result );
813
814
}
814
815
#endif /* (defined (__ARM_FEATURE_DSP) && (__ARM_FEATURE_DSP == 1)) */
815
- /** @} end of group CMSIS_SIMD_intrinsics */
816
+ /** @} end of group CMSIS_SIMD_intrinsics */
816
817
817
818
818
819
#endif /* __CMSIS_ARMCLANG_M_H */
0 commit comments