Name | Date | Size | #Lines | LOC | ||
---|---|---|---|---|---|---|
.. | 30-Mar-2022 | - | ||||
ci/ | H | 30-Mar-2022 | - | 131 | 89 | |
examples/ | H | 30-Mar-2022 | - | 331 | 263 | |
src/ | H | 30-Mar-2022 | - | 5,354 | 4,307 | |
.cargo-checksum.json | H A D | 03-May-2022 | 89 | 1 | 1 | |
AUTHORS | H A D | 30-Mar-2022 | 113 | 4 | 3 | |
Cargo.lock | H A D | 30-Mar-2022 | 4.1 KiB | 162 | 143 | |
Cargo.toml | H A D | 30-Mar-2022 | 1.6 KiB | 56 | 48 | |
LICENSE.md | H A D | 30-Mar-2022 | 1.1 KiB | 21 | 17 | |
README.md | H A D | 30-Mar-2022 | 1.3 KiB | 39 | 30 | |
build.rs | H A D | 30-Mar-2022 | 500 | 17 | 14 |
README.md
1# cpuid [![Build Status](https://travis-ci.org/gz/rust-cpuid.svg)](https://travis-ci.org/gz/rust-cpuid) [![Crates.io](https://img.shields.io/crates/v/raw_cpuid.svg)](https://crates.io/crates/raw-cpuid) 2 3A 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. 4 5The code should be in sync with the latest March 2018 revision of the Intel Architectures Software Developer’s Manual. 6 7## Library usage 8```rust 9let cpuid = CpuId::new(); 10 11match cpuid.get_vendor_info() { 12 Some(vf) => assert!(vf.as_string() == "GenuineIntel"), 13 None => () 14} 15 16let has_sse = match cpuid.get_feature_info() { 17 Some(finfo) => finfo.has_sse(), 18 None => false 19}; 20 21if has_sse { 22 println!("CPU supports SSE!"); 23} 24 25match cpuid.get_cache_parameters() { 26 Some(cparams) => { 27 for cache in cparams { 28 let size = cache.associativity() * cache.physical_line_partitions() * cache.coherency_line_size() * cache.sets(); 29 println!("L{}-Cache size is {}", cache.level(), size); 30 } 31 }, 32 None => println!("No cache parameter information available"), 33} 34``` 35 36## Documentation 37* [API Documentation](https://docs.rs/raw-cpuid/) 38* [Examples](https://github.com/gz/rust-cpuid/tree/master/examples) 39