This crate checks for available features of AArch64 cores. It strives for completeness instead of focussing on the favorite features.
Update your Cargo.toml
[dependencies]
aarch64_features = "0.1.0"
and then
use aarch64_features::{check_features, Feature};
fn main() {
let features = check_features();
if features.contains(&Feature::FEAT_LSE) {
println!("happy");
}
}
supported configurations:
- Linux AArch64
- macOS AArch64
- Windows on ARM.
- anything not AArch64
The Linux kernel only exposes a subset of the features to userspace, see feature registers. The set changes over time and thus the reported features of this crate can change between versions.
If you have a big little cpu, then you may want to pin the current thread.
Licensed under either of
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.