Skip to content

Commit a25cb3e

Browse files
committed
Fix cortex-m-semihosting inline-asm on nightly
1 parent 27434e0 commit a25cb3e

File tree

1 file changed

+7
-3
lines changed
  • cortex-m-semihosting/src

1 file changed

+7
-3
lines changed

cortex-m-semihosting/src/lib.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@
153153
//!
154154
//! ## `inline-asm`
155155
//!
156-
//! When this feature is enabled semihosting is implemented using inline assembly (`llvm_asm!`) and
156+
//! When this feature is enabled semihosting is implemented using inline assembly and
157157
//! compiling this crate requires nightly.
158158
//!
159159
//! When this feature is disabled semihosting is implemented using FFI calls into an external
@@ -179,7 +179,6 @@
179179
//!
180180
//! [pdf]: http://infocenter.arm.com/help/topic/com.arm.doc.dui0471e/DUI0471E_developing_for_arm_processors.pdf
181181
182-
#![cfg_attr(feature = "inline-asm", feature(llvm_asm))]
183182
#![deny(missing_docs)]
184183
#![no_std]
185184

@@ -213,7 +212,12 @@ pub unsafe fn syscall1(_nr: usize, _arg: usize) -> usize {
213212
#[cfg(all(thumb, feature = "inline-asm", not(feature = "no-semihosting")))]
214213
() => {
215214
let mut nr = _nr;
216-
llvm_asm!("bkpt 0xAB" : "+{r0}"(nr) : "{r1}"(_arg) :: "volatile");
215+
core::arch::asm!(
216+
"bkpt #0xab",
217+
inout("r0") nr,
218+
in("r1") _arg,
219+
options(nomem, nostack, preserves_flags)
220+
);
217221
nr
218222
}
219223

0 commit comments

Comments
 (0)