Skip to content

Commit

Permalink
Swap cortex-m-semihosting to use asm instead of llvm_asm
Browse files Browse the repository at this point in the history
  • Loading branch information
adamgreig committed May 17, 2022
1 parent 45406f6 commit bba4f0f
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions cortex-m-semihosting/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,7 @@
//!
//! ## `inline-asm`
//!
//! When this feature is enabled semihosting is implemented using inline assembly (`llvm_asm!`) and
//! compiling this crate requires nightly.
//! When this feature is enabled semihosting is implemented using inline assembly (`asm!`).
//!
//! When this feature is disabled semihosting is implemented using FFI calls into an external
//! assembly file and compiling this crate works on stable and beta.
Expand All @@ -179,7 +178,6 @@
//!
//! [pdf]: http://infocenter.arm.com/help/topic/com.arm.doc.dui0471e/DUI0471E_developing_for_arm_processors.pdf

#![cfg_attr(feature = "inline-asm", feature(llvm_asm))]
#![deny(missing_docs)]
#![no_std]

Expand Down Expand Up @@ -213,7 +211,7 @@ pub unsafe fn syscall1(_nr: usize, _arg: usize) -> usize {
#[cfg(all(thumb, feature = "inline-asm", not(feature = "no-semihosting")))]
() => {
let mut nr = _nr;
llvm_asm!("bkpt 0xAB" : "+{r0}"(nr) : "{r1}"(_arg) :: "volatile");
core::arch::asm!("bkpt #0xab", inout("r0") nr, in("r1") _arg, options(nostack, preserves_flags));
nr
}

Expand Down

0 comments on commit bba4f0f

Please sign in to comment.