pub unsafe fn cpuid(leaf: u32, sub_leaf: Option<u32>) -> CpuidResult
Expand description
Execute the cpuid instruction for the given leaf and sub_leaf.
For leaves that don’t have sub-leaves, providing a sub-leaf shouldn’t change the result. The reverse is of course not true; failing to provide a sub-leaf will result in returning an arbitrary one.
§Safety
cpuid
instruction must be available. This is generally true outside of
specialized execution environments such as SGX. See
https://github.com/rust-lang/rust/issues/60123.