Kernel: Remove ContiguousVMObject, let AnonymousVMObject do the job

We don't need an entirely separate VMObject subclass to influence the
location of the physical pages.

Instead, we simply allocate enough physically contiguous memory first,
and then pass it to the AnonymousVMObject constructor that takes a span
of physical pages.
This commit is contained in:
Andreas Kling 2021-07-25 18:37:11 +02:00
parent 9a701eafc4
commit 6a537ceef1
Notes: sideshowbarker 2024-07-18 08:21:13 +09:00
10 changed files with 18 additions and 89 deletions

View file

@ -11,14 +11,14 @@ namespace Kernel::USB {
RefPtr<Transfer> Transfer::try_create(Pipe& pipe, u16 len)
{
auto vmobject = ContiguousVMObject::try_create_with_size(PAGE_SIZE);
auto vmobject = AnonymousVMObject::try_create_physically_contiguous_with_size(PAGE_SIZE);
if (!vmobject)
return nullptr;
return AK::try_create<Transfer>(pipe, len, *vmobject);
}
Transfer::Transfer(Pipe& pipe, u16 len, ContiguousVMObject& vmobject)
Transfer::Transfer(Pipe& pipe, u16 len, AnonymousVMObject& vmobject)
: m_pipe(pipe)
, m_transfer_data_size(len)
{