Kernel: namespace and function renames
MMU moved to namespace kernel
Kernel::Memory::Heap moved to just Kernel
MMU::map_{page,range} renamed to identity_map_{page,range}
Add MMU::get_page_flags
This commit is contained in:
@@ -7,9 +7,10 @@
|
||||
|
||||
#define PAGE_SIZE 4096
|
||||
|
||||
namespace Kernel::Memory
|
||||
namespace Kernel
|
||||
{
|
||||
|
||||
using vaddr_t = uintptr_t;
|
||||
using paddr_t = uintptr_t;
|
||||
|
||||
class PhysicalRange
|
||||
|
||||
@@ -1,41 +1,44 @@
|
||||
#pragma once
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
#include <kernel/Memory/Heap.h>
|
||||
|
||||
class MMU
|
||||
namespace Kernel
|
||||
{
|
||||
public:
|
||||
enum Flags : uint8_t
|
||||
|
||||
class MMU
|
||||
{
|
||||
Present = 1,
|
||||
ReadWrite = 2,
|
||||
UserSupervisor = 4,
|
||||
public:
|
||||
enum Flags : uint8_t
|
||||
{
|
||||
Present = 1,
|
||||
ReadWrite = 2,
|
||||
UserSupervisor = 4,
|
||||
};
|
||||
|
||||
public:
|
||||
static void initialize();
|
||||
static MMU& get();
|
||||
|
||||
MMU();
|
||||
~MMU();
|
||||
|
||||
void identity_map_page(paddr_t, uint8_t);
|
||||
void identity_map_range(paddr_t, ptrdiff_t, uint8_t);
|
||||
|
||||
void unmap_page(vaddr_t);
|
||||
void unmap_range(vaddr_t, ptrdiff_t);
|
||||
|
||||
void map_page_at(paddr_t, vaddr_t, uint8_t);
|
||||
|
||||
uint8_t get_page_flags(vaddr_t) const;
|
||||
|
||||
void load();
|
||||
|
||||
private:
|
||||
void initialize_kernel();
|
||||
|
||||
private:
|
||||
uint64_t* m_highest_paging_struct;
|
||||
};
|
||||
|
||||
using vaddr_t = uintptr_t;
|
||||
using paddr_t = uintptr_t;
|
||||
|
||||
public:
|
||||
static void initialize();
|
||||
static MMU& get();
|
||||
|
||||
MMU();
|
||||
~MMU();
|
||||
|
||||
void map_page(uintptr_t, uint8_t);
|
||||
void map_range(uintptr_t, ptrdiff_t, uint8_t);
|
||||
|
||||
void unmap_page(uintptr_t);
|
||||
void unmap_range(uintptr_t, ptrdiff_t);
|
||||
|
||||
void map_page_at(paddr_t, vaddr_t, uint8_t);
|
||||
|
||||
void load();
|
||||
|
||||
private:
|
||||
void initialize_kernel();
|
||||
|
||||
private:
|
||||
uint64_t* m_highest_paging_struct;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -82,7 +82,7 @@ namespace Kernel
|
||||
BAN::ErrorOr<int> get_free_fd();
|
||||
|
||||
BAN::Vector<OpenFileDescription> m_open_files;
|
||||
BAN::Vector<Memory::paddr_t> m_allocated_pages;
|
||||
BAN::Vector<paddr_t> m_allocated_pages;
|
||||
|
||||
mutable RecursiveSpinLock m_lock;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user