mirror of
https://github.com/rcore-os/rCore.git
synced 2024-11-23 00:16:17 +04:00
runs without pagefault but does not reach end of remap_kernel
This commit is contained in:
parent
a4348428a6
commit
ccee527272
@ -25,7 +25,7 @@ if [[ ${RV32} = 1 ]]; then
|
||||
UCORE_USER_IMAGE="../user/img/ucore-rv32.img"
|
||||
else
|
||||
TARGET_ARCH=riscv64
|
||||
export LOG=trace
|
||||
export LOG=warn
|
||||
COMPILER_RT_CFLAGS="-march=rv64ia -mabi=lp64 -O3"
|
||||
SFSIMG_CFLAGS="-march=rv64ia -mabi=lp64"
|
||||
RISCV_PK_CONFIGURE_FLAGS="--with-arch=rv64imac --disable-fp-emulation --host=riscv64-unknown-elf"
|
||||
|
@ -91,7 +91,7 @@ fn remap_the_kernel() {
|
||||
|
||||
#[cfg(all(target_arch = "riscv64", not(feature = "no_mmu")))]
|
||||
fn remap_the_kernel() {
|
||||
info!("remap the kernel begin, satp: {:x}", satp::read().bits());
|
||||
error!("remap the kernel begin, satp: {:x}", satp::read().bits());
|
||||
let mut ms = MemorySet::new_bare();
|
||||
info!("ms new bare");
|
||||
#[cfg(feature = "no_bbl")]
|
||||
@ -111,7 +111,7 @@ fn remap_the_kernel() {
|
||||
unsafe { SATP = ms.token(); }
|
||||
info!("satp token ok");
|
||||
mem::forget(ms);
|
||||
info!("kernel remap end");
|
||||
error!("kernel remap end");
|
||||
}
|
||||
|
||||
// First core stores its SATP here.
|
||||
|
@ -281,16 +281,11 @@ impl ActivePageTable {
|
||||
|
||||
/// implementation for the Entry trait in /crate/memory/src/paging/mod.rs
|
||||
impl Entry for PageEntry {
|
||||
// TODO: merge below two
|
||||
#[cfg(target_arch = "riscv64")]
|
||||
fn update(&mut self) {
|
||||
assert!(false, "can't update");
|
||||
let mut addr: usize = (self as *const _ as usize) << 9;
|
||||
if (addr & 0x7000_0000_0000 != 0) {
|
||||
addr |= 0xFFFF_0000_0000_0000;
|
||||
} else {
|
||||
addr &= 0x0000_FFFF_FFFF_FFFF;
|
||||
}
|
||||
sfence_vma(0, VirtAddr::new(addr));
|
||||
edit_entry_of(&self.1, |entry| *entry = self.0);
|
||||
sfence_vma(0, self.1.start_address());
|
||||
}
|
||||
#[cfg(target_arch = "riscv32")]
|
||||
fn update(&mut self) {
|
||||
|
Loading…
Reference in New Issue
Block a user