mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-18 08:52:45 +00:00
add tid reporting
This commit is contained in:
parent
ecbce84385
commit
03388b1413
1 changed files with 3 additions and 2 deletions
|
|
@ -463,17 +463,18 @@ impl MemoryManager {
|
||||||
/// * MemoryInUse - The specified page is already mapped
|
/// * MemoryInUse - The specified page is already mapped
|
||||||
pub fn unmap_page(&mut self, virt: *mut usize) -> Result<usize, xous_kernel::Error> {
|
pub fn unmap_page(&mut self, virt: *mut usize) -> Result<usize, xous_kernel::Error> {
|
||||||
let pid = crate::arch::process::current_pid();
|
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
|
// If the virtual address has an assigned physical address, release that
|
||||||
// address from this process.
|
// address from this process.
|
||||||
if let Ok(phys) = crate::arch::mem::virt_to_phys(virt as usize) {
|
if let Ok(phys) = crate::arch::mem::virt_to_phys(virt as usize) {
|
||||||
self.release_page(phys as *mut usize, pid).ok();
|
self.release_page(phys as *mut usize, pid).ok();
|
||||||
#[cfg(feature = "swap")]
|
#[cfg(feature = "swap")]
|
||||||
Swap::with_mut(|s| s.advise_alloc(pid, virt as usize, phys, false));
|
Swap::with_mut(|s| s.advise_alloc(pid, tid, virt as usize, phys, false));
|
||||||
} else {
|
} else {
|
||||||
// return a null physical pointer if the virtual memory is just being freed
|
// return a null physical pointer if the virtual memory is just being freed
|
||||||
#[cfg(feature = "swap")]
|
#[cfg(feature = "swap")]
|
||||||
Swap::with_mut(|s| s.advise_alloc(pid, virt as usize, 0, false));
|
Swap::with_mut(|s| s.advise_alloc(pid, tid, virt as usize, 0, false));
|
||||||
};
|
};
|
||||||
|
|
||||||
// Free the virtual address.
|
// Free the virtual address.
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue