1*b8ed3825SDonkey Kane use crate::time::{clocksource::HZ, TimeArch}; 24fda81ceSLoGin pub struct RiscV64TimeArch; 34fda81ceSLoGin 4*b8ed3825SDonkey Kane /// 这个是系统jiffies时钟源的固有频率(不是调频之后的) 5*b8ed3825SDonkey Kane pub const CLOCK_TICK_RATE: u32 = HZ as u32 * 1000000; 6*b8ed3825SDonkey Kane 74fda81ceSLoGin impl TimeArch for RiscV64TimeArch { 84fda81ceSLoGin fn get_cycles() -> usize { 9453452ccSLoGin riscv::register::cycle::read() 104fda81ceSLoGin } 118cb2e9b3SLoGin 128cb2e9b3SLoGin fn cal_expire_cycles(ns: usize) -> usize { 138cb2e9b3SLoGin todo!() 148cb2e9b3SLoGin } 15*b8ed3825SDonkey Kane /// 将CPU的时钟周期数转换为纳秒 16*b8ed3825SDonkey Kane #[inline(always)] 17*b8ed3825SDonkey Kane fn cycles2ns(cycles: usize) -> usize { 18*b8ed3825SDonkey Kane todo!() 19*b8ed3825SDonkey Kane } 204fda81ceSLoGin } 21