diff --git a/src/arch/x86/rmm.rs b/src/arch/x86/rmm.rs index 380505e..7827a7e 100644 --- a/src/arch/x86/rmm.rs +++ b/src/arch/x86/rmm.rs @@ -17,6 +17,7 @@ use rmm::{ PageFlags, PageMapper, PhysicalAddress, + TableKind, VirtualAddress, }; use spin::Mutex; @@ -100,6 +101,7 @@ unsafe fn inner( { let mut mapper = PageMapper::::create( + TableKind::Kernel, &mut bump_allocator ).expect("failed to create Mapper"); @@ -298,7 +300,7 @@ impl KernelMapper { } } pub fn lock_manually(current_processor: usize) -> Self { - unsafe { Self::lock_for_manual_mapper(current_processor, PageMapper::new(RmmA::table(), FRAME_ALLOCATOR)) } + unsafe { Self::lock_for_manual_mapper(current_processor, PageMapper::current(TableKind::Kernel, FRAME_ALLOCATOR)) } } pub fn lock() -> Self { Self::lock_manually(crate::cpu_id()) diff --git a/src/arch/x86/start.rs b/src/arch/x86/start.rs index 1a29189..84b063a 100644 --- a/src/arch/x86/start.rs +++ b/src/arch/x86/start.rs @@ -18,7 +18,7 @@ use crate::gdt; use crate::idt; use crate::interrupt; use crate::log::{self, info}; -use crate::paging::{self, KernelMapper}; +use crate::paging::{self, KernelMapper, TableKind}; /// Test of zero values in BSS. static BSS_TEST_ZERO: usize = 0; @@ -234,7 +234,7 @@ pub unsafe extern fn kstart_ap(args_ptr: *const KernelArgsAp) -> ! { use crate::paging::{PageMapper, PhysicalAddress}; use crate::rmm::FRAME_ALLOCATOR; - let mut mapper = KernelMapper::lock_for_manual_mapper(cpu_id, PageMapper::new(PhysicalAddress::new(bsp_table), FRAME_ALLOCATOR)); + let mut mapper = KernelMapper::lock_for_manual_mapper(cpu_id, PageMapper::new(TableKind::Kernel, PhysicalAddress::new(bsp_table), FRAME_ALLOCATOR)); paging::init_ap(cpu_id, &mut mapper) }; diff --git a/src/context/arch/x86.rs b/src/context/arch/x86.rs index 62fb8d9..8a5ce7b 100644 --- a/src/context/arch/x86.rs +++ b/src/context/arch/x86.rs @@ -4,7 +4,7 @@ use core::sync::atomic::AtomicBool; use alloc::sync::Arc; use crate::gdt::{GDT, GDT_TSS}; -use crate::paging::{RmmA, RmmArch}; +use crate::paging::{RmmA, RmmArch, TableKind}; use crate::syscall::FloatRegisters; use memoffset::offset_of;