diff options
| author | Alexey Gavrilov <alexey.gavrilov@mail.com> | 2025-12-11 15:44:00 +0700 |
|---|---|---|
| committer | Alexey Gavrilov <alexey.gavrilov@mail.com> | 2025-12-11 15:44:00 +0700 |
| commit | b98035306ceca38432c754847e3ef7474b1b778c (patch) | |
| tree | f13fbdc1fcd6dc00dae8b58c325572bd53223a50 /arch/x86/cpuid/Cpuid.h | |
| parent | 75ef20c5889005758ed8c30c3279954f16529a16 (diff) | |
Put in cpuid some definitions and declarations
Declarations: `acquireInformation` for two extended cpuid
commands. Overloading `operator&` for enum classes in
`VersionInfo` structure to get proper bit value.
All declarations from ==Cpuid.h== file are define in the
corresponding cpp file.
Signed-off-by: Alexey Gavrilov <alexey.gavrilov@mail.com>
Diffstat (limited to 'arch/x86/cpuid/Cpuid.h')
| -rw-r--r-- | arch/x86/cpuid/Cpuid.h | 40 |
1 files changed, 39 insertions, 1 deletions
diff --git a/arch/x86/cpuid/Cpuid.h b/arch/x86/cpuid/Cpuid.h index 42fb692..a65cdc8 100644 --- a/arch/x86/cpuid/Cpuid.h +++ b/arch/x86/cpuid/Cpuid.h @@ -207,10 +207,46 @@ public: SS = (1 << 27), HTT = (1 << 28), TM = (1 << 29), - PBE = (1 << 31), + PBE = static_cast<uint32>(1 << 31), }; }; +inline uint32 operator&(uint32 r, VersionInfo::EdxFlags flag) +{ + return r & static_cast<uint32>(flag); +}; + +inline uint32 operator&(uint32 r, cpuid::VersionInfo::EcxFlags flag) +{ + return r & static_cast<uint32>(flag); +}; + +struct ExtendedAddressSize : public CmdWithNoSubleaf +{ + constexpr static uint32 initialValue = 0x80000008; + + ExtendedAddressSize() : CmdWithNoSubleaf(initialValue){}; + +private: + struct AddressSize + { + uint8 physicalAddressBits, + linearAddressBits; + }; + +public: + AddressSize eax; + bool isWbnoinvdAvailable; +}; + +struct ExtendedMaxInputValue : public CmdWithNoSubleaf +{ + constexpr static uint32 initialValue = 0x80000000; + + ExtendedMaxInputValue() : CmdWithNoSubleaf(initialValue){}; + + uint32 eax; +}; /** * Getters are acquire information from cpuid instruction @@ -221,6 +257,8 @@ public: */ void acquireInformation(BasicInfo &cpuidRes); void acquireInformation(VersionInfo &cpuidRes); +void acquireInformation(ExtendedAddressSize &cpuidRes); +void acquireInformation(ExtendedMaxInputValue &cpuidRes); /** * Validators are check filling correctness for some cpuid command instance |
