Skip to content

Latest commit

 

History

History
58 lines (42 loc) · 1.58 KB

README.md

File metadata and controls

58 lines (42 loc) · 1.58 KB

Rust MSRV

aarch64_features - A feature detector for AArch64 features, i.e., FEAT_LSE?

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

Caveats

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.

License

Licensed under either of

at your option.

Contribution

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.