mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 15:40:19 +00:00
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.
This commit is contained in:
parent
b22149601a
commit
37b4133c51
Notes:
sideshowbarker
2024-07-17 08:57:43 +09:00
Author: https://github.com/supercomputer7 Commit: https://github.com/SerenityOS/serenity/commit/37b4133c51 Pull-request: https://github.com/SerenityOS/serenity/pull/14522 Reviewed-by: https://github.com/awesomekling
1 changed files with 1 additions and 1 deletions
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue