VM: Fix freeing physical pages.

Pages created with PhysicalPage::create_eternal() should *not* be
returnable to the freelist; and pages created with the regular
PhysicalPage::create() should be; not the other way around.
This commit is contained in:
Sergey Bugaev 2019-06-14 14:50:40 +03:00 committed by Andreas Kling
parent 0589ef2886
commit 7710e48d83
Notes: sideshowbarker 2024-07-19 13:37:02 +09:00

View file

@ -5,14 +5,14 @@
Retained<PhysicalPage> PhysicalPage::create_eternal(PhysicalAddress paddr, bool supervisor)
{
void* slot = kmalloc_eternal(sizeof(PhysicalPage));
new (slot) PhysicalPage(paddr, supervisor);
new (slot) PhysicalPage(paddr, supervisor, false);
return adopt(*(PhysicalPage*)slot);
}
Retained<PhysicalPage> PhysicalPage::create(PhysicalAddress paddr, bool supervisor)
{
void* slot = kmalloc(sizeof(PhysicalPage));
new (slot) PhysicalPage(paddr, supervisor, false);
new (slot) PhysicalPage(paddr, supervisor);
return adopt(*(PhysicalPage*)slot);
}