mirror of
https://github.com/asterinas/asterinas.git
synced 2025-06-08 12:56:48 +00:00
Add logs to DMA mapping and unmapping
This commit is contained in:
parent
9a165ec41a
commit
b1c066c1ad
@ -5,6 +5,7 @@
|
||||
use alloc::collections::BTreeMap;
|
||||
use core::mem::size_of;
|
||||
|
||||
use log::trace;
|
||||
use ostd_pod::Pod;
|
||||
|
||||
use super::second_stage::{DeviceMode, PageTableEntry, PagingConsts};
|
||||
@ -296,6 +297,12 @@ impl ContextTable {
|
||||
if device.device >= 32 || device.function >= 8 {
|
||||
return Err(ContextTableError::InvalidDeviceId);
|
||||
}
|
||||
trace!(
|
||||
"Mapping Daddr: {:x?} to Paddr: {:x?} for device: {:x?}",
|
||||
daddr,
|
||||
paddr,
|
||||
device
|
||||
);
|
||||
self.get_or_create_page_table(device)
|
||||
.map(
|
||||
&(daddr..daddr + PAGE_SIZE),
|
||||
@ -314,6 +321,7 @@ impl ContextTable {
|
||||
if device.device >= 32 || device.function >= 8 {
|
||||
return Err(ContextTableError::InvalidDeviceId);
|
||||
}
|
||||
trace!("Unmapping Daddr: {:x?} for device: {:x?}", daddr, device);
|
||||
let pt = self.get_or_create_page_table(device);
|
||||
let mut cursor = pt.cursor_mut(&(daddr..daddr + PAGE_SIZE)).unwrap();
|
||||
unsafe {
|
||||
|
Loading…
x
Reference in New Issue
Block a user