mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-15 08:30:02 +00:00
fix bug where pages were not marked as belonging to USER
it's assumed the kernel would never want to access the flash directly, so no mode is implemented to support this possibility.
This commit is contained in:
parent
3f0b833b90
commit
b8c30c32ac
1 changed files with 11 additions and 1 deletions
|
|
@ -6,7 +6,10 @@ use core::fmt;
|
|||
use xous_kernel::{MemoryFlags, MemoryRange, PID, arch::*};
|
||||
|
||||
pub use crate::arch::mem::MemoryMapping;
|
||||
use crate::arch::process::Process;
|
||||
use crate::arch::{
|
||||
mem::{MMUFlags, flush_mmu, pagetable_entry},
|
||||
process::Process,
|
||||
};
|
||||
#[cfg(feature = "swap")]
|
||||
use crate::swap::SwapAlloc;
|
||||
|
||||
|
|
@ -635,6 +638,13 @@ impl MemoryManager {
|
|||
// not automatically set on write/update). Valid is not set, because it's not
|
||||
// wired into memory, and "P" (swap) is set to indicate this is a swapper managed page.
|
||||
mm.reserve_address(self, virt, MemoryFlags::R | MemoryFlags::W | MemoryFlags::P)?;
|
||||
|
||||
// now mark the page as USER
|
||||
let pte = pagetable_entry(virt)?;
|
||||
unsafe {
|
||||
pte.write_volatile(pte.read_volatile() | MMUFlags::USER.bits());
|
||||
flush_mmu();
|
||||
}
|
||||
}
|
||||
// note that the region returned is snapped to the nearest page boundary, even if
|
||||
// the use called us with unaligned addresses.
|
||||
|
|
|
|||
Loading…
Reference in a new issue