diff options
author | Aqua-sama <aqua@iserlohn-fortress.net> | 2021-03-21 16:53:07 +0200 |
---|---|---|
committer | Aqua-sama <aqua@iserlohn-fortress.net> | 2021-03-21 16:53:07 +0200 |
commit | e9232199bdd97233dabd59f07c63607c93c0c59c (patch) | |
tree | 66aff19650079c9fc990f75d2ed390dd674cfdaa /src/vmm.h | |
parent | Add allocator (diff) | |
download | kernel.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.h | 8 |
1 files changed, 1 insertions, 7 deletions
@@ -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 { |