mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-15 08:30:02 +00:00
kernel: services: add more debug print crumbs
These could be useful in finding out what's gone wrong. Signed-off-by: Sean Cross <sean@xobs.io>
This commit is contained in:
parent
cc0c395e1e
commit
455bd4ccfb
1 changed files with 36 additions and 5 deletions
|
|
@ -1142,6 +1142,7 @@ impl SystemServices {
|
|||
.find_virtual_address(dest_virt, len, xous_kernel::MemoryType::Messages)
|
||||
.or_else(|e| {
|
||||
src_mapping.activate().unwrap();
|
||||
// klog!("Couldn't find a virtual address");
|
||||
Err(e)
|
||||
})?;
|
||||
src_mapping.activate().unwrap();
|
||||
|
|
@ -1162,10 +1163,23 @@ impl SystemServices {
|
|||
)
|
||||
.unwrap_or_else(|e| {
|
||||
error = Some(e);
|
||||
// klog!(
|
||||
// "Couldn't lend page {:08x} -> {:08x}",
|
||||
// src_virt.wrapping_add(offset) as usize,
|
||||
// dest_virt.wrapping_add(offset) as usize
|
||||
// );
|
||||
0
|
||||
});
|
||||
}
|
||||
error.map_or_else(|| Ok(dest_virt), |e| panic!("unable to lend: {:?}", e))
|
||||
error.map_or_else(
|
||||
|| Ok(dest_virt),
|
||||
|e| {
|
||||
panic!(
|
||||
"unable to lend {:08x} in pid {} to {:08x} in pid {}: {:?}",
|
||||
src_virt as usize, current_pid, dest_virt as usize, dest_pid, e
|
||||
)
|
||||
},
|
||||
)
|
||||
})
|
||||
}
|
||||
|
||||
|
|
@ -1203,17 +1217,28 @@ impl SystemServices {
|
|||
len: usize,
|
||||
_buf: MemoryRange,
|
||||
) -> Result<*mut u8, xous_kernel::Error> {
|
||||
// klog!(
|
||||
// "Returning from {}:{} to {}:{}",
|
||||
// self.current_pid(),
|
||||
// _src_tid,
|
||||
// dest_pid,
|
||||
// _dest_tid
|
||||
// );
|
||||
if len == 0 {
|
||||
return Err(xous_kernel::Error::BadAddress);
|
||||
// klog!("No len");
|
||||
Err(xous_kernel::Error::BadAddress)?;
|
||||
}
|
||||
if len & 0xfff != 0 {
|
||||
return Err(xous_kernel::Error::BadAddress);
|
||||
// klog!("len not aligned");
|
||||
Err(xous_kernel::Error::BadAddress)?;
|
||||
}
|
||||
if src_virt as usize & 0xfff != 0 {
|
||||
return Err(xous_kernel::Error::BadAddress);
|
||||
// klog!("Src virt not aligned");
|
||||
Err(xous_kernel::Error::BadAddress)?;
|
||||
}
|
||||
if dest_virt as usize & 0xfff != 0 {
|
||||
return Err(xous_kernel::Error::BadAddress);
|
||||
// klog!("dest virt not aligned");
|
||||
Err(xous_kernel::Error::BadAddress)?;
|
||||
}
|
||||
|
||||
let current_pid = self.current_pid();
|
||||
|
|
@ -1235,6 +1260,12 @@ impl SystemServices {
|
|||
dest_virt.wrapping_add(offset),
|
||||
)
|
||||
.unwrap_or_else(|e| {
|
||||
// panic!(
|
||||
// "Couldn't unlend {:08x} from {:08x}: {:?}",
|
||||
// src_virt.wrapping_add(offset) as usize,
|
||||
// dest_virt.wrapping_add(offset) as usize,
|
||||
// e
|
||||
// );
|
||||
error = Some(e);
|
||||
0
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in a new issue