#cpuid #x86 #amd64 #os #libcore

bin+lib raw-cpuid

A library to parse the x86 CPUID instruction, written in rust with no external dependencies. The implementation closely resembles the Intel CPUID manual description. The library does only depend on libcore.

22 releases (14 stable)

6.1.0 Nov 12, 2018
5.0.0 Jul 13, 2018
4.0.0 Jun 19, 2018
3.1.0 Apr 19, 2018
0.0.2 Mar 24, 2015

#3 in Hardware support

Download history 1639/week @ 2019-01-20 751/week @ 2019-01-27 1194/week @ 2019-02-03 902/week @ 2019-02-10 830/week @ 2019-02-17 782/week @ 2019-02-24 924/week @ 2019-03-03 1464/week @ 2019-03-10 810/week @ 2019-03-17 1305/week @ 2019-03-24 1374/week @ 2019-03-31 1192/week @ 2019-04-07 1215/week @ 2019-04-14 1483/week @ 2019-04-21 1310/week @ 2019-04-28

5,763 downloads per month
Used in 36 crates (11 directly)

MIT license

173KB
4.5K SLoC

cpuid Build Status Crates.io

A library to parse the x86 CPUID instruction, written in rust with no external dependencies. The implementation closely resembles the Intel CPUID manual description. The library does only depend on libcore.

The code should be in sync with the latest March 2018 revision of the Intel Architectures Software Developer’s Manual.

Library usage

let cpuid = CpuId::new();

match cpuid.get_vendor_info() {
    Some(vf) => assert!(vf.as_string() == "GenuineIntel"),
    None => ()
}

let has_sse = match cpuid.get_feature_info() {
    Some(finfo) => finfo.has_sse(),
    None => false
};

if has_sse {
    println!("CPU supports SSE!");
}

match cpuid.get_cache_parameters() {
    Some(cparams) => {
        for cache in cparams {
            let size = cache.associativity() * cache.physical_line_partitions() * cache.coherency_line_size() * cache.sets();
            println!("L{}-Cache size is {}", cache.level(), size);
        }
    },
    None => println!("No cache parameter information available"),
}

Documentation

Dependencies

~347KB