Skip to content
This repository was archived by the owner on Nov 7, 2022. It is now read-only.

Commit a1e9540

Browse files
committed
Bump version; Update README
1 parent a13b62b commit a1e9540

File tree

2 files changed

+36
-12
lines changed

2 files changed

+36
-12
lines changed

Cargo.toml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "cortex-a"
3-
version = "3.0.5"
3+
version = "4.0.0"
44
authors = ["Andre Richter <[email protected]>"]
55
description = "Low level access to Cortex-A processors"
66
homepage = "https://github.com/rust-embedded/cortex-a"
@@ -11,9 +11,6 @@ categories = ["embedded", "hardware-support", "no-std"]
1111
license = "MIT/Apache-2.0"
1212
edition = "2018"
1313
exclude = [
14-
".gitignore",
15-
".rustfmt.toml",
16-
".vscode",
1714
"Makefile"
1815
]
1916

src/lib.rs

Lines changed: 35 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,46 @@
55
// Author(s):
66
// - Andre Richter <[email protected]>
77

8-
//! Low level access to Cortex-A processors
8+
//! Low level access to Cortex-A processors.
99
//!
10-
//! This crate provides:
10+
//! ## Currently Supported Architectures
1111
//!
12-
//! - Safe wrappers around assembly instructions
12+
//! - [x] AArch64
13+
//! - [ ] AArch32
1314
//!
14-
//! For now, there's not much. I will update it gradually.
15-
//! If you want to contribute, feel free to reach out!
15+
//! ## Minimum Supported Rust Version
1616
//!
17-
//! # Minimum Supported Rust Version (MSRV)
17+
//! Requires rustc 1.45.0 or later due to use of the new `asm!()` syntax.
1818
//!
19-
//! This crate is guaranteed to compile on stable Rust 1.39 and up. It *might* compile with older
20-
//! versions but that may change in any new patch release.
19+
//! ## Usage
20+
//!
21+
//! Example from https://github.com/rust-embedded/rust-raspberrypi-OS-tutorials
22+
//!
23+
//! ```rust
24+
//! unsafe fn el2_to_el1_transition() -> ! {
25+
//! // Enable timer counter registers for EL1.
26+
//! CNTHCTL_EL2.write(CNTHCTL_EL2::EL1PCEN::SET + CNTHCTL_EL2::EL1PCTEN::SET);
27+
//!
28+
//! // No offset for reading the counters.
29+
//! CNTVOFF_EL2.set(0);
30+
//!
31+
//! // Set EL1 execution state to AArch64.
32+
//! HCR_EL2.write(HCR_EL2::RW::EL1IsAarch64);
33+
//!
34+
//! // Set up a simulated exception return.
35+
//! SPSR_EL2.write(
36+
//! SPSR_EL2::D::Masked
37+
//! + SPSR_EL2::A::Masked
38+
//! + SPSR_EL2::I::Masked
39+
//! + SPSR_EL2::F::Masked
40+
//! + SPSR_EL2::M::EL1h,
41+
//! );
42+
//! ```
43+
//!
44+
//! ## Disclaimer
45+
//!
46+
//! Descriptive comments in the source files are taken from the
47+
//! [ARM Architecture Reference Manual ARMv8, for ARMv8-A architecture profile](https://static.docs.arm.com/ddi0487/ca/DDI0487C_a_armv8_arm.pdf?_ga=2.266626254.1122218691.1534883460-1326731866.1530967873).
2148
2249
#![feature(core_intrinsics)]
2350
#![feature(custom_inner_attributes)]

0 commit comments

Comments
 (0)