1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 15:27:35 +00:00

Kernel: Rename a very long enum to ShouldDeallocateVirtualRange

ShouldDeallocateVirtualMemoryVirtualRange was a bit on the long side.
This commit is contained in:
Andreas Kling 2021-08-06 21:45:05 +02:00
parent cdab5b2091
commit 47bdd7c3a0
5 changed files with 11 additions and 11 deletions

View file

@ -69,7 +69,7 @@ KResult AddressSpace::unmap_mmap_range(VirtualAddress addr, size_t size)
auto region = take_region(*old_region);
// We manually unmap the old region here, specifying that we *don't* want the VM deallocated.
region->unmap(Region::ShouldDeallocateVirtualMemoryVirtualRange::No);
region->unmap(Region::ShouldDeallocateVirtualRange::No);
auto new_regions_or_error = try_split_region_around_range(*region, range_to_unmap);
if (new_regions_or_error.is_error())
@ -115,7 +115,7 @@ KResult AddressSpace::unmap_mmap_range(VirtualAddress addr, size_t size)
auto region = take_region(*old_region);
// We manually unmap the old region here, specifying that we *don't* want the VM deallocated.
region->unmap(Region::ShouldDeallocateVirtualMemoryVirtualRange::No);
region->unmap(Region::ShouldDeallocateVirtualRange::No);
// Otherwise, split the regions and collect them for future mapping.
auto split_regions_or_error = try_split_region_around_range(*region, range_to_unmap);

View file

@ -45,7 +45,7 @@ Region::~Region()
// find the address<->region mappings in an invalid state there.
ScopedSpinLock lock(s_mm_lock);
if (m_page_directory) {
unmap(ShouldDeallocateVirtualMemoryVirtualRange::Yes);
unmap(ShouldDeallocateVirtualRange::Yes);
VERIFY(!m_page_directory);
}
@ -234,7 +234,7 @@ bool Region::remap_vmobject_page(size_t page_index, bool with_flush)
return success;
}
void Region::unmap(ShouldDeallocateVirtualMemoryVirtualRange deallocate_range)
void Region::unmap(ShouldDeallocateVirtualRange deallocate_range)
{
ScopedSpinLock lock(s_mm_lock);
if (!m_page_directory)
@ -246,7 +246,7 @@ void Region::unmap(ShouldDeallocateVirtualMemoryVirtualRange deallocate_range)
MM.release_pte(*m_page_directory, vaddr, i == count - 1);
}
MM.flush_tlb(m_page_directory, vaddr(), page_count());
if (deallocate_range == ShouldDeallocateVirtualMemoryVirtualRange::Yes) {
if (deallocate_range == ShouldDeallocateVirtualRange::Yes) {
m_page_directory->range_allocator().deallocate(range());
}
m_page_directory = nullptr;

View file

@ -168,11 +168,11 @@ public:
void set_page_directory(PageDirectory&);
bool map(PageDirectory&, ShouldFlushTLB = ShouldFlushTLB::Yes);
enum class ShouldDeallocateVirtualMemoryVirtualRange {
enum class ShouldDeallocateVirtualRange {
No,
Yes,
};
void unmap(ShouldDeallocateVirtualMemoryVirtualRange = ShouldDeallocateVirtualMemoryVirtualRange::Yes);
void unmap(ShouldDeallocateVirtualRange = ShouldDeallocateVirtualRange::Yes);
void remap();