diff options
-rw-r--r-- | CHANGELOG.md | 5 | ||||
-rw-r--r-- | src/asm.rs | 16 |
2 files changed, 21 insertions, 0 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 0bb5286..a39c5bf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ## [Unreleased] +### Changed + +- Small, non user visible change to make this crate compile further for $HOST (e.g. x86_64) with the + goal of making it possible to test, on the HOST, downstream crates that depend on this one. + ## [v0.1.0] - 2016-09-27 ### Added @@ -4,6 +4,7 @@ /// /// Optionally, an "immediate" value (in the 0-255 range) can be passed to `bkpt!`. The debugger can /// then read this value using the Program Counter (PC). +#[cfg(target_arch = "arm")] #[macro_export] macro_rules! bkpt { () => { @@ -14,6 +15,21 @@ macro_rules! bkpt { }; } +/// Puts the processor in Debug state. Debuggers can pick this up as a "breakpoint". +/// +/// Optionally, an "immediate" value (in the 0-255 range) can be passed to `bkpt!`. The debugger can +/// then read this value using the Program Counter (PC). +#[cfg(not(target_arch = "arm"))] +#[macro_export] +macro_rules! bkpt { + () => { + asm!("nop" :::: "volatile"); + }; + ($e:expr) => { + asm!("nop" :::: "volatile"); + }; +} + /// Wait for event pub unsafe fn wfe() { match () { |