mirror of
https://github.com/justinian/jsix.git
synced 2025-12-10 00:14:32 -08:00
[cpu] Rename cpu_id::validate() to cpu_id::features()
Validate wasn't a correct name anymore. Also move the features enum out of the cpu_id class scope and into the `cpu` namespace directly.
This commit is contained in:
@@ -16,10 +16,11 @@ enum class feature {
|
||||
max
|
||||
};
|
||||
|
||||
using features = util::bitset<(unsigned)feature::max>;
|
||||
|
||||
class cpu_id
|
||||
{
|
||||
public:
|
||||
using features = util::bitset<(unsigned)feature::max>;
|
||||
static constexpr uint32_t cpuid_extended = 0x80000000;
|
||||
|
||||
/// CPUID result register values
|
||||
@@ -46,7 +47,7 @@ public:
|
||||
|
||||
/// Check which of the cpu::feature flags this CPU supports.
|
||||
/// \returns A util::bitset mapping to cpu::feature values
|
||||
features validate() const;
|
||||
features features() const;
|
||||
|
||||
/// The the result of a given CPUID leaf/subleaf
|
||||
/// \arg leaf The leaf selector (initial EAX)
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
CPU_FEATURE_OPT(pcid, 0x00000001, 0, ecx, 17)
|
||||
CPU_FEATURE_OPT(x2apic, 0x00000001, 0, ecx, 21)
|
||||
CPU_FEATURE_REQ(xsave, 0x00000001, 0, ecx, 26)
|
||||
CPU_FEATURE_OPT(in_hv, 0x00000001, 0, ecx, 31)
|
||||
CPU_FEATURE_OPT(hypervisor, 0x00000001, 0, ecx, 31)
|
||||
|
||||
CPU_FEATURE_REQ(fpu, 0x00000001, 0, edx, 0)
|
||||
CPU_FEATURE_REQ(pse, 0x00000001, 0, edx, 3)
|
||||
|
||||
@@ -34,10 +34,10 @@ cpu_id::cpu_id()
|
||||
__cpuid(cpuid_extended, 0, &m_high_ext);
|
||||
}
|
||||
|
||||
cpu_id::features
|
||||
cpu_id::validate() const
|
||||
features
|
||||
cpu_id::features() const
|
||||
{
|
||||
cpu_id::features feats;
|
||||
::cpu::features feats;
|
||||
uint32_t leaf = -1u;
|
||||
uint32_t sub = -1u;
|
||||
regs r;
|
||||
|
||||
Reference in New Issue
Block a user