Skip to content

Commit

Permalink
add feature gate for nightly and no_std
Browse files Browse the repository at this point in the history
  • Loading branch information
jounathaen committed Feb 20, 2024
1 parent b7c75dd commit e6dbf7f
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 1 deletion.
6 changes: 6 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ license = "MIT/Apache-2.0"
edition = '2021'
exclude = ["/.gitlab-ci.yml", ".gitignore", ".gitattributes", "/.github/*"]

[features]
default = ["nightly", "no_std"]
nightly = ["asm_const"]
asm_const = []
no_std = []

[dependencies]
aarch64-cpu = { version = "9.3" }
tock-registers = { version = "0.8.x", default-features = false }
1 change: 1 addition & 0 deletions src/instructions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ pub fn halt() {
unsafe { asm!("wfi", options(nomem, nostack)) }
}

#[cfg(asm_const)]
mod exceptions {
use core::arch::asm;

Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

#![allow(dead_code)]
#![allow(stable_features)]
#![feature(asm_const, core_intrinsics)]
#![cfg_attr(feature = "asm_const", feature(asm_const))]
#![no_std]

pub mod instructions;
Expand Down
1 change: 1 addition & 0 deletions src/paging.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#[cfg(no_std)]
use core::convert::{From, Into};
use core::fmt;
use core::ops;
Expand Down

0 comments on commit e6dbf7f

Please sign in to comment.