TLE986x Device Family SDK
cmsis_misra.h
Go to the documentation of this file.
1 /*
2  ***********************************************************************************************************************
3  *
4  * Copyright (c) 2015, 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 ** JO Julia Ott **
46 ** BG Blandine Guillot **
47 *******************************************************************************/
48 
49 /*******************************************************************************
50 ** Revision Control History **
51 ********************************************************************************
52 ** V0.1.0: 2018-06-13, DM: Initial version **
53 ** V0.1.1: 2019-04-18, JO: Modified CMSIS_Irq_Dis to be ARM GCC compliant **
54 ** V0.1.2: 2020-04-15, BG: Updated revision history **
55 ** V0.1.3: 2020-04-17, BG: Added inline function CMSIS_SEV() **
56 ** V0.1.4: 2020-10-12, JO: EP-506: remove ARMCC v6 Compiler warnings **
57 ** - Added typecast in CMSIS_Irq_Dis() to **
58 ** prevent ARMCC v6 compiler warning **
59 *******************************************************************************/
60 
61 #ifndef _CMSIS_MISRA_H
62 #define _CMSIS_MISRA_H
63 
64 /*******************************************************************************
65 ** Includes **
66 *******************************************************************************/
67 #include "types.h"
68 #include "core_cm3.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 ) || (defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6000000))
122  /* ARMCC Compiler */
123  return ( (sint32)__disable_irq() );
124 #else
125  /* ARM GCC Compiler */
126  /* __disable_irq doesn't have a return value in ARM GCC */
127  /* always return zero to make sure interrupts are enabled again */
128  __disable_irq();
129  return 0;
130 #endif
131 }
132 
133 INLINE void CMSIS_Irq_En(void)
134 {
135  /* violation: Symbol '__enable_irq' undeclared, assumed to return int [MISRA Rule 20], [MISRA Rule 71]*/
136  /* violation: call to function '__enable_irq()' not made in the presence of a prototype [MISRA Rule 71] */
137  __enable_irq();
138 }
139 
140 INLINE void CMSIS_NOP(void)
141 {
142  /* violation: Symbol '__nop' undeclared, assumed to return int [MISRA Rule 20], [MISRA Rule 71]*/
143  /* violation: call to function '__nop()' not made in the presence of a prototype [MISRA Rule 71] */
144  __NOP();
145 }
146 
147 INLINE void CMSIS_WFE(void)
148 {
149  /* violation: Symbol '__wfe' undeclared, assumed to return int [MISRA Rule 20], [MISRA Rule 71]*/
150  /* violation: call to function '__wfe()' not made in the presence of a prototype [MISRA Rule 71] */
151  __WFE();
152 }
153 
154 INLINE void CMSIS_SEV(void)
155 {
156  /* violation: Symbol '__sev' undeclared, assumed to return int [MISRA Rule 20], [MISRA Rule 71]*/
157  /* violation: call to function '__sev()' not made in the presence of a prototype [MISRA Rule 71] */
158  __SEV();
159 }
160 
161 #endif
162 
163 
164 #endif /*_CMSIS_MISRA_H*/
types.h
General type declarations.
CMSIS_Irq_En
INLINE void CMSIS_Irq_En(void)
Access to the CMSIS intrinsic __enable_irq().
Definition: cmsis_misra.h:130
CMSIS_SEV
INLINE void CMSIS_SEV(void)
Access to the CMSIS intrinsic __SEV().
Definition: cmsis_misra.h:151
INLINE
#define INLINE
Definition: types.h:134
CMSIS_Irq_Dis
INLINE sint32 CMSIS_Irq_Dis(void)
Access to the CMSIS intrinsic __disable_irq().
Definition: cmsis_misra.h:114
CMSIS_WFE
INLINE void CMSIS_WFE(void)
Access to the CMSIS intrinsic __WFE().
Definition: cmsis_misra.h:144
CMSIS_NOP
INLINE void CMSIS_NOP(void)
Access to the CMSIS intrinsic __NOP().
Definition: cmsis_misra.h:137
sint32
signed int sint32
32 bit signed value
Definition: types.h:146