@@ -44,7 +44,7 @@ pub fn delay(cycles: u32) {
44
44
}
45
45
46
46
/// A no-operation. Useful to prevent delay loops from being optimized away.
47
- #[ inline]
47
+ #[ inline( always ) ]
48
48
pub fn nop ( ) {
49
49
// NOTE: This is a `pure` asm block, but applying that option allows the compiler to eliminate
50
50
// the nop entirely (or to collapse multiple subsequent ones). Since the user probably wants N
@@ -59,28 +59,28 @@ pub fn nop() {
59
59
///
60
60
/// Can be used as a stable alternative to `core::intrinsics::abort`.
61
61
#[ cfg( cortex_m) ]
62
- #[ inline]
62
+ #[ inline( always ) ]
63
63
pub fn udf ( ) -> ! {
64
64
unsafe { asm ! ( "udf #0" , options( noreturn, nomem, nostack, preserves_flags) ) } ;
65
65
}
66
66
67
67
/// Wait For Event
68
68
#[ cfg( cortex_m) ]
69
- #[ inline]
69
+ #[ inline( always ) ]
70
70
pub fn wfe ( ) {
71
71
unsafe { asm ! ( "wfe" , options( nomem, nostack, preserves_flags) ) } ;
72
72
}
73
73
74
74
/// Wait For Interrupt
75
75
#[ cfg( cortex_m) ]
76
- #[ inline]
76
+ #[ inline( always ) ]
77
77
pub fn wfi ( ) {
78
78
unsafe { asm ! ( "wfi" , options( nomem, nostack, preserves_flags) ) } ;
79
79
}
80
80
81
81
/// Send Event
82
82
#[ cfg( cortex_m) ]
83
- #[ inline]
83
+ #[ inline( always ) ]
84
84
pub fn sev ( ) {
85
85
unsafe { asm ! ( "sev" , options( nomem, nostack, preserves_flags) ) } ;
86
86
}
@@ -89,7 +89,7 @@ pub fn sev() {
89
89
///
90
90
/// Flushes the pipeline in the processor, so that all instructions following the `ISB` are fetched
91
91
/// from cache or memory, after the instruction has been completed.
92
- #[ inline]
92
+ #[ inline( always ) ]
93
93
pub fn isb ( ) {
94
94
compiler_fence ( Ordering :: SeqCst ) ;
95
95
#[ cfg( cortex_m) ]
@@ -106,7 +106,7 @@ pub fn isb() {
106
106
///
107
107
/// * any explicit memory access made before this instruction is complete
108
108
/// * all cache and branch predictor maintenance operations before this instruction complete
109
- #[ inline]
109
+ #[ inline( always ) ]
110
110
pub fn dsb ( ) {
111
111
compiler_fence ( Ordering :: SeqCst ) ;
112
112
#[ cfg( cortex_m) ]
@@ -121,7 +121,7 @@ pub fn dsb() {
121
121
/// Ensures that all explicit memory accesses that appear in program order before the `DMB`
122
122
/// instruction are observed before any explicit memory accesses that appear in program order
123
123
/// after the `DMB` instruction.
124
- #[ inline]
124
+ #[ inline( always ) ]
125
125
pub fn dmb ( ) {
126
126
compiler_fence ( Ordering :: SeqCst ) ;
127
127
#[ cfg( cortex_m) ]
@@ -136,7 +136,7 @@ pub fn dmb() {
136
136
/// Queries the Security state and access permissions of a memory location.
137
137
/// Returns a Test Target Response Payload (cf section D1.2.215 of
138
138
/// Armv8-M Architecture Reference Manual).
139
- #[ inline]
139
+ #[ inline( always ) ]
140
140
#[ cfg( armv8m) ]
141
141
// The __tt function does not dereference the pointer received.
142
142
#[ allow( clippy:: not_unsafe_ptr_arg_deref) ]
@@ -158,7 +158,7 @@ pub fn tt(addr: *mut u32) -> u32 {
158
158
/// access to that location.
159
159
/// Returns a Test Target Response Payload (cf section D1.2.215 of
160
160
/// Armv8-M Architecture Reference Manual).
161
- #[ inline]
161
+ #[ inline( always ) ]
162
162
#[ cfg( armv8m) ]
163
163
// The __ttt function does not dereference the pointer received.
164
164
#[ allow( clippy:: not_unsafe_ptr_arg_deref) ]
@@ -181,7 +181,7 @@ pub fn ttt(addr: *mut u32) -> u32 {
181
181
/// undefined if used from Non-Secure state.
182
182
/// Returns a Test Target Response Payload (cf section D1.2.215 of
183
183
/// Armv8-M Architecture Reference Manual).
184
- #[ inline]
184
+ #[ inline( always ) ]
185
185
#[ cfg( armv8m) ]
186
186
// The __tta function does not dereference the pointer received.
187
187
#[ allow( clippy:: not_unsafe_ptr_arg_deref) ]
@@ -204,7 +204,7 @@ pub fn tta(addr: *mut u32) -> u32 {
204
204
/// state and is undefined if used from Non-Secure state.
205
205
/// Returns a Test Target Response Payload (cf section D1.2.215 of
206
206
/// Armv8-M Architecture Reference Manual).
207
- #[ inline]
207
+ #[ inline( always ) ]
208
208
#[ cfg( armv8m) ]
209
209
// The __ttat function does not dereference the pointer received.
210
210
#[ allow( clippy:: not_unsafe_ptr_arg_deref) ]
@@ -224,7 +224,7 @@ pub fn ttat(addr: *mut u32) -> u32 {
224
224
///
225
225
/// See section C2.4.26 of Armv8-M Architecture Reference Manual for details.
226
226
/// Undefined if executed in Non-Secure state.
227
- #[ inline]
227
+ #[ inline( always ) ]
228
228
#[ cfg( armv8m) ]
229
229
pub unsafe fn bx_ns ( addr : u32 ) {
230
230
asm ! ( "bxns {}" , in( reg) addr, options( nomem, nostack, preserves_flags) ) ;
@@ -234,9 +234,9 @@ pub unsafe fn bx_ns(addr: u32) {
234
234
///
235
235
/// This method is used by cortex-m-semihosting to provide semihosting syscalls.
236
236
#[ cfg( cortex_m) ]
237
- #[ inline]
237
+ #[ inline( always ) ]
238
238
pub unsafe fn semihosting_syscall ( mut nr : u32 , arg : u32 ) -> u32 {
239
- asm ! ( "bkpt #0xab" , inout( "r0" ) nr, in( "r1" ) arg, options( nomem , nostack, preserves_flags) ) ;
239
+ asm ! ( "bkpt #0xab" , inout( "r0" ) nr, in( "r1" ) arg, options( nostack, preserves_flags) ) ;
240
240
nr
241
241
}
242
242
0 commit comments