aboutsummaryrefslogtreecommitdiff
path: root/src/vmm.h
diff options
context:
space:
mode:
authorAqua-sama <aqua@iserlohn-fortress.net>2021-03-21 16:53:07 +0200
committerAqua-sama <aqua@iserlohn-fortress.net>2021-03-21 16:53:07 +0200
commite9232199bdd97233dabd59f07c63607c93c0c59c (patch)
tree66aff19650079c9fc990f75d2ed390dd674cfdaa /src/vmm.h
parentAdd allocator (diff)
downloadkernel.cpp-e9232199bdd97233dabd59f07c63607c93c0c59c.tar.xz
Check multiboot2 header length, and if needed map the next page as well
Diffstat (limited to 'src/vmm.h')
-rw-r--r--src/vmm.h8
1 files changed, 1 insertions, 7 deletions
diff --git a/src/vmm.h b/src/vmm.h
index 252e5bb..1729275 100644
--- a/src/vmm.h
+++ b/src/vmm.h
@@ -28,13 +28,6 @@ public:
vmm(uint32_t* addr = nullptr);
- [[deprecated]] constexpr static size_t table_id(uint32_t offset) {
- offset &= 0xfff00000;
- offset /= (4 * 1024 * 1024);
- return static_cast<size_t>(offset);
- }
- [[deprecated]] constexpr static size_t page_id(uint32_t offset) { return static_cast<size_t>(offset / 4096); }
-
static void reload() {
uint32_t cr0;
asm volatile("mov %%cr0, %0" : "=r"(cr0));
@@ -42,6 +35,7 @@ public:
}
[[nodiscard]] Result<uint32_t, Error> map(uint32_t phys_addr, const address dest);
+ void unmap(const address);
private:
class page_table {