Kernel: Remove API for requesting physical allocation alignment

Nobody was using this API to request anythign about `PAGE_SIZE`
alignment, so let's get rid of it for now. We can reimplement it if
we end up needing it.

Also note that it wasn't actually used anywhere.
This commit is contained in:
Andreas Kling 2021-07-13 16:10:48 +02:00
parent ba87571366
commit be90e51355
Notes: sideshowbarker 2024-07-18 09:07:30 +09:00
6 changed files with 11 additions and 14 deletions

View file

@ -629,14 +629,14 @@ PageFaultResponse MemoryManager::handle_page_fault(const PageFault& fault)
return region->handle_fault(fault, lock);
}
OwnPtr<Region> MemoryManager::allocate_contiguous_kernel_region(size_t size, StringView name, Region::Access access, size_t physical_alignment, Region::Cacheable cacheable)
OwnPtr<Region> MemoryManager::allocate_contiguous_kernel_region(size_t size, StringView name, Region::Access access, Region::Cacheable cacheable)
{
VERIFY(!(size % PAGE_SIZE));
ScopedSpinLock lock(s_mm_lock);
auto range = kernel_page_directory().range_allocator().allocate_anywhere(size);
if (!range.has_value())
return {};
auto vmobject = ContiguousVMObject::try_create_with_size(size, physical_alignment);
auto vmobject = ContiguousVMObject::try_create_with_size(size);
if (!vmobject) {
kernel_page_directory().range_allocator().deallocate(range.value());
return {};
@ -834,7 +834,7 @@ RefPtr<PhysicalPage> MemoryManager::allocate_user_physical_page(ShouldZeroFill s
return page;
}
NonnullRefPtrVector<PhysicalPage> MemoryManager::allocate_contiguous_supervisor_physical_pages(size_t size, size_t physical_alignment)
NonnullRefPtrVector<PhysicalPage> MemoryManager::allocate_contiguous_supervisor_physical_pages(size_t size)
{
VERIFY(!(size % PAGE_SIZE));
ScopedSpinLock lock(s_mm_lock);
@ -842,7 +842,7 @@ NonnullRefPtrVector<PhysicalPage> MemoryManager::allocate_contiguous_supervisor_
NonnullRefPtrVector<PhysicalPage> physical_pages;
for (auto& region : m_super_physical_regions) {
physical_pages = region.take_contiguous_free_pages(count, physical_alignment);
physical_pages = region.take_contiguous_free_pages(count);
if (!physical_pages.is_empty())
continue;
}