Move arch::x86_64::cpuid into arch::x86_shared::cpuid
This commit is contained in:
@@ -1,13 +0,0 @@
|
||||
use raw_cpuid::{ExtendedFeatures, FeatureInfo};
|
||||
|
||||
pub use crate::arch::x86_shared::cpuid::*;
|
||||
|
||||
pub fn feature_info() -> FeatureInfo {
|
||||
cpuid()
|
||||
.get_feature_info()
|
||||
.expect("x86_64 requires CPUID leaf=0x01 to be present")
|
||||
}
|
||||
|
||||
pub fn has_ext_feat(feat: impl FnOnce(ExtendedFeatures) -> bool) -> bool {
|
||||
cpuid().get_extended_feature_info().map_or(false, feat)
|
||||
}
|
||||
@@ -8,9 +8,6 @@ pub mod macros;
|
||||
/// Constants like memory locations
|
||||
pub mod consts;
|
||||
|
||||
/// CPUID wrapper
|
||||
pub mod cpuid;
|
||||
|
||||
/// Global descriptor table
|
||||
pub mod gdt;
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
use raw_cpuid::{CpuId, CpuIdResult};
|
||||
use raw_cpuid::{CpuId, CpuIdResult, ExtendedFeatures, FeatureInfo};
|
||||
|
||||
pub fn cpuid() -> CpuId {
|
||||
// FIXME check for cpuid availability during early boot and error out if it doesn't exist.
|
||||
@@ -15,3 +15,15 @@ pub fn cpuid() -> CpuId {
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
#[cfg_attr(not(target_arch = "x86_64"), expect(dead_code))]
|
||||
pub fn feature_info() -> FeatureInfo {
|
||||
cpuid()
|
||||
.get_feature_info()
|
||||
.expect("x86_64 requires CPUID leaf=0x01 to be present")
|
||||
}
|
||||
|
||||
#[cfg_attr(not(target_arch = "x86_64"), expect(dead_code))]
|
||||
pub fn has_ext_feat(feat: impl FnOnce(ExtendedFeatures) -> bool) -> bool {
|
||||
cpuid().get_extended_feature_info().map_or(false, feat)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user