class FakeMsrIo
Defined at line 25 of file ../../zircon/kernel/lib/arch/testing/include/lib/arch/testing/x86/fake-msr.h
FakeMsrIo is a fake analogue to hwreg::X86MsrIo, which may be provided in
its place in tests - in the kernel and on host.
FakeMsrIo is immovable and non-copyable; it is expected to be passed
around by reference.
Public Members
static const auto kNoSideEffects
Public Methods
FakeMsrIo & Populate (X86Msr msr, uint64_t initial_value)
Populate must be called with a particular MSR by a test author before that
same MSR can be used with Read() and Write(). A call will not result in
any side-effects.
Defined at line 14 of file ../../zircon/kernel/lib/arch/testing/fake-msr.cc
uint64_t Peek (X86Msr msr)
Reads the stored MSR value without side-effects. The MSR must have been
`Populate`d before this can be called on it.
Defined at line 28 of file ../../zircon/kernel/lib/arch/testing/fake-msr.cc
void FakeMsrIo ()
Gives a FakeMsrIo with no side-effects, which is little more than a
glorified map of MSR address to value.
Defined at line 38 of file ../../zircon/kernel/lib/arch/testing/include/lib/arch/testing/x86/fake-msr.h
void FakeMsrIo (IoCallback on_write, IoCallback on_read)
Constructs a FakeMsrIo with particular on-write and on-read `IoCallback`s.
Defined at line 41 of file ../../zircon/kernel/lib/arch/testing/include/lib/arch/testing/x86/fake-msr.h
void FakeMsrIo (IoCallback on_write, IoCallback on_read)
Constructs a FakeMsrIo with particular on-write and on-read `IoCallback`s.
Defined at line 41 of file ../../zircon/kernel/lib/arch/testing/include/lib/arch/testing/x86/fake-msr.h
template <typename IntType>
void Write (IntType value, uint32_t msr)
Implements an I/O provider's `Write()` method. An MSR must have been
`Populate`d before this can be called on it.
Defined at line 56 of file ../../zircon/kernel/lib/arch/testing/include/lib/arch/testing/x86/fake-msr.h
template <typename IntType>
IntType Read (uint32_t msr)
Implements an I/O provider's `Read()` method. An MSR must have been
`Populate`d before this can be called on it.
Defined at line 64 of file ../../zircon/kernel/lib/arch/testing/include/lib/arch/testing/x86/fake-msr.h