aboutsummaryrefslogtreecommitdiff
path: root/arch/x86_64/include
diff options
context:
space:
mode:
authorFabian Imhof <fabian.imhof@ost.ch>2024-11-24 13:18:31 +0000
committerFabian Imhof <fabian.imhof@ost.ch>2024-11-24 13:18:31 +0000
commit24805678884bcfcc3f14e88757955ab574d647cb (patch)
tree171da85663730f607d99facbbd6bd2fcd0b8cc1b /arch/x86_64/include
parent55f32173e97fdcf4a45006b66cc4b20329a5c7af (diff)
downloadteachos-24805678884bcfcc3f14e88757955ab574d647cb.tar.xz
teachos-24805678884bcfcc3f14e88757955ab574d647cb.zip
add doxygen comments to remapping
Diffstat (limited to 'arch/x86_64/include')
-rw-r--r--arch/x86_64/include/arch/memory/heap/allocator.hpp16
-rw-r--r--arch/x86_64/include/arch/memory/main.hpp4
2 files changed, 18 insertions, 2 deletions
diff --git a/arch/x86_64/include/arch/memory/heap/allocator.hpp b/arch/x86_64/include/arch/memory/heap/allocator.hpp
index c486a4c..6f7535e 100644
--- a/arch/x86_64/include/arch/memory/heap/allocator.hpp
+++ b/arch/x86_64/include/arch/memory/heap/allocator.hpp
@@ -8,6 +8,9 @@ namespace teachos::arch::memory::heap
std::size_t constexpr HEAP_START = 0x4000'0000;
std::size_t constexpr HEAP_SIZE = 100 * 1024;
+ /**
+ * @brief Simple heap allocator
+ */
struct bump_allocator
{
bump_allocator(std::size_t heap_start, std::size_t heap_end)
@@ -17,9 +20,20 @@ namespace teachos::arch::memory::heap
{
}
+ /**
+ * @brief Allocates the specified amount of memory in the heap
+ *
+ * @param size Amount of memory to allocate
+ * @return Address of the allocated memory
+ */
auto allocate(std::size_t size) -> void *;
- auto deallocate(uint8_t * pointer, std::size_t size) -> void;
+ /**
+ * @brief Deallocates heap memory at the specified location
+ *
+ * @param pointer Pointer to the location which should be deallocated
+ */
+ auto deallocate(uint8_t * pointer) -> void;
private:
std::size_t heap_start;
diff --git a/arch/x86_64/include/arch/memory/main.hpp b/arch/x86_64/include/arch/memory/main.hpp
index e166285..bbf160b 100644
--- a/arch/x86_64/include/arch/memory/main.hpp
+++ b/arch/x86_64/include/arch/memory/main.hpp
@@ -4,8 +4,10 @@
namespace teachos::arch::memory
{
/**
- * @brief
+ * @brief Initializes memory management
*
+ * @note Enables the necessary register flags and remaps the kernel,
+ * elf_sections, vga_text and the heap.
*/
auto initialize_memory_management() -> void;
} // namespace teachos::arch::memory