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:
bors[bot] 2018-08-19 17:02:05 +00:00
commit 4e16dd85ed
1 changed files with 2 additions and 4 deletions

View File

@ -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")))]
() => {} () => {}
} }