1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 11:28:12 +00:00

Kernel: Add convenience values to the Memory::Region::Access enum

Instead of `Memory::Region::Access::Read | Memory::Region::AccessWrite`
you can now say `Memory::Region::Access::ReadWrite`.
This commit is contained in:
Andreas Kling 2021-08-06 22:25:00 +02:00
parent 47bdd7c3a0
commit 2cd8b21974
38 changed files with 68 additions and 65 deletions

View file

@ -99,7 +99,7 @@ struct KmallocGlobalHeap {
// allocations not including the original allocation_request
// that triggered heap expansion. If we don't allocate
memory_size += 1 * MiB;
region = MM.allocate_kernel_region(memory_size, "kmalloc subheap", Memory::Region::Access::Read | Memory::Region::Access::Write, AllocationStrategy::AllocateNow);
region = MM.allocate_kernel_region(memory_size, "kmalloc subheap", Memory::Region::Access::ReadWrite, AllocationStrategy::AllocateNow);
if (region) {
dbgln("kmalloc: Adding even more memory to heap at {}, bytes: {}", region->vaddr(), region->size());
@ -173,7 +173,7 @@ struct KmallocGlobalHeap {
{
if (m_backup_memory)
return;
m_backup_memory = MM.allocate_kernel_region(1 * MiB, "kmalloc subheap", Memory::Region::Access::Read | Memory::Region::Access::Write, AllocationStrategy::AllocateNow);
m_backup_memory = MM.allocate_kernel_region(1 * MiB, "kmalloc subheap", Memory::Region::Access::ReadWrite, AllocationStrategy::AllocateNow);
}
size_t backup_memory_bytes() const