STM MATLAB Simulator
Loading...
Searching...
No Matches
arm_defines.h
Go to the documentation of this file.
1#define __disable_irq()
2
3#ifndef __ASM
4 #define __ASM __asm
5#endif
6
7#ifndef __IO
8 #define __IO volatile
9#endif
10
11#ifndef __inline
12 #define __inline inline
13#endif
14#ifndef __INLINE
15 #define __INLINE __inline
16#endif
17
18#ifndef __STATIC_INLINE
19 #define __STATIC_INLINE static __inline
20#endif
21
22#ifndef __STATIC_FORCEINLINE
23 #define __STATIC_FORCEINLINE static __forceinline
24#endif
25
26#ifndef __NO_RETURN
27 #define __NO_RETURN __declspec(noreturn)
28#endif
29
30#ifndef __USED
31 #define __USED __attribute__((used))
32#endif
33
34
35#ifndef __WEAK
36 #define __WEAK __declspec(selectany)
37// #define __weak __WEAK
38#endif
39
40#ifndef __PACKED
41 #define __PACKED __attribute__((packed))
42#endif
43
44#ifndef __PACKED_STRUCT
45 #define __PACKED_STRUCT __packed struct
46#endif
47
48#ifndef __PACKED_UNION
49 #define __PACKED_UNION __packed union
50#endif
51
52#ifndef __UNALIGNED_UINT32 /* deprecated */
53 #define __UNALIGNED_UINT32(x) (*((__packed uint32_t *)(x)))
54#endif
55
56#ifndef __UNALIGNED_UINT16_WRITE
57 #define __UNALIGNED_UINT16_WRITE(addr, val) ((*((__packed uint16_t *)(addr))) = (val))
58#endif
59
60#ifndef __UNALIGNED_UINT16_READ
61 #define __UNALIGNED_UINT16_READ(addr) (*((const __packed uint16_t *)(addr)))
62#endif
63
64#ifndef __UNALIGNED_UINT32_WRITE
65 #define __UNALIGNED_UINT32_WRITE(addr, val) ((*((__packed uint32_t *)(addr))) = (val))
66#endif
67
68#ifndef __UNALIGNED_UINT32_READ
69 #define __UNALIGNED_UINT32_READ(addr) (*((const __packed uint32_t *)(addr)))
70#endif
71
72#ifndef __ALIGNED
73 #define __ALIGNED(x) __attribute__((aligned(x)))
74#endif
75
76#ifndef __RESTRICT
77 #define __RESTRICT __restrict
78#endif
79
80#ifndef __weak
81 #define __weak
82#endif
83//#define __ASM()
84//#define __DSB()
85//#define __ISB()
86//#define __NOP()
87//#define __WFI()
88//#define __SEV()
89//#define __WFE()
90//#define __DMB()
91
92
93
98#define __NOP()
103#define __WFI()
104
110#define __WFE()
111
116#define __SEV()
117
124#define __ISB()
125
131#define __DSB()
132
133
139#define __DMB()
140
141
148#define __REV(value) value
149
150
157#define __REV16(value) value
158
159
166#define __REVSH(value) value
167
168
176#define __ROR()
177
178
186#define __BKPT(value) value
187
188
195#define __RBIT() _byteswap_ulong(_rotr(value, 16))
196
203#define __CLZ() __lzcnt(value)
204
205
212#define __LDREXB(ptr) (*(volatile uint8_t *)(ptr))
213
214
221#define __LDREXH(ptr) (*(volatile uint16_t *)(ptr))
222
223
230#define __LDREXW(ptr) (*(volatile uint32_t *)(ptr))
231
232
241#define __STREXB(value, ptr) (*(volatile uint8_t *)(ptr) = (value), 0)
242
243
252#define __STREXH(value, ptr) (*(volatile uint16_t *)(ptr) = (value), 0)
253
254
263#define __STREXW(value, ptr) (*(volatile uint32_t *)(ptr) = (value), 0)
264
265
270#define __CLREX
271
272
273
281#define __SSAT
282
283
291#define __USAT
292