diff --git a/kernel/include/kernel/Memory/DMARegion.h b/kernel/include/kernel/Memory/DMARegion.h index bd0585e189..bf6b58eb41 100644 --- a/kernel/include/kernel/Memory/DMARegion.h +++ b/kernel/include/kernel/Memory/DMARegion.h @@ -8,7 +8,7 @@ namespace Kernel class DMARegion { public: - BAN::ErrorOr> create(size_t size); + static BAN::ErrorOr> create(size_t size); ~DMARegion(); size_t size() const { return m_size; } diff --git a/kernel/kernel/Memory/DMARegion.cpp b/kernel/kernel/Memory/DMARegion.cpp index 645356e254..2ffd978de9 100644 --- a/kernel/kernel/Memory/DMARegion.cpp +++ b/kernel/kernel/Memory/DMARegion.cpp @@ -26,7 +26,7 @@ namespace Kernel vaddr_guard.disable(); paddr_guard.disable(); - PageTable::kernel().map_range_at(paddr, vaddr, size, PageTable::Flags::CacheDisable | PageTable::Flags::ReadWrite | PageTable::Flags::Reserved); + PageTable::kernel().map_range_at(paddr, vaddr, size, PageTable::Flags::CacheDisable | PageTable::Flags::ReadWrite | PageTable::Flags::Present); return BAN::UniqPtr::adopt(region_ptr); } @@ -40,7 +40,7 @@ namespace Kernel DMARegion::~DMARegion() { PageTable::kernel().unmap_range(m_vaddr, m_size); - Heap::get().release_contiguous_pages(m_vaddr, BAN::Math::div_round_up(m_size, PAGE_SIZE)); + Heap::get().release_contiguous_pages(m_paddr, BAN::Math::div_round_up(m_size, PAGE_SIZE)); } }