35 lines
746 B
C++
35 lines
746 B
C++
#pragma once
|
|
#include <luna/Result.h>
|
|
|
|
#ifdef ARCH_X86_64
|
|
#include "arch/x86_64/MMU.h"
|
|
#else
|
|
#error "Unknown architecture."
|
|
#endif
|
|
|
|
namespace MMU
|
|
{
|
|
enum Flags
|
|
{
|
|
None = 0,
|
|
ReadWrite = 1,
|
|
User = 2,
|
|
NoExecute = 4,
|
|
WriteThrough = 8,
|
|
CacheDisable = 16,
|
|
};
|
|
|
|
Result<void> map(u64 virt, u64 phys, int flags);
|
|
Result<u64> unmap(u64 virt);
|
|
Result<u64> get_physical(u64 virt);
|
|
Result<int> get_flags(u64 virt);
|
|
Result<void> remap(u64 virt, int flags);
|
|
|
|
void switch_page_directory(PageDirectory* dir);
|
|
PageDirectory* get_page_directory();
|
|
|
|
void flush_all();
|
|
|
|
Result<PageDirectory*> create_page_directory_for_userspace();
|
|
void setup_initial_page_directory();
|
|
} |