Expand description
ax-percpu
Define and access per-CPU data structures
English | 中文
§Introduction
ax-percpu provides Define and access per-CPU data structures. It is maintained as part of the TGOSKits component set and is intended for Rust projects that integrate with ArceOS, AxVisor, or related low-level systems software.
ax-percpu was derived from https://github.com/arceos-org/percpu
§Quick Start
§Installation
Add this crate to your Cargo.toml:
[dependencies]
ax-percpu = "0.4.3"§Run Check and Test
# Enter the crate directory
cd components/percpu/percpu
# Format code
cargo fmt --all
# Run clippy
cargo clippy --all-targets --all-features
# Run Linux host tests
cargo test --features host-test,non-zero-vma
# Build documentation
cargo doc --no-deps§Integration
§Example
use ax_percpu as _;
fn main() {
// Integrate `ax-percpu` into your project here.
}§Documentation
Generate and view API documentation:
cargo doc --no-deps --openOnline documentation: docs.rs/ax-percpu
§Contributing
- Fork the repository and create a branch
- Run local format and checks
- Run local tests relevant to this crate
- Submit a PR and ensure CI passes
§License
Licensed under the Apache License, Version 2.0. See LICENSE for details.
Structs§
- EXAMPLE_
PERCPU_ DATA_ WRAPPER - Wrapper struct for the per-CPU data
EXAMPLE_PERCPU_DATA
Statics§
- EXAMPLE_
PERCPU_ DATA doc - Example per-CPU data for documentation only.
Functions§
- init
- Initialize all per-CPU data areas.
- init_
percpu_ reg - Initializes the per-CPU data register.
- percpu_
area_ base - Returns the base address of the per-CPU data area on the given CPU.
- percpu_
area_ num - Returns the number of per-CPU data areas reserved.
- percpu_
area_ size - Returns the per-CPU data area size for one CPU.
- read_
percpu_ reg - Reads the architecture-specific per-CPU data register.
- write_
percpu_ ⚠reg - Writes the architecture-specific per-CPU data register.
Attribute Macros§
- def_
percpu - Defines a per-CPU static variable.