Add AnonymousVMObject::create_with_physical_page()

This can be used to create a VMObject for a single PhysicalPage.
This commit is contained in:
Andreas Kling 2020-01-20 13:07:17 +01:00
commit a0b716cfc5
Notes: sideshowbarker 2024-07-19 09:56:39 +09:00
2 changed files with 8 additions and 0 deletions

View file

@ -37,6 +37,13 @@ NonnullRefPtr<AnonymousVMObject> AnonymousVMObject::create_for_physical_range(Ph
return adopt(*new AnonymousVMObject(paddr, size));
}
NonnullRefPtr<AnonymousVMObject> AnonymousVMObject::create_with_physical_page(PhysicalPage& page)
{
auto vmobject = create_with_size(PAGE_SIZE);
vmobject->m_physical_pages[0] = page;
return vmobject;
}
AnonymousVMObject::AnonymousVMObject(size_t size)
: VMObject(size)
{