Home
last modified time | relevance | path

Searched refs:vaddr (Results 1 – 4 of 4) sorted by relevance

/packages/modules/Virtualization/vmbase/example/src/
Dpci.rs138 let vaddr = unsafe { alloc_zeroed(layout) }; in dma_alloc() localVariable
139 let vaddr = in dma_alloc() localVariable
140 if let Some(vaddr) = NonNull::new(vaddr) { vaddr } else { handle_alloc_error(layout) }; in dma_alloc()
141 let paddr = virt_to_phys(vaddr); in dma_alloc()
142 (paddr, vaddr) in dma_alloc()
145 unsafe fn dma_dealloc(paddr: PhysAddr, vaddr: NonNull<u8>, pages: usize) -> i32 { in dma_dealloc()
151 dealloc(vaddr.as_ptr(), layout); in dma_dealloc()
166 let vaddr = buffer.cast(); in share() localVariable
168 virt_to_phys(vaddr) in share()
177 fn virt_to_phys(vaddr: NonNull<u8>) -> PhysAddr { in virt_to_phys()
[all …]
/packages/modules/Virtualization/vmbase/src/virtio/
Dhal.rs47 let vaddr = in dma_alloc() localVariable
50 unsafe { core::ptr::write_bytes(vaddr.as_ptr(), 0, layout.size()) }; in dma_alloc()
51 let paddr = virt_to_phys(vaddr); in dma_alloc()
52 (paddr, vaddr) in dma_alloc()
55 unsafe fn dma_dealloc(_paddr: PhysAddr, vaddr: NonNull<u8>, pages: usize) -> i32 { in dma_dealloc()
57 unsafe { dealloc_shared(vaddr, dma_layout(pages)) } in dma_dealloc()
/packages/modules/Virtualization/vmbase/src/memory/
Dshared.rs484 pub(crate) unsafe fn dealloc_shared(vaddr: NonNull<u8>, layout: Layout) -> hyp::Result<()> { in dealloc_shared()
485 SHARED_POOL.get().unwrap().lock().dealloc_aligned(vaddr.as_ptr() as usize, layout); in dealloc_shared()
521 for vaddr in (base..end).step_by(self.granule) { in refill()
522 let vaddr = NonNull::new(vaddr as *mut _).unwrap(); in refill() localVariable
523 mem_sharer.share(virt_to_phys(vaddr).try_into().unwrap()).unwrap(); in refill()
538 for vaddr in (base..end).step_by(self.granule) { in drop()
539 let vaddr = NonNull::new(vaddr as *mut _).unwrap(); in drop() localVariable
540 mem_sharer.unshare(virt_to_phys(vaddr).try_into().unwrap()).unwrap(); in drop()
Dutil.rs93 pub(crate) fn virt_to_phys(vaddr: NonNull<u8>) -> usize { in virt_to_phys()
94 vaddr.as_ptr() as _ in virt_to_phys()