From ae3bdea4bcc6ee6f99be2024bcba021498b9d7c3 Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Tue, 1 Mar 2022 18:12:06 -0700 Subject: [PATCH] Update raw-cpuid --- Cargo.lock | 8 +++----- Cargo.toml | 2 +- src/arch/x86_64/device/cpu.rs | 11 ++++++----- 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b740f45..37369cb 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -75,7 +75,7 @@ dependencies = [ "linked_list_allocator 0.9.0", "log", "memoffset", - "raw-cpuid 8.1.2", + "raw-cpuid 10.2.0", "redox_syscall", "rmm", "rustc-cfg", @@ -149,13 +149,11 @@ dependencies = [ [[package]] name = "raw-cpuid" -version = "8.1.2" +version = "10.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fdf7d9dbd43f3d81d94a49c1c3df73cc2b3827995147e6cf7f89d4ec5483e73" +checksum = "929f54e29691d4e6a9cc558479de70db7aa3d98cd6fe7ab86d7507aa2886b9d2" dependencies = [ "bitflags", - "cc", - "rustc_version", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index da66bfb..538fb20 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -38,7 +38,7 @@ byteorder = { version = "1", default-features = false } fdt = { git = "https://gitlab.redox-os.org/thomhuds/fdt.git", default-features = false } [target.'cfg(target_arch = "x86_64")'.dependencies] -raw-cpuid = "8.0.0" +raw-cpuid = "10.2.0" x86 = { version = "0.32.0", default-features = false } [features] diff --git a/src/arch/x86_64/device/cpu.rs b/src/arch/x86_64/device/cpu.rs index f28aa2a..3f3b358 100644 --- a/src/arch/x86_64/device/cpu.rs +++ b/src/arch/x86_64/device/cpu.rs @@ -11,10 +11,8 @@ pub fn cpu_info(w: &mut W) -> Result { writeln!(w, "Vendor: {}", info.as_string())?; } - if let Some(info) = cpuid.get_extended_function_info() { - if let Some(brand) = info.processor_brand_string() { - writeln!(w, "Model: {}", brand)?; - } + if let Some(brand) = cpuid.get_processor_brand_string() { + writeln!(w, "Model: {}", brand.as_str())?; } if let Some(info) = cpuid.get_processor_frequency_info() { @@ -92,7 +90,7 @@ pub fn cpu_info(w: &mut W) -> Result { if info.has_rdrand() { write!(w, " rdrand")? }; } - if let Some(info) = cpuid.get_extended_function_info() { + if let Some(info) = cpuid.get_extended_processor_and_feature_identifiers() { if info.has_64bit_mode() { write!(w, " lm")? }; if info.has_rdtscp() { write!(w, " rdtscp")? }; if info.has_1gib_pages() { write!(w, " pdpe1gb")? }; @@ -101,6 +99,9 @@ pub fn cpu_info(w: &mut W) -> Result { if info.has_prefetchw() { write!(w, " prefetchw")? }; if info.has_lzcnt() { write!(w, " lzcnt")? }; if info.has_lahf_sahf() { write!(w, " lahf_lm")? }; + } + + if let Some(info) = cpuid.get_advanced_power_mgmt_info() { if info.has_invariant_tsc() { write!(w, " constant_tsc")? }; }