From bf1666abefe1321d7fa8ea4dcf8a7c5909c718dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Kr=C3=B6ning?= Date: Wed, 21 Feb 2024 14:25:50 +0100 Subject: [PATCH 1/5] fix(paging): unused_imports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Jonathan Klimt Signed-off-by: Martin Kröning --- src/paging.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/paging.rs b/src/paging.rs index 609a9fe..c552ef4 100644 --- a/src/paging.rs +++ b/src/paging.rs @@ -1,4 +1,3 @@ -use core::convert::{From, Into}; use core::fmt; use core::ops; From 5e0366583e975df7c69a63f63a5c7003ae0a4b2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Kr=C3=B6ning?= Date: Wed, 21 Feb 2024 14:26:58 +0100 Subject: [PATCH 2/5] fix: disable unused core_intrinsics feature MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Jonathan Klimt Signed-off-by: Martin Kröning --- src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index fe781d6..74a03d0 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -7,7 +7,7 @@ #![allow(dead_code)] #![allow(stable_features)] -#![feature(asm_const, core_intrinsics)] +#![feature(asm_const)] #![no_std] pub mod instructions; From 422a5ebd1257341cca6ac4859e51a74f30bc12ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Kr=C3=B6ning?= Date: Wed, 21 Feb 2024 14:29:37 +0100 Subject: [PATCH 3/5] fix: don't allow stable_features MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Jonathan Klimt Signed-off-by: Martin Kröning --- src/lib.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index 74a03d0..0a6e9a9 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -6,7 +6,6 @@ // copied, modified, or distributed except according to those terms. #![allow(dead_code)] -#![allow(stable_features)] #![feature(asm_const)] #![no_std] From e624fa17ed96cd41be3afaa3eee26ee29d28818e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Kr=C3=B6ning?= Date: Wed, 21 Feb 2024 14:38:37 +0100 Subject: [PATCH 4/5] feat: add `nightly` feature MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Jonathan Klimt Signed-off-by: Martin Kröning --- Cargo.toml | 4 ++++ src/instructions.rs | 1 + src/lib.rs | 2 +- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index e5e4f58..4ced634 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -16,3 +16,7 @@ exclude = ["/.gitlab-ci.yml", ".gitignore", ".gitattributes", "/.github/*"] [dependencies] aarch64-cpu = { version = "9.3" } tock-registers = { version = "0.8.x", default-features = false } + +[features] +default = ["nightly"] +nightly = [] diff --git a/src/instructions.rs b/src/instructions.rs index 8628345..2a1ef06 100644 --- a/src/instructions.rs +++ b/src/instructions.rs @@ -6,6 +6,7 @@ pub fn halt() { unsafe { asm!("wfi", options(nomem, nostack)) } } +#[cfg(feature = "nightly")] mod exceptions { use core::arch::asm; diff --git a/src/lib.rs b/src/lib.rs index 0a6e9a9..98f9bde 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -6,7 +6,7 @@ // copied, modified, or distributed except according to those terms. #![allow(dead_code)] -#![feature(asm_const)] +#![cfg_attr(feature = "nightly", feature(asm_const))] #![no_std] pub mod instructions; From a9e418493ae486f8a14fb524685a78307239c33f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Kr=C3=B6ning?= Date: Wed, 21 Feb 2024 14:39:04 +0100 Subject: [PATCH 5/5] feat(instructions): make exceptions module public MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Jonathan Klimt Signed-off-by: Martin Kröning --- src/instructions.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/instructions.rs b/src/instructions.rs index 2a1ef06..03631bd 100644 --- a/src/instructions.rs +++ b/src/instructions.rs @@ -7,7 +7,8 @@ pub fn halt() { } #[cfg(feature = "nightly")] -mod exceptions { +#[allow(clippy::missing_safety_doc)] +pub mod exceptions { use core::arch::asm; /// Generate an exception targeting EL1, with the specified exception code