mirror of
https://github.com/qemu/qemu.git
synced 2026-02-04 05:35:39 +00:00
@@ -17,7 +17,7 @@ use migration::{
|
||||
};
|
||||
use qom::{prelude::*, ObjectImpl, Owned, ParentField, ParentInit};
|
||||
use system::{hwaddr, MemoryRegion, MemoryRegionOps, MemoryRegionOpsBuilder};
|
||||
use util::{log::Log, log_mask_ln, ResultExt};
|
||||
use util::prelude::*;
|
||||
|
||||
use crate::registers::{self, Interrupt, RegisterOffset};
|
||||
|
||||
|
||||
@@ -25,10 +25,7 @@ use system::{
|
||||
bindings::{address_space_memory, address_space_stl_le, hwaddr},
|
||||
MemoryRegion, MemoryRegionOps, MemoryRegionOpsBuilder, MEMTXATTRS_UNSPECIFIED,
|
||||
};
|
||||
use util::{
|
||||
ensure,
|
||||
timer::{Timer, CLOCK_VIRTUAL, NANOSECONDS_PER_SECOND},
|
||||
};
|
||||
use util::prelude::*;
|
||||
|
||||
use crate::fw_cfg::HPETFwConfig;
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
use std::ptr::addr_of_mut;
|
||||
|
||||
use common::Zeroable;
|
||||
use util::{self, ensure};
|
||||
use util::{self, prelude::*};
|
||||
|
||||
/// Each `HPETState` represents a Event Timer Block. The v1 spec supports
|
||||
/// up to 8 blocks. QEMU only uses 1 block (in PC machine).
|
||||
|
||||
@@ -34,6 +34,7 @@ _util_rs = static_library(
|
||||
'src/error.rs',
|
||||
'src/log.rs',
|
||||
'src/module.rs',
|
||||
'src/prelude.rs',
|
||||
'src/timer.rs',
|
||||
],
|
||||
{'.': _util_bindings_inc_rs}
|
||||
|
||||
@@ -4,6 +4,11 @@ pub mod bindings;
|
||||
pub mod error;
|
||||
pub mod log;
|
||||
pub mod module;
|
||||
|
||||
// preserve one-item-per-"use" syntax, it is clearer
|
||||
// for prelude-like modules
|
||||
#[rustfmt::skip]
|
||||
pub mod prelude;
|
||||
pub mod timer;
|
||||
|
||||
pub use error::{Error, Result, ResultExt};
|
||||
|
||||
11
rust/util/src/prelude.rs
Normal file
11
rust/util/src/prelude.rs
Normal file
@@ -0,0 +1,11 @@
|
||||
//! Essential types and traits intended for blanket imports.
|
||||
|
||||
pub use crate::error::ResultExt;
|
||||
pub use crate::log::Log;
|
||||
pub use crate::timer::Timer;
|
||||
pub use crate::timer::CLOCK_VIRTUAL;
|
||||
pub use crate::timer::NANOSECONDS_PER_SECOND;
|
||||
|
||||
// Re-export commonly used macros
|
||||
pub use crate::ensure;
|
||||
pub use crate::log_mask_ln;
|
||||
Reference in New Issue
Block a user