Refactor timer in framework

This commit is contained in:
Yuke Peng
2024-02-05 14:01:18 +08:00
committed by Tate, Hongliang Tian
parent 8d6915d0e6
commit 748a92d278
7 changed files with 306 additions and 114 deletions

View File

@ -2,14 +2,12 @@
//! Timer.
#[cfg(target_arch = "x86_64")]
use crate::arch::x86::timer::{add_timeout_list, TimerCallback, TICK};
use crate::sync::SpinLock;
use crate::{config::TIMER_FREQ, prelude::*};
use crate::arch::timer::{add_timeout_list, TimerCallback, TICK};
use crate::prelude::*;
use crate::{arch::timer::TIMER_FREQ, sync::SpinLock};
use core::{sync::atomic::Ordering, time::Duration};
#[cfg(target_arch = "x86_64")]
pub use crate::arch::x86::timer::read_monotonic_milli_seconds;
pub use crate::arch::timer::read_monotonic_milli_seconds;
/// A timer invokes a callback function after a specified span of time elapsed.
///