Skip to content
This repository was archived by the owner on Nov 7, 2022. It is now read-only.

Commit 5f939df

Browse files
committed
Add missing arch guards to barrier funcs
1 parent 76ce00e commit 5f939df

File tree

3 files changed

+31
-4
lines changed

3 files changed

+31
-4
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "cortex-a"
3-
version = "5.1.1"
3+
version = "5.1.2"
44
authors = ["Andre Richter <[email protected]>"]
55
description = "Low level access to Cortex-A processors"
66
homepage = "https://github.com/rust-embedded/cortex-a"

Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,15 @@ TARGET := aarch64-unknown-none-softfloat
22

33
default:
44
cargo build --target $(TARGET)
5+
cargo build
56

67
clippy:
78
cargo clippy --target $(TARGET)
9+
cargo clippy
810

911
check:
1012
cargo check --target $(TARGET)
13+
cargo check
1114

1215
fmt:
1316
cargo fmt

src/barrier.rs

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,29 @@ macro_rules! dmb_dsb {
2929
impl sealed::Dmb for $A {
3030
#[inline(always)]
3131
unsafe fn __dmb(&self) {
32-
asm!(concat!("DMB ", stringify!($A)), options(nostack))
32+
match () {
33+
#[cfg(target_arch = "aarch64")]
34+
() => {
35+
asm!(concat!("DMB ", stringify!($A)), options(nostack))
36+
}
37+
38+
#[cfg(not(target_arch = "aarch64"))]
39+
() => unimplemented!(),
40+
}
3341
}
3442
}
3543
impl sealed::Dsb for $A {
3644
#[inline(always)]
3745
unsafe fn __dsb(&self) {
38-
asm!(concat!("DSB ", stringify!($A)), options(nostack))
46+
match () {
47+
#[cfg(target_arch = "aarch64")]
48+
() => {
49+
asm!(concat!("DSB ", stringify!($A)), options(nostack))
50+
}
51+
52+
#[cfg(not(target_arch = "aarch64"))]
53+
() => unimplemented!(),
54+
}
3955
}
4056
}
4157
};
@@ -52,7 +68,15 @@ dmb_dsb!(SY);
5268
impl sealed::Isb for SY {
5369
#[inline(always)]
5470
unsafe fn __isb(&self) {
55-
asm!("ISB SY", options(nostack))
71+
match () {
72+
#[cfg(target_arch = "aarch64")]
73+
() => {
74+
asm!("ISB SY", options(nostack))
75+
}
76+
77+
#[cfg(not(target_arch = "aarch64"))]
78+
() => unimplemented!(),
79+
}
5680
}
5781
}
5882

0 commit comments

Comments
 (0)