Infineon MOTIX™ MCU TLE985x Device Family SDK
cmsis_misra.h
Go to the documentation of this file.
1 /*
2  ***********************************************************************************************************************
3  *
4  * Copyright (c) 2018-2022, Infineon Technologies AG
5  * All rights reserved.
6  *
7  * Redistribution and use in source and binary forms, with or without modification,are permitted provided that the
8  * following conditions are met:
9  *
10  * Redistributions of source code must retain the above copyright notice, this list of conditions and the following
11  * disclaimer.
12  *
13  * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the
14  * following disclaimer in the documentation and/or other materials provided with the distribution.
15  *
16  * Neither the name of the copyright holders nor the names of its contributors may be used to endorse or promote
17  * products derived from this software without specific prior written permission.
18  *
19  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
20  * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21  * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
22  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
23  * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
24  * WHETHER IN CONTRACT, STRICT LIABILITY,OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
25  * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26  *
27  **********************************************************************************************************************/
39 /*******************************************************************************
40 ** Author(s) Identity **
41 ********************************************************************************
42 ** Initials Name **
43 ** ---------------------------------------------------------------------------**
44 ** DM Daniel Mysliwitz **
45 ** BG Blandine Guillot **
46 *******************************************************************************/
47 
48 /*******************************************************************************
49 ** Revision Control History **
50 ********************************************************************************
51 ** V0.1.0: 2018-06-13, DM: Initial version **
52 ** V0.1.1: 2020-03-02, BG: Updated revision history format **
53 ** V0.1.2: 2020-07-28, JO: EP-435: Modified CMSIS_Irq_Dis to be ARM GCC **
54 ** compliant **
55 ** Added include of file core_cm0.h **
56 ** Added function CMSIS_SEV(void); **
57 ** V0.2.0: 2022-01-19, BG: EP-904: Added compatibility with IAR compiler **
58 ** V0.2.1: 2022-01-21, JO: EP-934: Updated copyright and branding **
59 *******************************************************************************/
60 
61 #ifndef _CMSIS_MISRA_H
62 #define _CMSIS_MISRA_H
63 
64 /*******************************************************************************
65 ** Includes **
66 *******************************************************************************/
67 #include "types.h"
68 #include "core_cm0.h"
69 
70 /*******************************************************************************
71 ** Unit Test Declarations **
72 *******************************************************************************/
73 #if defined(TESTING) || defined(UNIT_TESTING_LV2)
74 
75 sint32 CMSIS_Irq_Dis(void);
76 void CMSIS_Irq_En(void);
77 void CMSIS_NOP(void);
78 void CMSIS_WFE(void);
79 void CMSIS_SEV(void);
80 
81 #else
82 
83 /*******************************************************************************
84 ** Global Function Declarations **
85 *******************************************************************************/
86 
91 
95 INLINE void CMSIS_Irq_En(void);
96 
100 INLINE void CMSIS_NOP(void);
101 
105 INLINE void CMSIS_WFE(void);
106 
110 INLINE void CMSIS_SEV(void);
111 
112 
113 /*******************************************************************************
114 ** Global Function Definitions **
115 *******************************************************************************/
116 
118 {
119 /* violation: Symbol '__disable_irq' undeclared, assumed to return int [MISRA Rule 20], [MISRA Rule 71]*/
120 /* violation: call to function '__disable_irq()' not made in the presence of a prototype [MISRA Rule 71] */
121 #if defined ( __CC_ARM )
122  /* ARMCC v5: __CC_ARM */
123  return ((sint32) __disable_irq());
124 #elif defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6000000) || defined (__IAR_SYSTEMS_ICC__)
125  /* ARMCC v6: __ARMCC_VERSION and IAR compiler*/
126  __disable_irq();
127  return 0;
128 #endif
129 }
130 
132 {
133 /* violation: Symbol '__enable_irq' undeclared, assumed to return int [MISRA Rule 20], [MISRA Rule 71]*/
134 /* violation: call to function '__enable_irq()' not made in the presence of a prototype [MISRA Rule 71] */
135  __enable_irq();
136 }
137 
138 INLINE void CMSIS_NOP(void)
139 {
140 /* violation: Symbol '__nop' undeclared, assumed to return int [MISRA Rule 20], [MISRA Rule 71]*/
141 /* violation: call to function '__nop()' not made in the presence of a prototype [MISRA Rule 71] */
142  __NOP();
143 }
144 
145 INLINE void CMSIS_WFE(void)
146 {
147 /* violation: Symbol '__wfe' undeclared, assumed to return int [MISRA Rule 20], [MISRA Rule 71]*/
148 /* violation: call to function '__wfe()' not made in the presence of a prototype [MISRA Rule 71] */
149  __WFE();
150 }
151 
152 INLINE void CMSIS_SEV(void)
153 {
154  /* violation: Symbol '__sev' undeclared, assumed to return int [MISRA Rule 20], [MISRA Rule 71]*/
155  /* violation: call to function '__sev()' not made in the presence of a prototype [MISRA Rule 71] */
156  __SEV();
157 }
158 
159 #endif
160 
161 
162 #endif /*_CMSIS_MISRA_H*/
INLINE sint32 CMSIS_Irq_Dis(void)
Access to the CMSIS intrinsic __disable_irq().
Definition: cmsis_misra.h:117
INLINE void CMSIS_NOP(void)
Access to the CMSIS intrinsic __NOP().
Definition: cmsis_misra.h:138
INLINE void CMSIS_Irq_En(void)
Access to the CMSIS intrinsic __enable_irq().
Definition: cmsis_misra.h:131
INLINE void CMSIS_SEV(void)
Access to the CMSIS intrinsic __SEV().
Definition: cmsis_misra.h:152
INLINE void CMSIS_WFE(void)
Access to the CMSIS intrinsic __WFE().
Definition: cmsis_misra.h:145
General type declarations.
#define INLINE
Definition: types.h:145
int32_t sint32
32 bit signed value
Definition: types.h:160