__cpuid_count in core::arch::x86 - Rust
Description: Returns the result of the `cpuid` instruction for a given `leaf` (`EAX`) and `sub_leaf` (`ECX`).
Keywords: rust, rustlang, rust-lang, __cpuid_count

# Function core::arch::x86::__cpuid_count
1.27.0[−][src]

    pub unsafe fn __cpuid_count(leaf: u32, sub_leaf: u32) -> CpuidResult

This is supported on x86 only.
Expand description

Returns the result of the `cpuid` instruction for a given `leaf` (`EAX`) and `sub_leaf` (`ECX`).

The highest-supported leaf value is returned by the first tuple argument of `__get_cpuid_max(0)`. For leaves containung sub-leaves, the second tuple argument returns the highest-supported sub-leaf value.

The CPUID Wikipedia page contains how to query which information using the `EAX` and `ECX` registers, and the interpretation of the results returned in `EAX`, `EBX`, `ECX`, and `EDX`.

The references are:

- Intel 64 and IA-32 Architectures Software Developer’s Manual Volume 2: Instruction Set Reference, A-Z.
- AMD64 Architecture Programmer’s Manual, Volume 3: General-Purpose and System Instructions.