Kernel: Add vaddr/paddr conversion functions to DMARegion

This commit is contained in:
Bananymous 2023-10-12 15:20:05 +03:00
parent 89c975350d
commit b723ed5fd2
1 changed files with 3 additions and 0 deletions

View File

@ -15,6 +15,9 @@ namespace Kernel
vaddr_t vaddr() const { return m_vaddr; }
paddr_t paddr() const { return m_paddr; }
paddr_t vaddr_to_paddr(vaddr_t vaddr) const { return vaddr - m_vaddr + m_paddr; }
vaddr_t paddr_to_vaddr(paddr_t paddr) const { return paddr - m_paddr + m_vaddr; }
private:
DMARegion(size_t size, vaddr_t vaddr, paddr_t paddr);