33 lines
688 B
C
33 lines
688 B
C
|
#pragma once
|
||
|
#include <Result.h>
|
||
|
|
||
|
struct PageDirectory;
|
||
|
|
||
|
namespace MMU
|
||
|
{
|
||
|
enum Flags
|
||
|
{
|
||
|
None = 0,
|
||
|
ReadWrite = 1,
|
||
|
User = 2,
|
||
|
NoExecute = 4,
|
||
|
WriteThrough = 8,
|
||
|
CacheDisable = 16,
|
||
|
};
|
||
|
|
||
|
Result<void> map(u64 virt, u64 phys, Flags flags);
|
||
|
Result<u64> unmap(u64 virt);
|
||
|
Result<u64> get_physical(u64 virt);
|
||
|
Result<Flags> get_flags(u64 virt);
|
||
|
Result<void> remap(u64 virt, Flags flags);
|
||
|
|
||
|
void switch_page_directory(PageDirectory* dir);
|
||
|
PageDirectory* get_page_directory();
|
||
|
|
||
|
void flush_all();
|
||
|
|
||
|
Result<PageDirectory*> create_page_directory();
|
||
|
void setup_initial_page_directory();
|
||
|
|
||
|
size_t page_size();
|
||
|
}
|