mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-30 12:49:19 +00:00
Kernel: Set Cacheable parameter to NO explicitly in DMA helpers
The cacheable parameter to allocate_kernel_region should be explicitly set to No as this region is used to do physical memory transfers. Even though most architectures ignore this even if it is set, it is better to make this explicit.
This commit is contained in:
parent
c5fb55725e
commit
e79f94f998
Notes:
sideshowbarker
2024-07-17 21:23:15 +09:00
Author: https://github.com/Panky-codes
Commit: e79f94f998
Pull-request: https://github.com/SerenityOS/serenity/pull/11687
Reviewed-by: https://github.com/Quaker762
Reviewed-by: https://github.com/alimpfard
1 changed files with 4 additions and 2 deletions
|
@ -748,7 +748,8 @@ ErrorOr<NonnullOwnPtr<Memory::Region>> MemoryManager::allocate_dma_buffer_page(S
|
|||
dma_buffer_page = allocate_supervisor_physical_page();
|
||||
if (dma_buffer_page.is_null())
|
||||
return ENOMEM;
|
||||
auto region_or_error = allocate_kernel_region(dma_buffer_page->paddr(), PAGE_SIZE, name, access);
|
||||
// Do not enable Cache for this region as physical memory transfers are performed (Most architectures have this behaviour by default)
|
||||
auto region_or_error = allocate_kernel_region(dma_buffer_page->paddr(), PAGE_SIZE, name, access, Region::Cacheable::No);
|
||||
return region_or_error;
|
||||
}
|
||||
|
||||
|
@ -758,7 +759,8 @@ ErrorOr<NonnullOwnPtr<Memory::Region>> MemoryManager::allocate_dma_buffer_pages(
|
|||
dma_buffer_pages = allocate_contiguous_supervisor_physical_pages(size);
|
||||
if (dma_buffer_pages.is_empty())
|
||||
return ENOMEM;
|
||||
auto region_or_error = allocate_kernel_region(dma_buffer_pages.first().paddr(), size, name, access);
|
||||
// Do not enable Cache for this region as physical memory transfers are performed (Most architectures have this behaviour by default)
|
||||
auto region_or_error = allocate_kernel_region(dma_buffer_pages.first().paddr(), size, name, access, Region::Cacheable::No);
|
||||
return region_or_error;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue