From 69d54ef0c5410196aa3eaee3c3764ba9ab7b545f Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Mon, 7 Nov 2016 14:15:20 -0700 Subject: [PATCH] Get frequency info --- arch/x86_64/src/device/cpu.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/arch/x86_64/src/device/cpu.rs b/arch/x86_64/src/device/cpu.rs index 33bc777..e48547b 100644 --- a/arch/x86_64/src/device/cpu.rs +++ b/arch/x86_64/src/device/cpu.rs @@ -13,10 +13,16 @@ pub fn cpu_info(w: &mut W) -> Result { if let Some(info) = cpuid.get_extended_function_info() { if let Some(brand) = info.processor_brand_string() { - write!(w, "Brand: {}\n", brand)?; + write!(w, "Model: {}\n", brand)?; } } + if let Some(info) = cpuid.get_processor_frequency_info() { + write!(w, "CPU Base MHz: {}\n", info.processor_base_frequency())?; + write!(w, "CPU Max MHz: {}\n", info.processor_max_frequency())?; + write!(w, "Bus MHz: {}\n", info.bus_frequency())?; + } + write!(w, "Features:")?; if let Some(info) = cpuid.get_feature_info() { @@ -80,7 +86,7 @@ pub fn cpu_info(w: &mut W) -> Result { if info.has_aesni() { write!(w, " aes")? }; if info.has_xsave() { write!(w, " xsave")? }; - if info.has_oxsave() { write!(w, " oxsave")? }; + if info.has_oxsave() { write!(w, " xsaveopt")? }; if info.has_avx() { write!(w, " avx")? }; if info.has_f16c() { write!(w, " f16c")? }; if info.has_rdrand() { write!(w, " rdrand")? };