pub struct CpuidLeaf {
pub function: u32,
pub index: Option<u32>,
pub result: [u32; 4],
pub mask: [u32; 4],
}
Expand description
A CPUID result.
This may define a partial result if some mask bits are zero. This is used to provide an update on top of another CPUID result provided elsewhere (e.g. by the hypervisor).
Fields§
§function: u32
The CPUID function/leaf, provided in eax.
index: Option<u32>
The CPUID index/subleaf, provided in ecx. If None
, any index value is
accepted.
result: [u32; 4]
The result.
mask: [u32; 4]
The bits of the result that are valid.
Implementations§
Source§impl CpuidLeaf
impl CpuidLeaf
Sourcepub fn new(function: u32, result: [u32; 4]) -> Self
pub fn new(function: u32, result: [u32; 4]) -> Self
Returns a new result for the given function.
Sourcepub fn indexed(self, index: u32) -> Self
pub fn indexed(self, index: u32) -> Self
Updates the result to be for specific index
and returns it.
Sourcepub fn masked(self, mask: [u32; 4]) -> Self
pub fn masked(self, mask: [u32; 4]) -> Self
Updates the result to be partial with the provided mask.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for CpuidLeaf
impl RefUnwindSafe for CpuidLeaf
impl Send for CpuidLeaf
impl Sync for CpuidLeaf
impl Unpin for CpuidLeaf
impl UnwindSafe for CpuidLeaf
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