mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-23 18:02:05 -05: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
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…
Add table
Reference in a new issue