From bf3a67a7e497dac360b18df62d9f83681347ca06 Mon Sep 17 00:00:00 2001 From: dzy Date: Wed, 26 Dec 2018 15:03:35 +0800 Subject: [PATCH] remap_kernel runs fine --- kernel/src/arch/riscv32/paging.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/kernel/src/arch/riscv32/paging.rs b/kernel/src/arch/riscv32/paging.rs index a10f90c..fa3bab2 100644 --- a/kernel/src/arch/riscv32/paging.rs +++ b/kernel/src/arch/riscv32/paging.rs @@ -420,8 +420,12 @@ impl InactivePageTable for InactivePageTable0 { } #[cfg(target_arch = "riscv64")] fn token(&self) -> usize { - unimplemented!(); - 0 // TODO + use bit_field::BitField; + info!("{}", self.root_frame.number()); + let mut satp = self.root_frame.number(); + satp.set_bits(44..60, 0); // AS is 0 + satp.set_bits(60..64, satp::Mode::Sv48 as usize); // Mode is Sv48 + satp } fn alloc_frame() -> Option {