mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 15:28:11 +00:00
Kernel: Add AnonymousVMObject constructor for a Vector of physical pages
This will be used later on by the AHCI code to create a Region that spans over scattered DMA pages.
This commit is contained in:
parent
e65fd83e23
commit
ecb169b61e
4 changed files with 22 additions and 0 deletions
|
@ -81,6 +81,11 @@ RefPtr<AnonymousVMObject> AnonymousVMObject::create_with_size(size_t size, Alloc
|
|||
return adopt(*new AnonymousVMObject(size, commit));
|
||||
}
|
||||
|
||||
NonnullRefPtr<AnonymousVMObject> AnonymousVMObject::create_with_physical_pages(NonnullRefPtrVector<PhysicalPage> physical_pages)
|
||||
{
|
||||
return adopt(*new AnonymousVMObject(physical_pages));
|
||||
}
|
||||
|
||||
NonnullRefPtr<AnonymousVMObject> AnonymousVMObject::create_with_physical_page(PhysicalPage& page)
|
||||
{
|
||||
return adopt(*new AnonymousVMObject(page));
|
||||
|
@ -127,6 +132,15 @@ AnonymousVMObject::AnonymousVMObject(PhysicalPage& page)
|
|||
physical_pages()[0] = page;
|
||||
}
|
||||
|
||||
AnonymousVMObject::AnonymousVMObject(NonnullRefPtrVector<PhysicalPage> physical_pages)
|
||||
: VMObject()
|
||||
, m_volatile_ranges_cache({ 0, page_count() })
|
||||
{
|
||||
for (auto& page : physical_pages) {
|
||||
m_physical_pages.append(page);
|
||||
}
|
||||
}
|
||||
|
||||
AnonymousVMObject::AnonymousVMObject(const AnonymousVMObject& other)
|
||||
: VMObject(other)
|
||||
, m_volatile_ranges_cache({ 0, page_count() }) // do *not* clone this
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue