diff options
author | 2022-05-31 18:10:42 +0000 | |
---|---|---|
committer | 2022-05-31 18:10:42 +0000 | |
commit | e0bfe3ae21903e9dbd80e903e726f7341662e12b (patch) | |
tree | 60fee9596f4e85344aac3f889741f8891d0b4e4d /cortex-m-semihosting/src/lib.rs | |
parent | b581ec74b295811387b4a2a4f4cfeeb91ec788d8 (diff) | |
parent | bba4f0f83287b2c642f074cbcc96312ca7688135 (diff) | |
download | cortex-m-e0bfe3ae21903e9dbd80e903e726f7341662e12b.tar.gz cortex-m-e0bfe3ae21903e9dbd80e903e726f7341662e12b.tar.zst cortex-m-e0bfe3ae21903e9dbd80e903e726f7341662e12b.zip |
Merge #441v0.7.5
441: Prepare for v0.7.5 r=newAM a=adamgreig
Currently with cortex-m 0.7.4 it's not possible for stable Rust users to enable the inline-asm feature, even though their compiler might support it, because of the `![cfg_attr(feature = "inline-asm", feature(asm))]` line. I propose a new 0.7.5 release that removes this line, which means users on stable Rust >=1.59 could enable the previously nightly-only feature to get stable inline asm.
I wouldn't enable the feature by default, because that would be a significant MSRV bump, but at least this way more users could enable it before we release 0.8 with the revamped and inline-only asm.
I've also backported the bugfix from #380 which I don't believe is a breaking change.
I haven't had a chance to test this yet so it would be great if someone could try it out and just make sure the inline-asm feature does work before merging.
Any thoughts on anything else worth backporting from 0.8?
Co-authored-by: Adam Greig <adam@adamgreig.com>
Co-authored-by: bors[bot] <26634292+bors[bot]@users.noreply.github.com>
Diffstat (limited to 'cortex-m-semihosting/src/lib.rs')
-rw-r--r-- | cortex-m-semihosting/src/lib.rs | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/cortex-m-semihosting/src/lib.rs b/cortex-m-semihosting/src/lib.rs index a67b84d..721ac45 100644 --- a/cortex-m-semihosting/src/lib.rs +++ b/cortex-m-semihosting/src/lib.rs @@ -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. @@ -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] @@ -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 } |