From 23c2b77ace824b4d3215c9450f2ef0c203be84c8 Mon Sep 17 00:00:00 2001 From: bunnie Date: Sun, 18 May 2025 09:24:22 +0800 Subject: [PATCH] fix hosted build --- kernel/Cargo.toml | 1 + kernel/src/mem.rs | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/kernel/Cargo.toml b/kernel/Cargo.toml index 90b17a1b3..dc7b9de87 100644 --- a/kernel/Cargo.toml +++ b/kernel/Cargo.toml @@ -55,6 +55,7 @@ cramium-fpga = ["utralib/cramium-fpga", "rand_chacha"] board-baosec = ["cramium-hal/kernel-baosec", "memmap-flash", "swap"] board-baosor = ["cramium-hal/kernel-baosor"] board-dabao = ["cramium-hal/kernel-dabao"] +hosted-baosec = [] atsama5d27 = ["utralib/atsama5d27"] precursor = ["utralib/precursor"] diff --git a/kernel/src/mem.rs b/kernel/src/mem.rs index 4f8d8d0f7..72c62af99 100644 --- a/kernel/src/mem.rs +++ b/kernel/src/mem.rs @@ -6,10 +6,9 @@ use core::fmt; use xous_kernel::{MemoryFlags, MemoryRange, PID, arch::*}; pub use crate::arch::mem::MemoryMapping; -use crate::arch::{ - mem::{MMUFlags, flush_mmu, pagetable_entry}, - process::Process, -}; +#[cfg(baremetal)] +use crate::arch::mem::{MMUFlags, flush_mmu, pagetable_entry}; +use crate::arch::process::Process; #[cfg(feature = "swap")] use crate::swap::SwapAlloc; @@ -621,6 +620,7 @@ impl MemoryManager { // just allocate the region as "swapped". No further checks is done on the validity of the requested // range - if the range is out of bounds, it will be caught as a runtime error in the resolver // that attempts to find the physical page that corresponds to a virtual mapping. + #[cfg(baremetal)] if phys == 0 && (flags & MemoryFlags::VIRT == MemoryFlags::VIRT) && ((virt_ptr as usize & MMAP_VIRT_BASE) == MMAP_VIRT_BASE)