VM: Support non-freeable, non-eternal PhysicalPages.

This commit is contained in:
Sergey Bugaev 2019-06-14 16:40:25 +03:00 committed by Andreas Kling
parent 6bb7c80365
commit a8e86841ce
Notes: sideshowbarker 2024-07-19 13:36:44 +09:00
2 changed files with 3 additions and 3 deletions

View file

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

View file

@ -29,7 +29,7 @@ public:
} }
static Retained<PhysicalPage> create_eternal(PhysicalAddress, bool supervisor); static Retained<PhysicalPage> create_eternal(PhysicalAddress, bool supervisor);
static Retained<PhysicalPage> create(PhysicalAddress, bool supervisor); static Retained<PhysicalPage> create(PhysicalAddress, bool supervisor, bool may_return_to_freelist = true);
word retain_count() const { return m_retain_count; } word retain_count() const { return m_retain_count; }