aboutsummaryrefslogtreecommitdiff
path: root/arch/x86_64/include
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86_64/include')
-rw-r--r--arch/x86_64/include/arch/memory/allocator/area_frame_allocator.hpp4
-rw-r--r--arch/x86_64/include/arch/memory/main.hpp14
-rw-r--r--arch/x86_64/include/arch/memory/paging/kernel_mapper.hpp3
3 files changed, 17 insertions, 4 deletions
diff --git a/arch/x86_64/include/arch/memory/allocator/area_frame_allocator.hpp b/arch/x86_64/include/arch/memory/allocator/area_frame_allocator.hpp
index 2244613..6cb5f56 100644
--- a/arch/x86_64/include/arch/memory/allocator/area_frame_allocator.hpp
+++ b/arch/x86_64/include/arch/memory/allocator/area_frame_allocator.hpp
@@ -15,9 +15,9 @@ namespace teachos::arch::memory::allocator
struct area_frame_allocator
{
/**
- * @brief Constructor
+ * @brief Constructor.
*
- * @param mem_info Structure containg all relevant information to map and allocate memory
+ * @param mem_info Structure containg all relevant information to map and allocate memory.
*/
area_frame_allocator(multiboot::memory_information const & mem_info);
diff --git a/arch/x86_64/include/arch/memory/main.hpp b/arch/x86_64/include/arch/memory/main.hpp
index 164abbc..d51815f 100644
--- a/arch/x86_64/include/arch/memory/main.hpp
+++ b/arch/x86_64/include/arch/memory/main.hpp
@@ -1,8 +1,22 @@
#ifndef TEACHOS_ARCH_X86_64_MEMORY_MAIN_HPP
#define TEACHOS_ARCH_X86_64_MEMORY_MAIN_HPP
+#include "arch/memory/paging/page_entry.hpp"
+
+#include <cstdint>
+
namespace teachos::arch::memory
{
+
+ /**
+ * @brief Maps a heap section to a page.
+ *
+ * @param heap_start Start-address of the heap.
+ * @param heap_size Size of the heap.
+ * @param additional_flags Additional flags to apply to the page entry.
+ */
+ auto remap_heap(std::size_t heap_start, std::size_t heap_size, paging::entry::bitset additional_flags) -> void;
+
/**
* @brief Initializes memory management.
*
diff --git a/arch/x86_64/include/arch/memory/paging/kernel_mapper.hpp b/arch/x86_64/include/arch/memory/paging/kernel_mapper.hpp
index 7321548..756eeb1 100644
--- a/arch/x86_64/include/arch/memory/paging/kernel_mapper.hpp
+++ b/arch/x86_64/include/arch/memory/paging/kernel_mapper.hpp
@@ -38,7 +38,7 @@ namespace teachos::arch::memory::paging
* inactive page table, that is not used by the CPU to ensure we are not changign memory that we are using. Because
* remapping active kernel memory in the kernel wouldn't work.
*/
- auto remap_kernel() -> active_page_table &
+ auto remap_kernel() -> void
{
// Set Page Global Enable bit
auto cr4 = kernel::cpu::read_control_register(kernel::cpu::control_register::CR4);
@@ -57,7 +57,6 @@ namespace teachos::arch::memory::paging
auto const old_level_4_page =
virtual_page::containing_address(old_table.page_table_level_4_frame.start_address());
active_table.unmap_page(allocator, old_level_4_page);
- return active_table;
}
private: