mirror of
https://github.com/RGBCube/serenity
synced 2025-07-24 21:57:35 +00:00
Add AnonymousVMObject::create_with_physical_page()
This can be used to create a VMObject for a single PhysicalPage.
This commit is contained in:
parent
4ebff10bde
commit
a0b716cfc5
2 changed files with 8 additions and 0 deletions
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -35,6 +35,7 @@ public:
|
|||
|
||||
static NonnullRefPtr<AnonymousVMObject> create_with_size(size_t);
|
||||
static NonnullRefPtr<AnonymousVMObject> create_for_physical_range(PhysicalAddress, size_t);
|
||||
static NonnullRefPtr<AnonymousVMObject> create_with_physical_page(PhysicalPage&);
|
||||
virtual NonnullRefPtr<VMObject> clone() override;
|
||||
|
||||
protected:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue