10
10
///
11
11
/// Enables IRQ interrupts by clearing the I-bit in the CPSR. Can only be
12
12
/// executed in Privileged modes.
13
- #[ inline( always) ]
13
+ #[ inline]
14
+ #[ target_feature( enable = "mclass" ) ]
14
15
pub unsafe fn __enable_irq ( ) {
15
16
asm ! ( "cpsie i" : : : "memory" : "volatile" ) ;
16
17
}
@@ -19,15 +20,17 @@ pub unsafe fn __enable_irq() {
19
20
///
20
21
/// Disables IRQ interrupts by setting the I-bit in the CPSR. Can only be
21
22
/// executed in Privileged modes.
22
- #[ inline( always) ]
23
+ #[ inline]
24
+ #[ target_feature( enable = "mclass" ) ]
23
25
pub unsafe fn __disable_irq ( ) {
24
26
asm ! ( "cpsid i" : : : "memory" : "volatile" ) ;
25
27
}
26
28
27
29
/// Get Control Register
28
30
///
29
31
/// Returns the content of the Control Register.
30
- #[ inline( always) ]
32
+ #[ inline]
33
+ #[ target_feature( enable = "mclass" ) ]
31
34
pub unsafe fn __get_CONTROL ( ) -> u32 {
32
35
let result: u32 ;
33
36
asm ! ( "mrs $0, CONTROL" : "=r" ( result) : : : "volatile" ) ;
@@ -37,15 +40,17 @@ pub unsafe fn __get_CONTROL() -> u32 {
37
40
/// Set Control Register
38
41
///
39
42
/// Writes the given value to the Control Register.
40
- #[ inline( always) ]
43
+ #[ inline]
44
+ #[ target_feature( enable = "mclass" ) ]
41
45
pub unsafe fn __set_CONTROL ( control : u32 ) {
42
46
asm ! ( "msr CONTROL, $0" : : "r" ( control) : "memory" : "volatile" ) ;
43
47
}
44
48
45
49
/// Get IPSR Register
46
50
///
47
51
/// Returns the content of the IPSR Register.
48
- #[ inline( always) ]
52
+ #[ inline]
53
+ #[ target_feature( enable = "mclass" ) ]
49
54
pub unsafe fn __get_IPSR ( ) -> u32 {
50
55
let result: u32 ;
51
56
asm ! ( "mrs $0, IPSR" : "=r" ( result) : : : "volatile" ) ;
@@ -55,7 +60,8 @@ pub unsafe fn __get_IPSR() -> u32 {
55
60
/// Get APSR Register
56
61
///
57
62
/// Returns the content of the APSR Register.
58
- #[ inline( always) ]
63
+ #[ inline]
64
+ #[ target_feature( enable = "mclass" ) ]
59
65
pub unsafe fn __get_APSR ( ) -> u32 {
60
66
let result: u32 ;
61
67
asm ! ( "mrs $0, APSR" : "=r" ( result) : : : "volatile" ) ;
@@ -65,7 +71,8 @@ pub unsafe fn __get_APSR() -> u32 {
65
71
/// Get xPSR Register
66
72
///
67
73
/// Returns the content of the xPSR Register.
68
- #[ inline( always) ]
74
+ #[ inline]
75
+ #[ target_feature( enable = "mclass" ) ]
69
76
pub unsafe fn __get_xPSR ( ) -> u32 {
70
77
let result: u32 ;
71
78
asm ! ( "mrs $0, XPSR" : "=r" ( result) : : : "volatile" ) ;
@@ -75,7 +82,8 @@ pub unsafe fn __get_xPSR() -> u32 {
75
82
/// Get Process Stack Pointer
76
83
///
77
84
/// Returns the current value of the Process Stack Pointer (PSP).
78
- #[ inline( always) ]
85
+ #[ inline]
86
+ #[ target_feature( enable = "mclass" ) ]
79
87
pub unsafe fn __get_PSP ( ) -> u32 {
80
88
let result: u32 ;
81
89
asm ! ( "mrs $0, PSP" : "=r" ( result) : : : "volatile" ) ;
@@ -85,15 +93,17 @@ pub unsafe fn __get_PSP() -> u32 {
85
93
/// Set Process Stack Pointer
86
94
///
87
95
/// Assigns the given value to the Process Stack Pointer (PSP).
88
- #[ inline( always) ]
96
+ #[ inline]
97
+ #[ target_feature( enable = "mclass" ) ]
89
98
pub unsafe fn __set_PSP ( top_of_proc_stack : u32 ) {
90
99
asm ! ( "msr PSP, $0" : : "r" ( top_of_proc_stack) : : "volatile" ) ;
91
100
}
92
101
93
102
/// Get Main Stack Pointer
94
103
///
95
104
/// Returns the current value of the Main Stack Pointer (MSP).
96
- #[ inline( always) ]
105
+ #[ inline]
106
+ #[ target_feature( enable = "mclass" ) ]
97
107
pub unsafe fn __get_MSP ( ) -> u32 {
98
108
let result: u32 ;
99
109
asm ! ( "mrs $0, MSP" : "=r" ( result) : : : "volatile" ) ;
@@ -103,7 +113,8 @@ pub unsafe fn __get_MSP() -> u32 {
103
113
/// Set Main Stack Pointer
104
114
///
105
115
/// Assigns the given value to the Main Stack Pointer (MSP).
106
- #[ inline( always) ]
116
+ #[ inline]
117
+ #[ target_feature( enable = "mclass" ) ]
107
118
pub unsafe fn __set_MSP ( top_of_main_stack : u32 ) {
108
119
asm ! ( "msr MSP, $0" : : "r" ( top_of_main_stack) : : "volatile" ) ;
109
120
}
@@ -112,7 +123,8 @@ pub unsafe fn __set_MSP(top_of_main_stack: u32) {
112
123
///
113
124
/// Returns the current state of the priority mask bit from the Priority Mask
114
125
/// Register.
115
- #[ inline( always) ]
126
+ #[ inline]
127
+ #[ target_feature( enable = "mclass" ) ]
116
128
pub unsafe fn __get_PRIMASK ( ) -> u32 {
117
129
let result: u32 ;
118
130
asm ! ( "mrs $0, PRIMASK" : "=r" ( result) : : "memory" : "volatile" ) ;
@@ -122,7 +134,8 @@ pub unsafe fn __get_PRIMASK() -> u32 {
122
134
/// Set Priority Mask
123
135
///
124
136
/// Assigns the given value to the Priority Mask Register.
125
- #[ inline( always) ]
137
+ #[ inline]
138
+ #[ target_feature( enable = "mclass" ) ]
126
139
pub unsafe fn __set_PRIMASK ( pri_mask : u32 ) {
127
140
asm ! ( "msr PRIMASK, $0" : : "r" ( pri_mask) : : "volatile" ) ;
128
141
}
@@ -133,7 +146,8 @@ mod v7 {
133
146
///
134
147
/// Enables FIQ interrupts by clearing the F-bit in the CPSR. Can only be
135
148
/// executed in Privileged modes.
136
- #[ inline( always) ]
149
+ #[ inline]
150
+ #[ target_feature( enable = "mclass" ) ]
137
151
pub unsafe fn __enable_fault_irq ( ) {
138
152
asm ! ( "cpsie f" : : : "memory" : "volatile" ) ;
139
153
}
@@ -142,15 +156,17 @@ mod v7 {
142
156
///
143
157
/// Disables FIQ interrupts by setting the F-bit in the CPSR. Can only be
144
158
/// executed in Privileged modes.
145
- #[ inline( always) ]
159
+ #[ inline]
160
+ #[ target_feature( enable = "mclass" ) ]
146
161
pub unsafe fn __disable_fault_irq ( ) {
147
162
asm ! ( "cpsid f" : : : "memory" : "volatile" ) ;
148
163
}
149
164
150
165
/// Get Base Priority
151
166
///
152
167
/// Returns the current value of the Base Priority register.
153
- #[ inline( always) ]
168
+ #[ inline]
169
+ #[ target_feature( enable = "mclass" ) ]
154
170
pub unsafe fn __get_BASEPRI ( ) -> u32 {
155
171
let result: u32 ;
156
172
asm ! ( "mrs $0, BASEPRI" : "=r" ( result) : : : "volatile" ) ;
@@ -160,7 +176,8 @@ mod v7 {
160
176
/// Set Base Priority
161
177
///
162
178
/// Assigns the given value to the Base Priority register.
163
- #[ inline( always) ]
179
+ #[ inline]
180
+ #[ target_feature( enable = "mclass" ) ]
164
181
pub unsafe fn __set_BASEPRI ( base_pri : u32 ) {
165
182
asm ! ( "msr BASEPRI, $0" : : "r" ( base_pri) : "memory" : "volatile" ) ;
166
183
}
@@ -170,15 +187,17 @@ mod v7 {
170
187
/// Assigns the given value to the Base Priority register only if BASEPRI
171
188
/// masking is disabled, or the new value increases the BASEPRI
172
189
/// priority level.
173
- #[ inline( always) ]
190
+ #[ inline]
191
+ #[ target_feature( enable = "mclass" ) ]
174
192
pub unsafe fn __set_BASEPRI_MAX ( base_pri : u32 ) {
175
193
asm ! ( "msr BASEPRI_MAX, $0" : : "r" ( base_pri) : "memory" : "volatile" ) ;
176
194
}
177
195
178
196
/// Get Fault Mask
179
197
///
180
198
/// Returns the current value of the Fault Mask register.
181
- #[ inline( always) ]
199
+ #[ inline]
200
+ #[ target_feature( enable = "mclass" ) ]
182
201
pub unsafe fn __get_FAULTMASK ( ) -> u32 {
183
202
let result: u32 ;
184
203
asm ! ( "mrs $0, FAULTMASK" : "=r" ( result) : : : "volatile" ) ;
@@ -188,7 +207,8 @@ mod v7 {
188
207
/// Set Fault Mask
189
208
///
190
209
/// Assigns the given value to the Fault Mask register.
191
- #[ inline( always) ]
210
+ #[ inline]
211
+ #[ target_feature( enable = "mclass" ) ]
192
212
pub unsafe fn __set_FAULTMASK ( fault_mask : u32 ) {
193
213
asm ! ( "msr FAULTMASK, $0" : : "r" ( fault_mask) : "memory" : "volatile" ) ;
194
214
}
@@ -203,7 +223,8 @@ pub use self::v7::*;
203
223
///
204
224
/// No Operation does nothing. This instruction can be used for code alignment
205
225
/// purposes.
206
- #[ inline( always) ]
226
+ #[ inline]
227
+ #[ target_feature( enable = "mclass" ) ]
207
228
pub unsafe fn __NOP ( ) {
208
229
asm ! ( "nop" : : : : "volatile" ) ;
209
230
}
@@ -212,7 +233,8 @@ pub unsafe fn __NOP() {
212
233
///
213
234
/// Wait For Interrupt is a hint instruction that suspends execution until one
214
235
/// of a number of events occurs.
215
- #[ inline( always) ]
236
+ #[ inline]
237
+ #[ target_feature( enable = "mclass" ) ]
216
238
pub unsafe fn __WFI ( ) {
217
239
asm ! ( "wfi" : : : : "volatile" ) ;
218
240
}
@@ -221,7 +243,8 @@ pub unsafe fn __WFI() {
221
243
///
222
244
/// Wait For Event is a hint instruction that permits the processor to enter a
223
245
/// low-power state until one of a number of events occurs.
224
- #[ inline( always) ]
246
+ #[ inline]
247
+ #[ target_feature( enable = "mclass" ) ]
225
248
pub unsafe fn __WFE ( ) {
226
249
asm ! ( "wfe" : : : : "volatile" ) ;
227
250
}
@@ -230,7 +253,8 @@ pub unsafe fn __WFE() {
230
253
///
231
254
/// Send Event is a hint instruction. It causes an event to be signaled to the
232
255
/// CPU.
233
- #[ inline( always) ]
256
+ #[ inline]
257
+ #[ target_feature( enable = "mclass" ) ]
234
258
pub unsafe fn __SEV ( ) {
235
259
asm ! ( "sev" : : : : "volatile" ) ;
236
260
}
@@ -240,7 +264,8 @@ pub unsafe fn __SEV() {
240
264
/// Instruction Synchronization Barrier flushes the pipeline in the processor,
241
265
/// so that all instructions following the ISB are fetched from cache or
242
266
/// memory, after the instruction has been completed.
243
- #[ inline( always) ]
267
+ #[ inline]
268
+ #[ target_feature( enable = "mclass" ) ]
244
269
pub unsafe fn __ISB ( ) {
245
270
asm ! ( "isb 0xF" : : : "memory" : "volatile" ) ;
246
271
}
@@ -249,7 +274,8 @@ pub unsafe fn __ISB() {
249
274
///
250
275
/// Acts as a special kind of Data Memory Barrier. It completes when all
251
276
/// explicit memory accesses before this instruction complete.
252
- #[ inline( always) ]
277
+ #[ inline]
278
+ #[ target_feature( enable = "mclass" ) ]
253
279
pub unsafe fn __DSB ( ) {
254
280
asm ! ( "dsb 0xF" : : : "memory" : "volatile" ) ;
255
281
}
@@ -258,7 +284,8 @@ pub unsafe fn __DSB() {
258
284
///
259
285
/// Ensures the apparent order of the explicit memory operations before and
260
286
/// after the instruction, without ensuring their completion.
261
- #[ inline( always) ]
287
+ #[ inline]
288
+ #[ target_feature( enable = "mclass" ) ]
262
289
pub unsafe fn __DMB ( ) {
263
290
asm ! ( "dmb 0xF" : : : "memory" : "volatile" ) ;
264
291
}
0 commit comments