Struct x86_64::cpuid::CpuIdContext
source · pub struct CpuIdContext {
vcpu_id: usize,
cpu_count: usize,
x2apic: bool,
tsc_deadline_timer: bool,
apic_frequency: u32,
tsc_frequency: Option<u64>,
cpu_config: CpuConfigX86_64,
cpuid_count: unsafe fn(_: u32, _: u32) -> CpuidResult,
cpuid: unsafe fn(_: u32) -> CpuidResult,
}
Expand description
All of the context required to emulate the CPUID instruction.
Fields§
§vcpu_id: usize
Id of the Vcpu associated with this context.
cpu_count: usize
The total number of vcpus on this VM.
x2apic: bool
Whether or not the IrqChip’s APICs support X2APIC.
tsc_deadline_timer: bool
Whether or not the IrqChip’s APICs support a TSC deadline timer.
apic_frequency: u32
The frequency at which the IrqChip’s APICs run.
tsc_frequency: Option<u64>
The TSC frequency in Hz, if it could be determined.
cpu_config: CpuConfigX86_64
CPU feature configurations.
cpuid_count: unsafe fn(_: u32, _: u32) -> CpuidResult
__cpuid_count or a fake function for test.
cpuid: unsafe fn(_: u32) -> CpuidResult
__cpuid or a fake function for test.
Implementations§
source§impl CpuIdContext
impl CpuIdContext
pub fn new( vcpu_id: usize, cpu_count: usize, irq_chip: Option<&dyn IrqChipX86_64>, cpu_config: CpuConfigX86_64, calibrated_tsc_leaf_required: bool, cpuid_count: unsafe fn(_: u32, _: u32) -> CpuidResult, cpuid: unsafe fn(_: u32) -> CpuidResult ) -> CpuIdContext
Trait Implementations§
source§impl Clone for CpuIdContext
impl Clone for CpuIdContext
source§fn clone(&self) -> CpuIdContext
fn clone(&self) -> CpuIdContext
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for CpuIdContext
impl Debug for CpuIdContext
source§impl PartialEq for CpuIdContext
impl PartialEq for CpuIdContext
source§fn eq(&self, other: &CpuIdContext) -> bool
fn eq(&self, other: &CpuIdContext) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Eq for CpuIdContext
impl StructuralPartialEq for CpuIdContext
Auto Trait Implementations§
impl RefUnwindSafe for CpuIdContext
impl Send for CpuIdContext
impl Sync for CpuIdContext
impl Unpin for CpuIdContext
impl UnwindSafe for CpuIdContext
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.