1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-20 17:25:08 +00:00
serenity/Kernel/VM/ContiguousVMObject.cpp
Brian Gianforcaro 1682f0b760 Everything: Move to SPDX license identifiers in all files.
SPDX License Identifiers are a more compact / standardized
way of representing file license information.

See: https://spdx.dev/resources/use/#identifiers

This was done with the `ambr` search and replace tool.

 ambr --no-parent-ignore --key-from-file --rep-from-file key.txt rep.txt *
2021-04-22 11:22:27 +02:00

42 lines
1.1 KiB
C++

/*
* Copyright (c) 2020, Liav A. <liavalb@hotmail.co.il>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#include <Kernel/VM/ContiguousVMObject.h>
#include <Kernel/VM/MemoryManager.h>
#include <Kernel/VM/PhysicalPage.h>
namespace Kernel {
NonnullRefPtr<ContiguousVMObject> ContiguousVMObject::create_with_size(size_t size, size_t physical_alignment)
{
return adopt(*new ContiguousVMObject(size, physical_alignment));
}
ContiguousVMObject::ContiguousVMObject(size_t size, size_t physical_alignment)
: VMObject(size)
{
auto contiguous_physical_pages = MM.allocate_contiguous_supervisor_physical_pages(size, physical_alignment);
for (size_t i = 0; i < page_count(); i++) {
physical_pages()[i] = contiguous_physical_pages[i];
dbgln_if(CONTIGUOUS_VMOBJECT_DEBUG, "Contiguous page[{}]: {}", i, physical_pages()[i]->paddr());
}
}
ContiguousVMObject::ContiguousVMObject(const ContiguousVMObject& other)
: VMObject(other)
{
}
ContiguousVMObject::~ContiguousVMObject()
{
}
RefPtr<VMObject> ContiguousVMObject::clone()
{
VERIFY_NOT_REACHED();
}
}