Move Ahci Port Controller to hold raw references.

This commit is contained in:
Drew Galbraith 2025-01-31 21:23:42 -08:00
parent 0024e38412
commit 04effd44f8
2 changed files with 50 additions and 63 deletions

View file

@ -152,3 +152,10 @@ where
write!(f, "{:?}", self.read())
}
}
pub fn map_physical_and_leak(size: u64) -> (u64, u64) {
let (mem_cap, paddr) = syscall::memory_object_contiguous_physical(size).unwrap();
let vaddr = syscall::address_space_map(&mem_cap).unwrap();
mem_cap.release();
(vaddr, paddr)
}