From 058db866fe3f216190e028435557d82fd3277acc Mon Sep 17 00:00:00 2001 From: Sean Cross Date: Tue, 6 Feb 2024 10:27:11 +0800 Subject: [PATCH] xous: support `riscv32imac-unknown-none-elf` The kernel must go back to using this target, as the primary target no longer supports building with `panic = "abort"`. Signed-off-by: Sean Cross --- xous-rs/src/arch/mod.rs | 20 ++++++++++++++------ xous-rs/src/definitions.rs | 4 ++-- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/xous-rs/src/arch/mod.rs b/xous-rs/src/arch/mod.rs index c283fa3f0..d6368d389 100644 --- a/xous-rs/src/arch/mod.rs +++ b/xous-rs/src/arch/mod.rs @@ -1,16 +1,24 @@ -#[cfg(all(target_os = "xous", target_arch = "arm"))] +#[cfg(all(any(target_os = "none", target_os = "xous"), target_arch = "arm"))] mod arm; -#[cfg(all(target_os = "xous", target_arch = "arm"))] +#[cfg(all(any(target_os = "none", target_os = "xous"), target_arch = "arm"))] pub use arm::*; -#[cfg(all(target_os = "xous", target_arch = "riscv32"))] +#[cfg(all(any(target_os = "xous", target_os = "none"), target_arch = "riscv32"))] pub mod riscv; -#[cfg(all(target_os = "xous", target_arch = "riscv32"))] +#[cfg(all(any(target_os = "xous", target_os = "none"), target_arch = "riscv32"))] pub use riscv::*; -#[cfg(all(not(feature = "processes-as-threads"), not(target_os = "xous"), not(target_arch = "arm"),))] +#[cfg(all( + not(feature = "processes-as-threads"), + not(any(target_os = "xous", target_os = "none")), + not(target_arch = "arm"), +))] pub mod hosted; -#[cfg(all(not(feature = "processes-as-threads"), not(target_os = "xous"), not(target_arch = "arm"),))] +#[cfg(all( + not(feature = "processes-as-threads"), + not(any(target_os = "xous", target_os = "none")), + not(target_arch = "arm"), +))] pub use hosted::*; #[cfg(feature = "processes-as-threads")] diff --git a/xous-rs/src/definitions.rs b/xous-rs/src/definitions.rs index 5c0957950..75f755ab2 100644 --- a/xous-rs/src/definitions.rs +++ b/xous-rs/src/definitions.rs @@ -55,7 +55,7 @@ pub const BASE_QUANTA_MS: u32 = 10; pub const BOOKEND_START: &str = "_|TT|_"; pub const BOOKEND_END: &str = "_|TE|_"; -#[cfg(not(target_os = "xous"))] +#[cfg(not(any(target_os = "xous", target_os = "none")))] use core::sync::atomic::AtomicU64; // Secretly, you can change this by setting the XOUS_SEED environment variable. @@ -64,7 +64,7 @@ use core::sync::atomic::AtomicU64; // The code that reads the varable this is all the way over in xous-rs\src\arch\hosted\mod.rs#29, and // it's glommed onto some other static process initialization code because I don't fully understand // what's going on over there. -#[cfg(not(target_os = "xous"))] +#[cfg(not(any(target_os = "xous", target_os = "none")))] pub static TESTING_RNG_SEED: AtomicU64 = AtomicU64::new(0); pub mod exceptions;