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

Add nightly feature. #37

Merged
merged 1 commit into from
Mar 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,9 @@ exclude = [
"Makefile"
]

[features]
default = ["nightly"]
nightly = ["tock-registers"]

[dependencies]
tock-registers = { version = "0.7.x", default-features = false } # Use it as interface-only library.
tock-registers = { version = "0.7.x", default-features = false, optional = true } # Use it as interface-only library.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ Low level access to Cortex-A processors.

## Minimum Supported Rust Version

Requires a recent nightly of Rust.
Requires a recent nightly of Rust if the (default) `nightly` feature is enabled. Without this the
register access module is not available.

## Usage

Expand Down
8 changes: 6 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,14 @@
//! Listed below is a snippet of `rust-raspberrypi-OS-tutorials`'s early boot code.
//!
//! ```rust
//! # #[cfg(feature = "nightly")]
//! use cortex_a::{asm, registers::*};
//! # #[cfg(feature = "nightly")]
//! use tock_registers::interfaces::Writeable; // <-- Trait needed to use `write()` and `set()`.
//!
//! // Some parts omitted for brevity.
//!
//! # #[cfg(feature = "nightly")]
//! unsafe fn prepare_el2_to_el1_transition(
//! virt_boot_core_stack_end_exclusive_addr: u64,
//! virt_kernel_init_addr: u64,
Expand Down Expand Up @@ -79,9 +82,10 @@
//! 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).

#![feature(core_intrinsics)]
#![feature(custom_inner_attributes)]
#![cfg_attr(feature = "nightly", feature(core_intrinsics))]
#![cfg_attr(feature = "nightly", feature(custom_inner_attributes))]
#![no_std]

pub mod asm;
#[cfg(feature = "nightly")]
pub mod registers;