Skip to content

Commit 533d115

Browse files
committed
fix: cputicks asm import
1 parent 6d69fb1 commit 533d115

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/time.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
//! Architecture-specific timing functions, taken from
22
//! <https://github.com/spence/tach>
33
4-
use core::arch::asm;
5-
64
/// Read from the `cntvct_el0` register on Arm `AArch64`.
75
#[cfg(target_arch = "aarch64")]
86
#[inline(always)]
97
pub fn ticks() -> u64 {
8+
use core::arch::asm;
109
let cnt: u64;
1110
// SAFETY: `mrs cntvct_el0` only reads the architectural virtual counter
1211
// register and does not touch memory or the stack.
@@ -24,6 +23,7 @@ pub fn ticks() -> u64 {
2423
#[cfg(target_arch = "riscv64")]
2524
#[inline(always)]
2625
pub fn ticks() -> u64 {
26+
use core::arch::asm;
2727
let cnt: u64;
2828
// SAFETY: `rdtime` reads a timer CSR into a general-purpose register and does not access
2929
// Rust memory.

0 commit comments

Comments
 (0)