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:
parent
0589ef2886
commit
7710e48d83
Notes:
sideshowbarker
2024-07-19 13:37:02 +09:00
Author: https://github.com/bugaevc Commit: https://github.com/SerenityOS/serenity/commit/7710e48d838 Pull-request: https://github.com/SerenityOS/serenity/pull/229
1 changed files with 2 additions and 2 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue