 |
S32 SDK
|
Go to the documentation of this file.
45 #if !defined (CORE_CM4_H)
57 #define INT_VECTOR_Reg S32_SCB->VTOR
63 #define BKPT_ASM __asm("BKPT #0\n\t")
70 #if defined (__GNUC__)
71 #if defined (__VFP_FP__) && !defined (__SOFTFP__)
75 #elif defined (__ICCARM__)
76 #if defined __ARMVFP__
80 #elif defined (__ghs__) || defined (__DCC__)
85 #elif defined (__CSMC__)
86 #if (__CSMC__ & 0x400U)
94 #if defined (__GNUC__)
95 #define ENABLE_INTERRUPTS() __asm volatile ("cpsie i" : : : "memory");
97 #define ENABLE_INTERRUPTS() __asm("cpsie i")
103 #if defined (__GNUC__)
104 #define DISABLE_INTERRUPTS() __asm volatile ("cpsid i" : : : "memory");
106 #define DISABLE_INTERRUPTS() __asm("cpsid i")
113 #if defined (__GNUC__)
114 #define STANDBY() __asm volatile ("wfi")
116 #define STANDBY() __asm("wfi")
122 #if defined (__GNUC__) || defined (__ICCARM__) || defined (__ghs__)
123 #define REV_BYTES_32(a, b) __asm volatile ("rev %0, %1" : "=r" (b) : "r" (a))
125 #define REV_BYTES_32(a, b) (b = ((a & 0xFF000000U) >> 24U) | ((a & 0xFF0000U) >> 8U) \
126 | ((a & 0xFF00U) << 8U) | ((a & 0xFFU) << 24U))
131 #if defined (__GNUC__) || defined (__ICCARM__) || defined (__ghs__)
132 #define REV_BYTES_16(a, b) __asm volatile ("rev16 %0, %1" : "=r" (b) : "r" (a))
134 #define REV_BYTES_16(a, b) (b = ((a & 0xFF000000U) >> 8U) | ((a & 0xFF0000U) << 8U) \
135 | ((a & 0xFF00U) >> 8U) | ((a & 0xFFU) << 8U))
140 #if defined ( __GNUC__ )
141 #define START_FUNCTION_DECLARATION_RAMSECTION
142 #define END_FUNCTION_DECLARATION_RAMSECTION __attribute__((section (".code_ram")));
143 #elif defined ( __ghs__ )
144 #define START_FUNCTION_DECLARATION_RAMSECTION _Pragma("ghs callmode=far")
145 #define END_FUNCTION_DECLARATION_RAMSECTION __attribute__((section (".code_ram")));\
146 _Pragma("ghs callmode=default")
147 #elif defined ( __ICCARM__ )
148 #define START_FUNCTION_DECLARATION_RAMSECTION __ramfunc
149 #define END_FUNCTION_DECLARATION_RAMSECTION ;
150 #elif defined ( __DCC__ )
151 #define START_FUNCTION_DECLARATION_RAMSECTION _Pragma("section CODE \".code_ram\"") \
152 _Pragma("use_section CODE")
153 #define END_FUNCTION_DECLARATION_RAMSECTION ; \
154 _Pragma("section CODE \".text\"")
155 #elif defined ( __CSMC__ )
156 #define START_FUNCTION_DECLARATION_RAMSECTION @ext
157 #define END_FUNCTION_DECLARATION_RAMSECTION ;
160 #define START_FUNCTION_DECLARATION_RAMSECTION
161 #define END_FUNCTION_DECLARATION_RAMSECTION ;
164 #if defined ( __CSMC__ )
165 #define START_FUNCTION_DEFINITION_RAMSECTION _Pragma("section (code_ram)")
166 #define END_FUNCTION_DEFINITION_RAMSECTION _Pragma("section ()")
171 #define START_FUNCTION_DEFINITION_RAMSECTION
172 #define END_FUNCTION_DEFINITION_RAMSECTION
175 #if defined (__ICCARM__)
176 #define DISABLE_CHECK_RAMSECTION_FUNCTION_CALL _Pragma("diag_suppress=Ta022")
177 #define ENABLE_CHECK_RAMSECTION_FUNCTION_CALL _Pragma("diag_default=Ta022")
179 #define DISABLE_CHECK_RAMSECTION_FUNCTION_CALL
180 #define ENABLE_CHECK_RAMSECTION_FUNCTION_CALL
186 #if defined ( __GNUC__ ) || defined ( __ghs__ ) || defined ( __DCC__ )
187 #define ALIGNED(x) __attribute__((aligned(x)))
188 #elif defined ( __ICCARM__ )
189 #define stringify(s) tostring(s)
190 #define tostring(s) #s
191 #define ALIGNED(x) _Pragma(stringify(data_alignment=x))
199 #define CORE_LITTLE_ENDIAN