mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 20:57:35 +00:00
Kernel: Move VM-related files into Kernel/VM/.
Also break MemoryManager.{cpp,h} into one file per class.
This commit is contained in:
parent
39fd81174e
commit
b9738fa8ac
21 changed files with 630 additions and 575 deletions
26
Kernel/VM/PageDirectory.h
Normal file
26
Kernel/VM/PageDirectory.h
Normal file
|
@ -0,0 +1,26 @@
|
|||
#pragma once
|
||||
|
||||
#include <Kernel/VM/PhysicalPage.h>
|
||||
#include <AK/HashMap.h>
|
||||
#include <AK/Retainable.h>
|
||||
#include <AK/RetainPtr.h>
|
||||
|
||||
class PageDirectory : public Retainable<PageDirectory> {
|
||||
friend class MemoryManager;
|
||||
public:
|
||||
static Retained<PageDirectory> create() { return adopt(*new PageDirectory); }
|
||||
static Retained<PageDirectory> create_at_fixed_address(PhysicalAddress paddr) { return adopt(*new PageDirectory(paddr)); }
|
||||
~PageDirectory();
|
||||
|
||||
dword cr3() const { return m_directory_page->paddr().get(); }
|
||||
dword* entries() { return reinterpret_cast<dword*>(cr3()); }
|
||||
|
||||
void flush(LinearAddress);
|
||||
|
||||
private:
|
||||
PageDirectory();
|
||||
explicit PageDirectory(PhysicalAddress);
|
||||
|
||||
RetainPtr<PhysicalPage> m_directory_page;
|
||||
HashMap<unsigned, RetainPtr<PhysicalPage>> m_physical_pages;
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue