mirror of
https://github.com/asterinas/asterinas.git
synced 2025-06-25 18:33:24 +00:00
Adjust the format of imports in Asterinas
This commit is contained in:
committed by
Tate, Hongliang Tian
parent
92e488e727
commit
cfcef6965a
@ -8,9 +8,10 @@
|
||||
//! It can be integrated into larger systems to provide timing capabilities, or used standalone for time tracking and elapsed time measurements.
|
||||
|
||||
use alloc::sync::Arc;
|
||||
use core::{cmp::max, ops::Add, time::Duration};
|
||||
|
||||
use aster_frame::sync::SpinLock;
|
||||
use aster_util::coeff::Coeff;
|
||||
use core::{cmp::max, ops::Add, time::Duration};
|
||||
|
||||
use crate::NANOS_PER_SECOND;
|
||||
|
||||
|
@ -7,15 +7,14 @@
|
||||
extern crate alloc;
|
||||
|
||||
use alloc::sync::Arc;
|
||||
use aster_frame::sync::Mutex;
|
||||
use component::{init_component, ComponentInitError};
|
||||
use core::{sync::atomic::Ordering::Relaxed, time::Duration};
|
||||
use spin::Once;
|
||||
|
||||
use aster_frame::sync::Mutex;
|
||||
use clocksource::ClockSource;
|
||||
use rtc::{get_cmos, is_updating, CENTURY_REGISTER};
|
||||
|
||||
pub use clocksource::Instant;
|
||||
use component::{init_component, ComponentInitError};
|
||||
use rtc::{get_cmos, is_updating, CENTURY_REGISTER};
|
||||
use spin::Once;
|
||||
|
||||
mod clocksource;
|
||||
mod rtc;
|
||||
|
@ -1,8 +1,8 @@
|
||||
// SPDX-License-Identifier: MPL-2.0
|
||||
|
||||
use core::sync::atomic::{AtomicU8, Ordering::Relaxed};
|
||||
|
||||
use aster_frame::arch::x86::device::cmos::{get_century_register, CMOS_ADDRESS, CMOS_DATA};
|
||||
use core::sync::atomic::AtomicU8;
|
||||
use core::sync::atomic::Ordering::Relaxed;
|
||||
|
||||
pub(crate) static CENTURY_REGISTER: AtomicU8 = AtomicU8::new(0);
|
||||
|
||||
|
@ -4,13 +4,18 @@
|
||||
//!
|
||||
//! Use `init` to initialize this module.
|
||||
use alloc::sync::Arc;
|
||||
use aster_frame::arch::{read_tsc, x86::tsc_freq};
|
||||
use aster_frame::timer::Timer;
|
||||
use core::time::Duration;
|
||||
|
||||
use aster_frame::{
|
||||
arch::{read_tsc, x86::tsc_freq},
|
||||
timer::Timer,
|
||||
};
|
||||
use spin::Once;
|
||||
|
||||
use crate::clocksource::{ClockSource, Instant};
|
||||
use crate::{START_TIME, VDSO_DATA_UPDATE};
|
||||
use crate::{
|
||||
clocksource::{ClockSource, Instant},
|
||||
START_TIME, VDSO_DATA_UPDATE,
|
||||
};
|
||||
|
||||
/// A instance of TSC clocksource.
|
||||
pub static CLOCK: Once<Arc<ClockSource>> = Once::new();
|
||||
|
Reference in New Issue
Block a user