This repository was archived by the owner on Nov 7, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +13
-4
lines changed Expand file tree Collapse file tree 3 files changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -19,5 +19,9 @@ exclude = [
19
19
" Makefile"
20
20
]
21
21
22
+ [features ]
23
+ default = [" nightly" ]
24
+ nightly = [" tock-registers" ]
25
+
22
26
[dependencies ]
23
- tock-registers = { version = " 0.7.x" , default-features = false } # Use it as interface-only library.
27
+ tock-registers = { version = " 0.7.x" , default-features = false , optional = true } # Use it as interface-only library.
Original file line number Diff line number Diff line change @@ -12,7 +12,8 @@ Low level access to Cortex-A processors.
12
12
13
13
## Minimum Supported Rust Version
14
14
15
- Requires a recent nightly of Rust.
15
+ Requires a recent nightly of Rust if the (default) ` nightly ` feature is enabled. Without this the
16
+ register access module is not available.
16
17
17
18
## Usage
18
19
Original file line number Diff line number Diff line change 47
47
//! code.
48
48
//!
49
49
//! ```rust
50
+ //! # #[cfg(feature = "nightly")]
50
51
//! use cortex_a::{asm, registers::*};
52
+ //! # #[cfg(feature = "nightly")]
51
53
//! use tock_registers::interfaces::Writeable; // <-- Trait needed to use `write()` and `set()`.
52
54
//!
53
55
//! // Some parts omitted for brevity.
54
56
//!
57
+ //! # #[cfg(feature = "nightly")]
55
58
//! unsafe fn prepare_el2_to_el1_transition(
56
59
//! virt_boot_core_stack_end_exclusive_addr: u64,
57
60
//! virt_kernel_init_addr: u64,
82
85
//! ARMv8, for ARMv8-A architecture
83
86
//! profile](https://static.docs.arm.com/ddi0487/ca/DDI0487C_a_armv8_arm.pdf?_ga=2.266626254.1122218691.1534883460-1326731866.1530967873).
84
87
85
- #![ feature( core_intrinsics) ]
86
- #![ feature( custom_inner_attributes) ]
88
+ #![ cfg_attr ( feature = "nightly" , feature ( core_intrinsics) ) ]
89
+ #![ cfg_attr ( feature = "nightly" , feature ( custom_inner_attributes) ) ]
87
90
#![ no_std]
88
91
89
92
pub mod asm;
93
+ #[ cfg( feature = "nightly" ) ]
90
94
pub mod registers;
You can’t perform that action at this time.
0 commit comments