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 <strake888@gmail.com>
This commit is contained in:
commit
4e16dd85ed
|
@ -3,12 +3,10 @@
|
||||||
macro_rules! instruction {
|
macro_rules! instruction {
|
||||||
($fnname:ident, $asm:expr) => (
|
($fnname:ident, $asm:expr) => (
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn $fnname() {
|
pub unsafe fn $fnname() {
|
||||||
match () {
|
match () {
|
||||||
#[cfg(any(target_arch = "riscv32", target_arch = "riscv64"))]
|
#[cfg(any(target_arch = "riscv32", target_arch = "riscv64"))]
|
||||||
() => unsafe {
|
() => asm!($asm :::: "volatile"),
|
||||||
asm!($asm :::: "volatile");
|
|
||||||
},
|
|
||||||
#[cfg(not(any(target_arch = "riscv32", target_arch = "riscv64")))]
|
#[cfg(not(any(target_arch = "riscv32", target_arch = "riscv64")))]
|
||||||
() => {}
|
() => {}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue