use crate::IsaSet;
use crate::generated::cpuid::groups;
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
pub enum CpuidRegister {
Eax,
Ebx,
Ecx,
Edx,
}
impl CpuidRegister {
pub const fn as_str(self) -> &'static str {
match self {
Self::Eax => "eax",
Self::Ebx => "ebx",
Self::Ecx => "ecx",
Self::Edx => "edx",
}
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
pub struct CpuidField {
pub leaf: u32,
pub subleaf: u32,
pub register: CpuidRegister,
pub low: u8,
pub high: u8,
pub value: u32,
}
impl IsaSet {
pub fn cpuid(self) -> &'static [&'static [CpuidField]] {
groups(self)
}
}