these raw instructions are unsafe

This commit is contained in:
M Farkas-Dyck 2018-08-18 10:22:05 -08:00
parent 8d530616c9
commit 8e0faa9182
1 changed files with 2 additions and 4 deletions

View File

@ -3,12 +3,10 @@
macro_rules! instruction {
($fnname:ident, $asm:expr) => (
#[inline]
pub fn $fnname() {
pub unsafe fn $fnname() {
match () {
#[cfg(any(target_arch = "riscv32", target_arch = "riscv64"))]
() => unsafe {
asm!($asm :::: "volatile");
},
() => asm!($asm :::: "volatile"),
#[cfg(not(any(target_arch = "riscv32", target_arch = "riscv64")))]
() => {}
}