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

Commit 7dc5da1

Browse files
Javier-varezandre-richter
authored andcommitted
Use full path to asm! macro
Rust 1.59 stabilizes the asm feature and the explicit feature flag is not required anymore. However, the macros were not using the full path and this is causing a failure with rustc 1.59 in nightly.
1 parent 950a6ca commit 7dc5da1

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

src/asm.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ pub mod barrier;
1515
pub fn nop() {
1616
#[cfg(target_arch = "aarch64")]
1717
unsafe {
18-
asm!("nop", options(nomem, nostack))
18+
core::arch::asm!("nop", options(nomem, nostack))
1919
}
2020

2121
#[cfg(not(target_arch = "aarch64"))]
@@ -29,7 +29,7 @@ pub fn nop() {
2929
pub fn wfi() {
3030
#[cfg(target_arch = "aarch64")]
3131
unsafe {
32-
asm!("wfi", options(nomem, nostack))
32+
core::arch::asm!("wfi", options(nomem, nostack))
3333
}
3434

3535
#[cfg(not(target_arch = "aarch64"))]
@@ -43,7 +43,7 @@ pub fn wfi() {
4343
pub fn wfe() {
4444
#[cfg(target_arch = "aarch64")]
4545
unsafe {
46-
asm!("wfe", options(nomem, nostack))
46+
core::arch::asm!("wfe", options(nomem, nostack))
4747
}
4848

4949
#[cfg(not(target_arch = "aarch64"))]
@@ -59,7 +59,7 @@ pub fn wfe() {
5959
pub fn sevl() {
6060
#[cfg(target_arch = "aarch64")]
6161
unsafe {
62-
asm!("sevl", options(nomem, nostack))
62+
core::arch::asm!("sevl", options(nomem, nostack))
6363
}
6464

6565
#[cfg(not(target_arch = "aarch64"))]
@@ -75,7 +75,7 @@ pub fn sevl() {
7575
pub fn sev() {
7676
#[cfg(target_arch = "aarch64")]
7777
unsafe {
78-
asm!("sev", options(nomem, nostack))
78+
core::arch::asm!("sev", options(nomem, nostack))
7979
}
8080

8181
#[cfg(not(target_arch = "aarch64"))]
@@ -89,7 +89,7 @@ pub fn sev() {
8989
pub fn eret() -> ! {
9090
#[cfg(target_arch = "aarch64")]
9191
unsafe {
92-
asm!("eret", options(nomem, nostack));
92+
core::arch::asm!("eret", options(nomem, nostack));
9393
core::intrinsics::unreachable()
9494
}
9595

@@ -104,7 +104,7 @@ pub fn eret() -> ! {
104104
pub fn ret() -> ! {
105105
#[cfg(target_arch = "aarch64")]
106106
unsafe {
107-
asm!("ret", options(nomem, nostack));
107+
core::arch::asm!("ret", options(nomem, nostack));
108108
core::intrinsics::unreachable()
109109
}
110110

src/asm/barrier.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ macro_rules! dmb_dsb {
2929
match () {
3030
#[cfg(target_arch = "aarch64")]
3131
() => {
32-
asm!(concat!("DMB ", stringify!($A)), options(nostack))
32+
core::arch::asm!(concat!("DMB ", stringify!($A)), options(nostack))
3333
}
3434

3535
#[cfg(not(target_arch = "aarch64"))]
@@ -43,7 +43,7 @@ macro_rules! dmb_dsb {
4343
match () {
4444
#[cfg(target_arch = "aarch64")]
4545
() => {
46-
asm!(concat!("DSB ", stringify!($A)), options(nostack))
46+
core::arch::asm!(concat!("DSB ", stringify!($A)), options(nostack))
4747
}
4848

4949
#[cfg(not(target_arch = "aarch64"))]
@@ -68,7 +68,7 @@ impl sealed::Isb for SY {
6868
match () {
6969
#[cfg(target_arch = "aarch64")]
7070
() => {
71-
asm!("ISB SY", options(nostack))
71+
core::arch::asm!("ISB SY", options(nostack))
7272
}
7373

7474
#[cfg(not(target_arch = "aarch64"))]

src/registers/macros.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ macro_rules! __read_raw {
1515
() => {
1616
let reg;
1717
unsafe {
18-
asm!(concat!($asm_instr, " {reg:", $asm_width, "}, ", $asm_reg_name), reg = out(reg) reg, options(nomem, nostack));
18+
core::arch::asm!(concat!($asm_instr, " {reg:", $asm_width, "}, ", $asm_reg_name), reg = out(reg) reg, options(nomem, nostack));
1919
}
2020
reg
2121
}
@@ -37,7 +37,7 @@ macro_rules! __write_raw {
3737
#[cfg(target_arch = "aarch64")]
3838
() => {
3939
unsafe {
40-
asm!(concat!($asm_instr, " ", $asm_reg_name, ", {reg:", $asm_width, "}"), reg = in(reg) value, options(nomem, nostack))
40+
core::arch::asm!(concat!($asm_instr, " ", $asm_reg_name, ", {reg:", $asm_width, "}"), reg = in(reg) value, options(nomem, nostack))
4141
}
4242
}
4343

0 commit comments

Comments
 (0)