diff options
author | Liav A <liavalb@gmail.com> | 2022-07-08 19:17:57 +0300 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2022-07-14 13:15:24 +0200 |
commit | 37b4133c5154157664100dbfb268aa9008a2b832 (patch) | |
tree | 54f0aa3f094e7ef3c8d6ebaccd2d387164295998 | |
parent | b22149601a889b57651449ef994d10baf92886d6 (diff) | |
download | serenity-37b4133c5154157664100dbfb268aa9008a2b832.zip |
Kernel: Allocate user physical pages instead of supervisor ones for DMA
We are limited on the amount of supervisor pages we can allocate, so
don't allocate from that pool. Supervisor pages are always below 16 MiB
barrier so using those was crucial when we used devices like the ISA
SoundBlaster 16 card, because that device required very low physical
addresses to be used.
-rw-r--r-- | Kernel/Memory/MemoryManager.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Kernel/Memory/MemoryManager.cpp b/Kernel/Memory/MemoryManager.cpp index 31de498efe..4c5e8083f3 100644 --- a/Kernel/Memory/MemoryManager.cpp +++ b/Kernel/Memory/MemoryManager.cpp @@ -791,7 +791,7 @@ ErrorOr<NonnullOwnPtr<Memory::Region>> MemoryManager::allocate_dma_buffer_page(S ErrorOr<NonnullOwnPtr<Memory::Region>> MemoryManager::allocate_dma_buffer_pages(size_t size, StringView name, Memory::Region::Access access, NonnullRefPtrVector<Memory::PhysicalPage>& dma_buffer_pages) { VERIFY(!(size % PAGE_SIZE)); - dma_buffer_pages = TRY(allocate_contiguous_supervisor_physical_pages(size)); + dma_buffer_pages = TRY(allocate_contiguous_user_physical_pages(size)); // Do not enable Cache for this region as physical memory transfers are performed (Most architectures have this behaviour by default) return allocate_kernel_region(dma_buffer_pages.first().paddr(), size, name, access, Region::Cacheable::No); } |