class FakeCpuidIo

Defined at line 64 of file ../../zircon/kernel/lib/arch/testing/include/lib/arch/testing/x86/fake-cpuid.h

FakeCpuidIo is a fake analogue to arch::BootCpuidIo, which may be provided

in its place for tests - in the kernel and on host - for logic templated

on any type the interface contract of the latter. A "CPUID I/O provider",

FakeCpuidIo's methods are expected to be instantiated by "CPUID value

types", defined in

<lib

/arch/x86/cpuid.h>.

Using `Populate`, test authors can provide fake data for specific

(sub)leaves.

FakeCpuidIo is immovable and non-copyable; it is expected to be passed

around by const reference.

Public Methods

void FakeCpuidIo (X86Microprocessor microprocessor)

Constructs an FakeCpuidIo populated from the CPUID data collected from the

provided mircoprocessor.

Defined at line 14 of file ../../zircon/kernel/lib/arch/testing/fake-cpuid.cc

void FakeCpuidIo ()

Defined at line 66 of file ../../zircon/kernel/lib/arch/testing/include/lib/arch/testing/x86/fake-cpuid.h

template <typename CpuidValue>
const CpuidIo * Get ()

Returns the cached CpuidIo object corresponding to the particular CPUID

register type.

Defined at line 75 of file ../../zircon/kernel/lib/arch/testing/include/lib/arch/testing/x86/fake-cpuid.h

template <typename CpuidValue>
auto Read ()

A convenience method to directly read a particular CPUID register type in

consultation with the associated cached CpuidIo objects.

Defined at line 82 of file ../../zircon/kernel/lib/arch/testing/include/lib/arch/testing/x86/fake-cpuid.h

FakeCpuidIo & Populate (uint32_t leaf, uint32_t subleaf, uint32_t eax, uint32_t ebx, uint32_t ecx, uint32_t edx)

Provides fake data for a given leaf. Subsequent calls can overwrite

previously populated data.

Defined at line 137 of file ../../zircon/kernel/lib/arch/testing/fake-cpuid.cc

FakeCpuidIo & Populate (uint32_t leaf, uint32_t subleaf, CpuidIo::Register reg, uint32_t value)

Defined at line 160 of file ../../zircon/kernel/lib/arch/testing/fake-cpuid.cc