mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-16 08:38:26 +00:00
remove swap-specific patches now that we're patched at the syscall entry point
This commit is contained in:
parent
5645a645e5
commit
fa23a6f829
1 changed files with 2 additions and 9 deletions
|
|
@ -6,7 +6,7 @@ use core::fmt;
|
|||
use xous_kernel::{MemoryFlags, MemoryRange, PID};
|
||||
|
||||
pub use crate::arch::mem::{MemoryMapping, PAGE_SIZE};
|
||||
use crate::{arch::process::Process, swap::Swap};
|
||||
use crate::arch::process::Process;
|
||||
|
||||
#[derive(Debug)]
|
||||
enum ClaimReleaseMove {
|
||||
|
|
@ -463,19 +463,12 @@ impl MemoryManager {
|
|||
/// * MemoryInUse - The specified page is already mapped
|
||||
pub fn unmap_page(&mut self, virt: *mut usize) -> Result<usize, xous_kernel::Error> {
|
||||
let pid = crate::arch::process::current_pid();
|
||||
let tid = crate::arch::process::current_tid();
|
||||
|
||||
// If the virtual address has an assigned physical address, release that
|
||||
// address from this process.
|
||||
if let Ok(phys) = crate::arch::mem::virt_to_phys(virt as usize) {
|
||||
self.release_page(phys as *mut usize, pid).ok();
|
||||
#[cfg(feature = "swap")]
|
||||
Swap::with_mut(|s| s.advise_alloc(pid, tid, virt as usize, phys, false));
|
||||
} else {
|
||||
// return a null physical pointer if the virtual memory is just being freed
|
||||
#[cfg(feature = "swap")]
|
||||
Swap::with_mut(|s| s.advise_alloc(pid, tid, virt as usize, 0, false));
|
||||
};
|
||||
}
|
||||
|
||||
// Free the virtual address.
|
||||
crate::arch::mem::unmap_page_inner(self, virt as usize)
|
||||
|
|
|
|||
Loading…
Reference in a new issue