forked from Bananymous/banan-os
Kernel: Remove unnecessary usages of PageTableScope
This should be used as few times as possible since it calls 'cli'
This commit is contained in:
parent
e640344d7a
commit
278b873e89
|
@ -1,5 +1,4 @@
|
|||
#include <kernel/Memory/FixedWidthAllocator.h>
|
||||
#include <kernel/Memory/PageTableScope.h>
|
||||
|
||||
namespace Kernel
|
||||
{
|
||||
|
@ -229,7 +228,8 @@ namespace Kernel
|
|||
if (allocator == nullptr)
|
||||
return BAN::Error::from_errno(ENOMEM);
|
||||
|
||||
PageTableScope _(m_page_table);
|
||||
m_page_table.lock();
|
||||
|
||||
ASSERT(m_page_table.is_page_free(0));
|
||||
|
||||
for (node* node = m_used_list; node; node = node->next)
|
||||
|
@ -257,6 +257,8 @@ namespace Kernel
|
|||
m_page_table.unmap_page(0);
|
||||
m_page_table.invalidate(0);
|
||||
|
||||
m_page_table.unlock();
|
||||
|
||||
return allocator;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
#include <kernel/Memory/GeneralAllocator.h>
|
||||
#include <kernel/Memory/PageTableScope.h>
|
||||
#include <kernel/Process.h>
|
||||
|
||||
namespace Kernel
|
||||
{
|
||||
|
@ -68,7 +66,8 @@ namespace Kernel
|
|||
if (allocator == nullptr)
|
||||
return BAN::Error::from_errno(ENOMEM);
|
||||
|
||||
PageTableScope _(m_page_table);
|
||||
m_page_table.lock();
|
||||
|
||||
ASSERT(m_page_table.is_page_free(0));
|
||||
|
||||
for (auto& allocation : m_allocations)
|
||||
|
@ -100,6 +99,8 @@ namespace Kernel
|
|||
m_page_table.unmap_page(0);
|
||||
m_page_table.invalidate(0);
|
||||
|
||||
m_page_table.unlock();
|
||||
|
||||
return allocator;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
#include <kernel/Memory/Heap.h>
|
||||
#include <kernel/Memory/PageTableScope.h>
|
||||
#include <kernel/Memory/VirtualRange.h>
|
||||
|
||||
namespace Kernel
|
||||
|
@ -78,7 +77,8 @@ namespace Kernel
|
|||
{
|
||||
VirtualRange* result = create(page_table, vaddr(), size(), flags());
|
||||
|
||||
PageTableScope _(m_page_table);
|
||||
m_page_table.lock();
|
||||
|
||||
ASSERT(m_page_table.is_page_free(0));
|
||||
for (size_t i = 0; i < result->m_physical_pages.size(); i++)
|
||||
{
|
||||
|
@ -89,6 +89,8 @@ namespace Kernel
|
|||
m_page_table.unmap_page(0);
|
||||
m_page_table.invalidate(0);
|
||||
|
||||
m_page_table.unlock();
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue