aboutsummaryrefslogtreecommitdiff
path: root/src/lib.rs
diff options
context:
space:
mode:
authorGravatar bors[bot] <26634292+bors[bot]@users.noreply.github.com> 2020-08-31 21:08:05 +0000
committerGravatar GitHub <noreply@github.com> 2020-08-31 21:08:05 +0000
commitb05a24e6b31e039e059760a4245b378df008faf8 (patch)
tree50a7ce8ead7bb9ef1f34216e8934988572d442a8 /src/lib.rs
parent3260e397647b5ea4984e8c82cb537f2475da0f5d (diff)
parentc27c8e5b063bd7058ba05dc3a9fa7886a1b1545c (diff)
downloadcortex-m-b05a24e6b31e039e059760a4245b378df008faf8.tar.gz
cortex-m-b05a24e6b31e039e059760a4245b378df008faf8.tar.zst
cortex-m-b05a24e6b31e039e059760a4245b378df008faf8.zip
Merge #262
262: Merge asm implementations r=therealprof a=jonas-schievink This replaces the implementation of `inline-asm` with the file I wrote in #259 (and some fixes). All functions that call assembly now do so via a `call_asm!` macro that either dispatches to a call to an `#[inline(always)]` function containing the inline `asm!`, or to the FFI shim. This makes all functions that call into asm significantly shorter. The FFI shim is now also macro-generated, which makes it very small. Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
Diffstat (limited to 'src/lib.rs')
-rw-r--r--src/lib.rs9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/lib.rs b/src/lib.rs
index 723816a..f30408e 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -12,7 +12,7 @@
//! ## `inline-asm`
//!
//! When this feature is enabled the implementation of all the functions inside the `asm` and
-//! `register` modules use inline assembly (`llvm_asm!`) instead of external assembly (FFI into separate
+//! `register` modules use inline assembly (`asm!`) instead of external assembly (FFI into separate
//! assembly files pre-compiled using `arm-none-eabi-gcc`). The advantages of enabling `inline-asm`
//! are:
//!
@@ -52,17 +52,16 @@
//!
//! # Minimum Supported Rust Version (MSRV)
//!
-//! This crate is guaranteed to compile on stable Rust 1.31 and up. It *might*
+//! This crate is guaranteed to compile on stable Rust 1.38 and up. It *might*
//! compile with older versions but that may change in any new patch release.
-#![cfg_attr(feature = "inline-asm", feature(llvm_asm))]
+#![cfg_attr(feature = "inline-asm", feature(asm))]
#![deny(missing_docs)]
#![no_std]
#![allow(clippy::identity_op)]
#![allow(clippy::missing_safety_doc)]
// Prevent clippy from complaining about empty match expression that are used for cfg gating.
#![allow(clippy::match_single_binding)]
-
// This makes clippy warn about public functions which are not #[inline].
//
// Almost all functions in this crate result in trivial or even no assembly.
@@ -82,6 +81,8 @@ extern crate bare_metal;
extern crate volatile_register;
#[macro_use]
+mod call_asm;
+#[macro_use]
mod macros;
pub mod asm;