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

Revert "Kernel: Make PhysicalPage not movable and use atomic ref counting"

This reverts commit a89ccd842b.
This commit is contained in:
Andreas Kling 2020-08-22 16:34:11 +02:00
parent 23f335bcd7
commit 0db7e04c2e
5 changed files with 24 additions and 20 deletions

View file

@ -42,14 +42,18 @@ PhysicalPage::PhysicalPage(PhysicalAddress paddr, bool supervisor, bool may_retu
{
}
void PhysicalPage::return_to_freelist() const
void PhysicalPage::return_to_freelist() &&
{
ASSERT((paddr().get() & ~PAGE_MASK) == 0);
InterruptDisabler disabler;
m_ref_count = 1;
if (m_supervisor)
MM.deallocate_supervisor_physical_page(*this);
MM.deallocate_supervisor_physical_page(move(*this));
else
MM.deallocate_user_physical_page(*this);
MM.deallocate_user_physical_page(move(*this));
#ifdef MM_DEBUG
dbg() << "MM: P" << String::format("%x", m_paddr.get()) << " released to freelist";