MCUX CLNS
MCUX Crypto Library Normal Secure
Loading...
Searching...
No Matches
cmsis_ghs.h
Go to the documentation of this file.
1/**************************************************************************/
7/*
8 * Copyright (c) 2009-2018 Arm Limited. All rights reserved.
9 *
10 * SPDX-License-Identifier: Apache-2.0
11 *
12 * Licensed under the Apache License, Version 2.0 (the License); you may
13 * not use this file except in compliance with the License.
14 * You may obtain a copy of the License at
15 *
16 * www.apache.org/licenses/LICENSE-2.0
17 *
18 * Unless required by applicable law or agreed to in writing, software
19 * distributed under the License is distributed on an AS IS BASIS, WITHOUT
20 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
21 * See the License for the specific language governing permissions and
22 * limitations under the License.
23 */
24
25#ifndef __CMSIS_GHS_H
26#define __CMSIS_GHS_H
27
28/* ignore some GHS warnings */
29//#pragma ghs nowarning 68
30//#pragma ghs diagnostic ignored "-Wconversion"
31//#pragma ghs diagnostic ignored "-Wunused-parameter"
32
33/* Fallback for __has_builtin */
34#ifndef __has_builtin
35 #define __has_builtin(x) (0)
36#endif
37
38/* CMSIS compiler specific defines */
39#ifndef __ASM
40 #define __ASM __asm
41#endif
42#ifndef __INLINE
43 #define __INLINE inline
44#endif
45#ifndef __STATIC_INLINE
46 #define __STATIC_INLINE static inline
47#endif
48#ifndef __STATIC_FORCEINLINE
49 #define __STATIC_FORCEINLINE __attribute__((always_inline)) static inline
50#endif
51#ifndef __NO_RETURN
52 #define __NO_RETURN __attribute__((noreturn))
53#endif
54#ifndef __USED
55 #define __USED __attribute__((used))
56#endif
57#ifndef __WEAK
58 #define __WEAK __attribute__((weak))
59#endif
60#ifndef __PACKED
61 #define __PACKED __attribute__((packed, aligned(1)))
62#endif
63#ifndef __PACKED_STRUCT
64 #define __PACKED_STRUCT struct __attribute__((packed, aligned(1)))
65#endif
66#ifndef __PACKED_UNION
67 #define __PACKED_UNION union __attribute__((packed, aligned(1)))
68#endif
69#ifndef __UNALIGNED_UINT32 /* deprecated */
70// #pragma ghs diagnostic push
71// #pragma ghs diagnostic ignored "-Wpacked"
72// #pragma ghs diagnostic ignored "-Wattributes"
73 struct __attribute__((packed)) T_UINT32 { uint32_t v; };
74// #pragma ghs diagnostic pop
75 #define __UNALIGNED_UINT32(x) (((struct T_UINT32 *)(x))->v)
76#endif
77#ifndef __UNALIGNED_UINT16_WRITE
78// #pragma ghs diagnostic push
79// #pragma ghs diagnostic ignored "-Wpacked"
80// #pragma ghs diagnostic ignored "-Wattributes"
81 __PACKED_STRUCT T_UINT16_WRITE { uint16_t v; };
82// #pragma ghs diagnostic pop
83 #define __UNALIGNED_UINT16_WRITE(addr, val) (void)((((struct T_UINT16_WRITE *)(void *)(addr))->v) = (val))
84#endif
85#ifndef __UNALIGNED_UINT16_READ
86// #pragma ghs diagnostic push
87// #pragma ghs diagnostic ignored "-Wpacked"
88// #pragma ghs diagnostic ignored "-Wattributes"
89 __PACKED_STRUCT T_UINT16_READ { uint16_t v; };
90// #pragma ghs diagnostic pop
91 #define __UNALIGNED_UINT16_READ(addr) (((const struct T_UINT16_READ *)(const void *)(addr))->v)
92#endif
93#ifndef __UNALIGNED_UINT32_WRITE
94// #pragma ghs diagnostic push
95// #pragma ghs diagnostic ignored "-Wpacked"
96// #pragma ghs diagnostic ignored "-Wattributes"
97 __PACKED_STRUCT T_UINT32_WRITE { uint32_t v; };
98// #pragma ghs diagnostic pop
99 #define __UNALIGNED_UINT32_WRITE(addr, val) (void)((((struct T_UINT32_WRITE *)(void *)(addr))->v) = (val))
100#endif
101#ifndef __UNALIGNED_UINT32_READ
102// #pragma ghs diagnostic push
103// #pragma ghs diagnostic ignored "-Wpacked"
104// #pragma ghs diagnostic ignored "-Wattributes"
105 __PACKED_STRUCT T_UINT32_READ { uint32_t v; };
106// #pragma ghs diagnostic pop
107 #define __UNALIGNED_UINT32_READ(addr) (((const struct T_UINT32_READ *)(const void *)(addr))->v)
108#endif
109#ifndef __ALIGNED
110 #define __ALIGNED(x) __attribute__((aligned(x)))
111#endif
112#ifndef __RESTRICT
113 #define __RESTRICT restrict
114#endif
115
116
117/* ########################### Core Function Access ########################### */
122
128__STATIC_FORCEINLINE void __enable_irq(void)
129{
130 __ASM volatile ("cpsie i" : : : "memory");
131}
132
133
139__STATIC_FORCEINLINE void __disable_irq(void)
140{
141 __ASM volatile ("cpsid i" : : : "memory");
142}
143
144
150__STATIC_FORCEINLINE uint32_t __get_CONTROL(void)
151{
152 uint32_t result;
153
154 __ASM volatile ("MRS %0, control" : "=r" (result) );
155 return(result);
156}
157
158
159#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3))
165__STATIC_FORCEINLINE uint32_t __TZ_get_CONTROL_NS(void)
166{
167 uint32_t result;
168
169 __ASM volatile ("MRS %0, control_ns" : "=r" (result) );
170 return(result);
171}
172#endif
173
174
180__STATIC_FORCEINLINE void __set_CONTROL(uint32_t control)
181{
182 __ASM volatile ("MSR control, %0" : : "r" (control) : "memory");
183}
184
185
186#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3))
192__STATIC_FORCEINLINE void __TZ_set_CONTROL_NS(uint32_t control)
193{
194 __ASM volatile ("MSR control_ns, %0" : : "r" (control) : "memory");
195}
196#endif
197
198
204__STATIC_FORCEINLINE uint32_t __get_IPSR(void)
205{
206 uint32_t result;
207
208 __ASM volatile ("MRS %0, ipsr" : "=r" (result) );
209 return(result);
210}
211
212
218__STATIC_FORCEINLINE uint32_t __get_APSR(void)
219{
220 uint32_t result;
221
222 __ASM volatile ("MRS %0, apsr" : "=r" (result) );
223 return(result);
224}
225
226
232__STATIC_FORCEINLINE uint32_t __get_xPSR(void)
233{
234 uint32_t result;
235
236 __ASM volatile ("MRS %0, xpsr" : "=r" (result) );
237 return(result);
238}
239
240
246__STATIC_FORCEINLINE uint32_t __get_PSP(void)
247{
248 uint32_t result;
249
250 __ASM volatile ("MRS %0, psp" : "=r" (result) );
251 return(result);
252}
253
254
255#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3))
261__STATIC_FORCEINLINE uint32_t __TZ_get_PSP_NS(void)
262{
263 uint32_t result;
264
265 __ASM volatile ("MRS %0, psp_ns" : "=r" (result) );
266 return(result);
267}
268#endif
269
270
276__STATIC_FORCEINLINE void __set_PSP(uint32_t topOfProcStack)
277{
278 __ASM volatile ("MSR psp, %0" : : "r" (topOfProcStack));
279}
280
281
282#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3))
288__STATIC_FORCEINLINE void __TZ_set_PSP_NS(uint32_t topOfProcStack)
289{
290 __ASM volatile ("MSR psp_ns, %0" : : "r" (topOfProcStack));
291}
292#endif
293
294
300__STATIC_FORCEINLINE uint32_t __get_MSP(void)
301{
302 uint32_t result;
303
304 __ASM volatile ("MRS %0, msp" : "=r" (result) );
305 return(result);
306}
307
308
309#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3))
315__STATIC_FORCEINLINE uint32_t __TZ_get_MSP_NS(void)
316{
317 uint32_t result;
318
319 __ASM volatile ("MRS %0, msp_ns" : "=r" (result) );
320 return(result);
321}
322#endif
323
324
330__STATIC_FORCEINLINE void __set_MSP(uint32_t topOfMainStack)
331{
332 __ASM volatile ("MSR msp, %0" : : "r" (topOfMainStack));
333}
334
335
336#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3))
342__STATIC_FORCEINLINE void __TZ_set_MSP_NS(uint32_t topOfMainStack)
343{
344 __ASM volatile ("MSR msp_ns, %0" : : "r" (topOfMainStack));
345}
346#endif
347
348
349#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3))
355__STATIC_FORCEINLINE uint32_t __TZ_get_SP_NS(void)
356{
357 uint32_t result;
358
359 __ASM volatile ("MRS %0, sp_ns" : "=r" (result) );
360 return(result);
361}
362
363
369__STATIC_FORCEINLINE void __TZ_set_SP_NS(uint32_t topOfStack)
370{
371 __ASM volatile ("MSR sp_ns, %0" : : "r" (topOfStack));
372}
373#endif
374
375
381__STATIC_FORCEINLINE uint32_t __get_PRIMASK(void)
382{
383 uint32_t result;
384
385 __ASM volatile ("MRS %0, primask" : "=r" (result) :: "memory");
386 return(result);
387}
388
389
390#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3))
396__STATIC_FORCEINLINE uint32_t __TZ_get_PRIMASK_NS(void)
397{
398 uint32_t result;
399
400 __ASM volatile ("MRS %0, primask_ns" : "=r" (result) :: "memory");
401 return(result);
402}
403#endif
404
405
411__STATIC_FORCEINLINE void __set_PRIMASK(uint32_t priMask)
412{
413 __ASM volatile ("MSR primask, %0" : : "r" (priMask) : "memory");
414}
415
416
417#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3))
423__STATIC_FORCEINLINE void __TZ_set_PRIMASK_NS(uint32_t priMask)
424{
425 __ASM volatile ("MSR primask_ns, %0" : : "r" (priMask) : "memory");
426}
427#endif
428
429
430#if ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \
431 (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \
432 (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) )
438__STATIC_FORCEINLINE void __enable_fault_irq(void)
439{
440 __ASM volatile ("cpsie f" : : : "memory");
441}
442
443
449__STATIC_FORCEINLINE void __disable_fault_irq(void)
450{
451 __ASM volatile ("cpsid f" : : : "memory");
452}
453
454
460__STATIC_FORCEINLINE uint32_t __get_BASEPRI(void)
461{
462 uint32_t result;
463
464 __ASM volatile ("MRS %0, basepri" : "=r" (result) );
465 return(result);
466}
467
468
469#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3))
475__STATIC_FORCEINLINE uint32_t __TZ_get_BASEPRI_NS(void)
476{
477 uint32_t result;
478
479 __ASM volatile ("MRS %0, basepri_ns" : "=r" (result) );
480 return(result);
481}
482#endif
483
484
490__STATIC_FORCEINLINE void __set_BASEPRI(uint32_t basePri)
491{
492 __ASM volatile ("MSR basepri, %0" : : "r" (basePri) : "memory");
493}
494
495
496#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3))
502__STATIC_FORCEINLINE void __TZ_set_BASEPRI_NS(uint32_t basePri)
503{
504 __ASM volatile ("MSR basepri_ns, %0" : : "r" (basePri) : "memory");
505}
506#endif
507
508
515__STATIC_FORCEINLINE void __set_BASEPRI_MAX(uint32_t basePri)
516{
517 __ASM volatile ("MSR basepri_max, %0" : : "r" (basePri) : "memory");
518}
519
520
526__STATIC_FORCEINLINE uint32_t __get_FAULTMASK(void)
527{
528 uint32_t result;
529
530 __ASM volatile ("MRS %0, faultmask" : "=r" (result) );
531 return(result);
532}
533
534
535#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3))
541__STATIC_FORCEINLINE uint32_t __TZ_get_FAULTMASK_NS(void)
542{
543 uint32_t result;
544
545 __ASM volatile ("MRS %0, faultmask_ns" : "=r" (result) );
546 return(result);
547}
548#endif
549
550
556__STATIC_FORCEINLINE void __set_FAULTMASK(uint32_t faultMask)
557{
558 __ASM volatile ("MSR faultmask, %0" : : "r" (faultMask) : "memory");
559}
560
561
562#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3))
568__STATIC_FORCEINLINE void __TZ_set_FAULTMASK_NS(uint32_t faultMask)
569{
570 __ASM volatile ("MSR faultmask_ns, %0" : : "r" (faultMask) : "memory");
571}
572#endif
573
574#endif /* ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \
575 (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \
576 (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) ) */
577
578
579#if ((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \
580 (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) )
581
591__STATIC_FORCEINLINE uint32_t __get_PSPLIM(void)
592{
593#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \
594 (!defined (__ARM_FEATURE_CMSE) || (__ARM_FEATURE_CMSE < 3)))
595 // without main extensions, the non-secure PSPLIM is RAZ/WI
596 return 0U;
597#else
598 uint32_t result;
599 __ASM volatile ("MRS %0, psplim" : "=r" (result) );
600 return result;
601#endif
602}
603
604#if (defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3))
613__STATIC_FORCEINLINE uint32_t __TZ_get_PSPLIM_NS(void)
614{
615#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)))
616 // without main extensions, the non-secure PSPLIM is RAZ/WI
617 return 0U;
618#else
619 uint32_t result;
620 __ASM volatile ("MRS %0, psplim_ns" : "=r" (result) );
621 return result;
622#endif
623}
624#endif
625
626
636__STATIC_FORCEINLINE void __set_PSPLIM(uint32_t ProcStackPtrLimit)
637{
638#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \
639 (!defined (__ARM_FEATURE_CMSE) || (__ARM_FEATURE_CMSE < 3)))
640 // without main extensions, the non-secure PSPLIM is RAZ/WI
641 (void)ProcStackPtrLimit;
642#else
643 __ASM volatile ("MSR psplim, %0" : : "r" (ProcStackPtrLimit));
644#endif
645}
646
647
648#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3))
657__STATIC_FORCEINLINE void __TZ_set_PSPLIM_NS(uint32_t ProcStackPtrLimit)
658{
659#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)))
660 // without main extensions, the non-secure PSPLIM is RAZ/WI
661 (void)ProcStackPtrLimit;
662#else
663 __ASM volatile ("MSR psplim_ns, %0\n" : : "r" (ProcStackPtrLimit));
664#endif
665}
666#endif
667
668
678__STATIC_FORCEINLINE uint32_t __get_MSPLIM(void)
679{
680#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \
681 (!defined (__ARM_FEATURE_CMSE) || (__ARM_FEATURE_CMSE < 3)))
682 // without main extensions, the non-secure MSPLIM is RAZ/WI
683 return 0U;
684#else
685 uint32_t result;
686 __ASM volatile ("MRS %0, msplim" : "=r" (result) );
687 return result;
688#endif
689}
690
691
692#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3))
701__STATIC_FORCEINLINE uint32_t __TZ_get_MSPLIM_NS(void)
702{
703#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)))
704 // without main extensions, the non-secure MSPLIM is RAZ/WI
705 return 0U;
706#else
707 uint32_t result;
708 __ASM volatile ("MRS %0, msplim_ns" : "=r" (result) );
709 return result;
710#endif
711}
712#endif
713
714
724__STATIC_FORCEINLINE void __set_MSPLIM(uint32_t MainStackPtrLimit)
725{
726#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \
727 (!defined (__ARM_FEATURE_CMSE) || (__ARM_FEATURE_CMSE < 3)))
728 // without main extensions, the non-secure MSPLIM is RAZ/WI
729 (void)MainStackPtrLimit;
730#else
731 __ASM volatile ("MSR msplim, %0" : : "r" (MainStackPtrLimit));
732#endif
733}
734
735
736#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3))
745__STATIC_FORCEINLINE void __TZ_set_MSPLIM_NS(uint32_t MainStackPtrLimit)
746{
747#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)))
748 // without main extensions, the non-secure MSPLIM is RAZ/WI
749 (void)MainStackPtrLimit;
750#else
751 __ASM volatile ("MSR msplim_ns, %0" : : "r" (MainStackPtrLimit));
752#endif
753}
754#endif
755
756#endif /* ((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \
757 (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) ) */
758
759
765__STATIC_FORCEINLINE uint32_t __get_FPSCR(void)
766{
767#if ((defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U)) && \
768 (defined (__FPU_USED ) && (__FPU_USED == 1U)) )
769#if __has_builtin(__builtin_arm_get_fpscr)
770// Re-enable using built-in when GCC has been fixed
771// || (__GNUC__ > 7) || (__GNUC__ == 7 && __GNUC_MINOR__ >= 2)
772 /* see https://gcc.gnu.org/ml/gcc-patches/2017-04/msg00443.html */
773 return __builtin_arm_get_fpscr();
774#else
775 uint32_t result;
776
777 __ASM volatile ("VMRS %0, fpscr" : "=r" (result) );
778 return(result);
779#endif
780#else
781 return(0U);
782#endif
783}
784
785
791__STATIC_FORCEINLINE void __set_FPSCR(uint32_t fpscr)
792{
793#if ((defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U)) && \
794 (defined (__FPU_USED ) && (__FPU_USED == 1U)) )
795#if __has_builtin(__builtin_arm_set_fpscr)
796// Re-enable using built-in when GCC has been fixed
797// || (__GNUC__ > 7) || (__GNUC__ == 7 && __GNUC_MINOR__ >= 2)
798 /* see https://gcc.gnu.org/ml/gcc-patches/2017-04/msg00443.html */
799 __builtin_arm_set_fpscr(fpscr);
800#else
801 __ASM volatile ("VMSR fpscr, %0" : : "r" (fpscr) : "vfpcc", "memory");
802#endif
803#else
804 (void)fpscr;
805#endif
806}
807
808
810
811
812/* ########################## Core Instruction Access ######################### */
817
818#include <arm_ghs.h>
819
820/* Define macros for porting to both thumb1 and thumb2.
821 * For thumb1, use low register (r0-r7), specified by constraint "l"
822 * Otherwise, use general registers, specified by constraint "r" */
823#if defined (__thumb__) && !defined (__thumb2__)
824#define __CMSIS_GHS_OUT_REG(r) "=l" (r)
825#define __CMSIS_GHS_RW_REG(r) "+l" (r)
826#define __CMSIS_GHS_USE_REG(r) "l" (r)
827#else
828#define __CMSIS_GHS_OUT_REG(r) "=r" (r)
829#define __CMSIS_GHS_RW_REG(r) "+r" (r)
830#define __CMSIS_GHS_USE_REG(r) "r" (r)
831#endif
832
840__STATIC_FORCEINLINE uint32_t __ROR(uint32_t op1, uint32_t op2)
841{
842 op2 %= 32U;
843 if (op2 == 0U)
844 {
845 return op1;
846 }
847 return (op1 >> op2) | (op1 << (32U - op2));
848}
849
850
857__STATIC_FORCEINLINE uint8_t __CLZ_internal(uint32_t value)
858{
859 /* Even though __builtin_clz produces a CLZ instruction on ARM, formally
860 __builtin_clz(0) is undefined behaviour, so handle this case specially.
861 This guarantees ARM-compatible results if happening to compile on a non-ARM
862 target, and ensures the compiler doesn't decide to activate any
863 optimisations using the logic "value was passed to __builtin_clz, so it
864 is non-zero".
865 ARM GCC 7.3 and possibly earlier will optimise this test away, leaving a
866 single CLZ instruction.
867 */
868 if (value == 0U)
869 {
870 return 32U;
871 }
872 return __CLZ32(value);
873}
874#define __CLZ __CLZ_internal
875
876//#pragma ghs endnowarning 68
877
878
879#endif /* __CMSIS_GHS_H */
__STATIC_INLINE void __set_CONTROL(uint32_t control)
Set Control Register.
Definition cmsis_armcc.h:146
__STATIC_INLINE void __set_MSP(uint32_t topOfMainStack)
Set Main Stack Pointer.
Definition cmsis_armcc.h:230
__STATIC_INLINE void __set_PSP(uint32_t topOfProcStack)
Set Process Stack Pointer.
Definition cmsis_armcc.h:206
#define __set_FPSCR(x)
Set FPSCR.
Definition cmsis_armclang.h:766
#define __get_FPSCR()
Get FPSCR.
Definition cmsis_armclang.h:754
__STATIC_INLINE uint32_t __get_PRIMASK(void)
Get Priority Mask.
Definition cmsis_armcc.h:242
#define __enable_irq
Enable IRQ Interrupts.
Definition cmsis_iccarm.h:549
__STATIC_INLINE uint32_t __get_MSP(void)
Get Main Stack Pointer.
Definition cmsis_armcc.h:218
__STATIC_INLINE uint32_t __get_CONTROL(void)
Enable IRQ Interrupts.
Definition cmsis_armcc.h:134
__STATIC_INLINE uint32_t __get_PSP(void)
Get Process Stack Pointer.
Definition cmsis_armcc.h:194
#define __disable_irq
Disable IRQ Interrupts.
Definition cmsis_iccarm.h:550
__STATIC_INLINE uint32_t __get_APSR(void)
Get APSR Register.
Definition cmsis_armcc.h:170
#define __get_xPSR
Get xPSR Register.
Definition cmsis_iccarm.h:553
__STATIC_INLINE uint32_t __get_IPSR(void)
Get IPSR Register.
Definition cmsis_armcc.h:158
__STATIC_INLINE void __set_PRIMASK(uint32_t priMask)
Set Priority Mask.
Definition cmsis_armcc.h:254
__STATIC_FORCEINLINE uint8_t __CLZ_internal(uint32_t value)
Count leading zeros.
Definition cmsis_ghs.h:857
#define __ROR
Rotate Right in unsigned value (32 bit).
Definition cmsis_armcc.h:497
__attribute__((section(".rev16_text"))) __STATIC_INLINE __ASM uint32_t __REV16(uint32_t value)
Reverse byte order (16 bit).
Definition cmsis_armcc.h:467