Skip to content

Commit

Permalink
Add riscv64 support
Browse files Browse the repository at this point in the history
Co-authored-by: Martin Kröning <[email protected]>
Signed-off-by: Martin Kröning <[email protected]>
  • Loading branch information
simonschoening and mkroening committed Jul 22, 2023
1 parent 8385af4 commit c08bc87
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
3 changes: 3 additions & 0 deletions benches/micro/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ default-features = false
aarch64 = { version = "0.0.10", default-features = false }
tock-registers = "0.8"

[target.'cfg(target_arch = "riscv64")'.dependencies]
riscv = "0.10"

[target.'cfg(target_os = "linux")'.dependencies]
syscalls = { version = "0.6", default-features = false }

Expand Down
6 changes: 6 additions & 0 deletions benches/micro/src/benches/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@ fn get_timestamp() -> u64 {
aarch64::regs::CNTPCT_EL0.get()
}

#[cfg(target_arch = "riscv64")]
#[inline]
fn get_timestamp() -> u64 {
riscv::register::time::read64()
}

extern "C" {
#[cfg(target_os = "hermit")]
fn sys_getpid() -> u32;
Expand Down
2 changes: 1 addition & 1 deletion libhermit-rs

0 comments on commit c08bc87

Please sign in to comment.