summaryrefslogtreecommitdiff
path: root/Kernel/VM/VMObject.cpp
blob: 24c3b71352a94065ce9e1aa6ef310194da514e62 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include <Kernel/FileSystem/FileSystem.h>
#include <Kernel/FileSystem/Inode.h>
#include <Kernel/VM/MemoryManager.h>
#include <Kernel/VM/VMObject.h>

VMObject::VMObject(const VMObject& other)
    : m_physical_pages(other.m_physical_pages)
{
    MM.register_vmo(*this);
}

VMObject::VMObject(size_t size)
    : m_physical_pages(ceil_div(size, PAGE_SIZE))
{
    MM.register_vmo(*this);
}

VMObject::~VMObject()
{
    MM.unregister_vmo(*this);
}