添加rust重构版本的HPET驱动和tsc驱动,并使用HPET校准tsc频率和cpu总线频率 (#412)

* 添加rust重构版本的HPET驱动和tsc驱动,并使用HPET校准tsc频率和cpu总线频率

* 把hpet.c移动到arch文件夹下
This commit is contained in:
LoGin
2023-10-26 23:08:39 +08:00
committed by GitHub
parent ad1d649edd
commit fbe6becd6d
29 changed files with 946 additions and 391 deletions

View File

@ -370,3 +370,8 @@ impl Into<smoltcp::time::Duration> for Duration {
smoltcp::time::Duration::from_millis(self.millis())
}
}
pub trait TimeArch {
/// Get CPU cycles (Read from register)
fn get_cycles() -> usize;
}

View File

@ -1,7 +1,6 @@
#pragma once
#include <common/glib.h>
#include <driver/timers/HPET/HPET.h>
// 定义LONG_MAX为最大超时时间 - 允许负数