@@ -44,7 +44,7 @@ pub fn delay(cycles: u32) {
4444}
4545
4646/// A no-operation. Useful to prevent delay loops from being optimized away.
47- #[ inline]
47+ #[ inline( always ) ]
4848pub fn nop ( ) {
4949 // NOTE: This is a `pure` asm block, but applying that option allows the compiler to eliminate
5050 // the nop entirely (or to collapse multiple subsequent ones). Since the user probably wants N
@@ -59,28 +59,28 @@ pub fn nop() {
5959///
6060/// Can be used as a stable alternative to `core::intrinsics::abort`.
6161#[ cfg( cortex_m) ]
62- #[ inline]
62+ #[ inline( always ) ]
6363pub fn udf ( ) -> ! {
6464 unsafe { asm ! ( "udf #0" , options( noreturn, nomem, nostack, preserves_flags) ) } ;
6565}
6666
6767/// Wait For Event
6868#[ cfg( cortex_m) ]
69- #[ inline]
69+ #[ inline( always ) ]
7070pub fn wfe ( ) {
7171 unsafe { asm ! ( "wfe" , options( nomem, nostack, preserves_flags) ) } ;
7272}
7373
7474/// Wait For Interrupt
7575#[ cfg( cortex_m) ]
76- #[ inline]
76+ #[ inline( always ) ]
7777pub fn wfi ( ) {
7878 unsafe { asm ! ( "wfi" , options( nomem, nostack, preserves_flags) ) } ;
7979}
8080
8181/// Send Event
8282#[ cfg( cortex_m) ]
83- #[ inline]
83+ #[ inline( always ) ]
8484pub fn sev ( ) {
8585 unsafe { asm ! ( "sev" , options( nomem, nostack, preserves_flags) ) } ;
8686}
@@ -89,7 +89,7 @@ pub fn sev() {
8989///
9090/// Flushes the pipeline in the processor, so that all instructions following the `ISB` are fetched
9191/// from cache or memory, after the instruction has been completed.
92- #[ inline]
92+ #[ inline( always ) ]
9393pub fn isb ( ) {
9494 compiler_fence ( Ordering :: SeqCst ) ;
9595 #[ cfg( cortex_m) ]
@@ -106,7 +106,7 @@ pub fn isb() {
106106///
107107/// * any explicit memory access made before this instruction is complete
108108/// * all cache and branch predictor maintenance operations before this instruction complete
109- #[ inline]
109+ #[ inline( always ) ]
110110pub fn dsb ( ) {
111111 compiler_fence ( Ordering :: SeqCst ) ;
112112 #[ cfg( cortex_m) ]
@@ -121,7 +121,7 @@ pub fn dsb() {
121121/// Ensures that all explicit memory accesses that appear in program order before the `DMB`
122122/// instruction are observed before any explicit memory accesses that appear in program order
123123/// after the `DMB` instruction.
124- #[ inline]
124+ #[ inline( always ) ]
125125pub fn dmb ( ) {
126126 compiler_fence ( Ordering :: SeqCst ) ;
127127 #[ cfg( cortex_m) ]
@@ -136,7 +136,7 @@ pub fn dmb() {
136136/// Queries the Security state and access permissions of a memory location.
137137/// Returns a Test Target Response Payload (cf section D1.2.215 of
138138/// Armv8-M Architecture Reference Manual).
139- #[ inline]
139+ #[ inline( always ) ]
140140#[ cfg( armv8m) ]
141141// The __tt function does not dereference the pointer received.
142142#[ allow( clippy:: not_unsafe_ptr_arg_deref) ]
@@ -158,7 +158,7 @@ pub fn tt(addr: *mut u32) -> u32 {
158158/// access to that location.
159159/// Returns a Test Target Response Payload (cf section D1.2.215 of
160160/// Armv8-M Architecture Reference Manual).
161- #[ inline]
161+ #[ inline( always ) ]
162162#[ cfg( armv8m) ]
163163// The __ttt function does not dereference the pointer received.
164164#[ allow( clippy:: not_unsafe_ptr_arg_deref) ]
@@ -181,7 +181,7 @@ pub fn ttt(addr: *mut u32) -> u32 {
181181/// undefined if used from Non-Secure state.
182182/// Returns a Test Target Response Payload (cf section D1.2.215 of
183183/// Armv8-M Architecture Reference Manual).
184- #[ inline]
184+ #[ inline( always ) ]
185185#[ cfg( armv8m) ]
186186// The __tta function does not dereference the pointer received.
187187#[ allow( clippy:: not_unsafe_ptr_arg_deref) ]
@@ -204,7 +204,7 @@ pub fn tta(addr: *mut u32) -> u32 {
204204/// state and is undefined if used from Non-Secure state.
205205/// Returns a Test Target Response Payload (cf section D1.2.215 of
206206/// Armv8-M Architecture Reference Manual).
207- #[ inline]
207+ #[ inline( always ) ]
208208#[ cfg( armv8m) ]
209209// The __ttat function does not dereference the pointer received.
210210#[ allow( clippy:: not_unsafe_ptr_arg_deref) ]
@@ -224,7 +224,7 @@ pub fn ttat(addr: *mut u32) -> u32 {
224224///
225225/// See section C2.4.26 of Armv8-M Architecture Reference Manual for details.
226226/// Undefined if executed in Non-Secure state.
227- #[ inline]
227+ #[ inline( always ) ]
228228#[ cfg( armv8m) ]
229229pub unsafe fn bx_ns ( addr : u32 ) {
230230 asm ! ( "bxns {}" , in( reg) addr, options( nomem, nostack, preserves_flags) ) ;
@@ -234,9 +234,9 @@ pub unsafe fn bx_ns(addr: u32) {
234234///
235235/// This method is used by cortex-m-semihosting to provide semihosting syscalls.
236236#[ cfg( cortex_m) ]
237- #[ inline]
237+ #[ inline( always ) ]
238238pub 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) ) ;
240240 nr
241241}
242242
0 commit comments