From 5d288ec9a8d77e0781ec3cd0ab82564453a04631 Mon Sep 17 00:00:00 2001 From: bunnie Date: Sun, 18 May 2025 09:25:33 +0800 Subject: [PATCH] cleanup dependencies to allow for hosted builds --- services/xous-swapper/Cargo.toml | 2 +- services/xous-swapper/src/lib.rs | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/services/xous-swapper/Cargo.toml b/services/xous-swapper/Cargo.toml index 6195b7d79..655c0aaeb 100644 --- a/services/xous-swapper/Cargo.toml +++ b/services/xous-swapper/Cargo.toml @@ -17,7 +17,7 @@ xous-ipc = "0.10.6" num-derive = { version = "0.4.2", default-features = false } num-traits = { version = "0.2.14", default-features = false } log = "0.4.14" -loader = { path = "../../loader", features = ["swap"] } +loader = { path = "../../loader", features = ["swap"], optional = true } aes-gcm-siv = { version = "0.11.1", default-features = false, features = [ "aes", ] } diff --git a/services/xous-swapper/src/lib.rs b/services/xous-swapper/src/lib.rs index cae786708..44ba9e574 100644 --- a/services/xous-swapper/src/lib.rs +++ b/services/xous-swapper/src/lib.rs @@ -1,3 +1,8 @@ +#[cfg(feature = "cramium-soc")] +use cramium_hal::board::SPINOR_ERASE_SIZE; +#[cfg(any(feature = "precursor", feature = "renode"))] +use precursor_hal::board::SPINOR_ERASE_SIZE; + pub const PAGE_SIZE: usize = xous::arch::PAGE_SIZE; /// userspace swapper -> kernel ABI @@ -116,7 +121,6 @@ impl Swapper { use core::sync::atomic::{AtomicU32, Ordering}; use std::num::NonZero; -use cramium_hal::board::SPINOR_ERASE_SIZE; use num_traits::ToPrimitive; use xous::{MemoryMessage, MemoryRange}; static REFCOUNT: AtomicU32 = AtomicU32::new(0);