Skip to content

Commit 4e16dd8

Browse files
bors[bot]strake
andcommitted
Merge #10
10: these raw instructions are unsafe r=dvc94ch a=strake `wfi` is safe, but the rest are not. Let's make them all unsafe until we have a better idea — the return types are wrong anyhow. Co-authored-by: M Farkas-Dyck <[email protected]>
2 parents 591b7df + 8e0faa9 commit 4e16dd8

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/asm.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,10 @@
33
macro_rules! instruction {
44
($fnname:ident, $asm:expr) => (
55
#[inline]
6-
pub fn $fnname() {
6+
pub unsafe fn $fnname() {
77
match () {
88
#[cfg(any(target_arch = "riscv32", target_arch = "riscv64"))]
9-
() => unsafe {
10-
asm!($asm :::: "volatile");
11-
},
9+
() => asm!($asm :::: "volatile"),
1210
#[cfg(not(any(target_arch = "riscv32", target_arch = "riscv64")))]
1311
() => {}
1412
}

0 commit comments

Comments
 (0)