diff --git a/modules/axmm/src/lib.rs b/modules/axmm/src/lib.rs index 3772b1b64b..32cc0819f9 100644 --- a/modules/axmm/src/lib.rs +++ b/modules/axmm/src/lib.rs @@ -19,9 +19,6 @@ use lazyinit::LazyInit; use memory_addr::{va, PhysAddr, VirtAddr}; use memory_set::MappingError; -const USER_ASPACE_BASE: usize = 0x1000; -const USER_ASPACE_SIZE: usize = 0x7fff_ffff_f000; - static KERNEL_ASPACE: LazyInit> = LazyInit::new(); fn mapping_err_to_ax_err(err: MappingError) -> AxError { @@ -46,8 +43,8 @@ pub fn new_kernel_aspace() -> AxResult { } /// Creates a new address space for user processes. -pub fn new_user_aspace() -> AxResult { - let mut aspace = AddrSpace::new_empty(VirtAddr::from(USER_ASPACE_BASE), USER_ASPACE_SIZE)?; +pub fn new_user_aspace(base: VirtAddr, size: usize) -> AxResult { + let mut aspace = AddrSpace::new_empty(base, size)?; if !cfg!(target_arch = "aarch64") { // ARMv8 use a separate page table (TTBR0_EL1) for user space, it // doesn't need to copy the kernel portion to the user page table.