Skip to content

Commit

Permalink
Merge pull request #7 from diondokter/riscv-support
Browse files Browse the repository at this point in the history
Add risc-v support
  • Loading branch information
Yatekii authored Dec 14, 2024
2 parents 8af3d68 + c8e3fd4 commit 007e610
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,14 @@
#[cfg(all(not(test), feature = "panic-handler"))]
#[panic_handler]
fn panic(_info: &core::panic::PanicInfo) -> ! {
#[cfg(not(any(target_arch = "arm", target_arch = "riscv32")))]
compile_error!("Panic handler can only be compiled for arm and riscv32");

unsafe {
#[cfg(target_arch = "arm")]
core::arch::asm!("udf #0");
#[cfg(any(target_arch = "riscv32", target_arch = "riscv64"))]
core::arch::asm!("UNIMP");
core::hint::unreachable_unchecked();
}
}
Expand Down

0 comments on commit 007e610

Please sign in to comment.