mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 00:57:45 +00:00
Kernel: Consolidate API for creating AnonymousVMObject with given pages
We don't need to have a dedicated API for creating a VMObject with a single page, the multi-page API option works in all cases. Also make the API take a Span<NonnullRefPtr<PhysicalPage>> instead of a NonnullRefPtrVector<PhysicalPage>.
This commit is contained in:
parent
9e15708aa0
commit
5217875f6a
7 changed files with 10 additions and 23 deletions
|
@ -237,7 +237,8 @@ KResultOr<size_t> SB16::write(FileDescription&, u64, const UserOrKernelBuffer& d
|
|||
auto page = MM.allocate_supervisor_physical_page();
|
||||
if (!page)
|
||||
return ENOMEM;
|
||||
auto vmobject = AnonymousVMObject::try_create_with_physical_page(*page);
|
||||
auto nonnull_page = page.release_nonnull();
|
||||
auto vmobject = AnonymousVMObject::try_create_with_physical_pages({ &nonnull_page, 1 });
|
||||
if (!vmobject)
|
||||
return ENOMEM;
|
||||
m_dma_region = MM.allocate_kernel_region_with_vmobject(*vmobject, PAGE_SIZE, "SB16 DMA buffer", Region::Access::Write);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue