diff options
| author | Matteo Gmür <matteo.gmuer1@ost.ch> | 2024-10-16 13:33:23 +0000 |
|---|---|---|
| committer | Matteo Gmür <matteo.gmuer1@ost.ch> | 2024-10-16 13:33:23 +0000 |
| commit | 934822e48a7c5a3e65ed74261ce5ab4315595f64 (patch) | |
| tree | fa9e04075b5924d74ee25f0353ce2492099bdee6 /arch/x86_64/include | |
| parent | f56004a77314d4b4d68bfaf496fd7c6013ba7a27 (diff) | |
| download | teachos-934822e48a7c5a3e65ed74261ce5ab4315595f64.tar.xz teachos-934822e48a7c5a3e65ed74261ce5ab4315595f64.zip | |
Fix compilation issues with assigning values to page_map_variable address
Diffstat (limited to 'arch/x86_64/include')
| -rw-r--r-- | arch/x86_64/include/arch/memory/frame_allocator.hpp | 27 | ||||
| -rw-r--r-- | arch/x86_64/include/arch/memory/paging.hpp | 6 |
2 files changed, 10 insertions, 23 deletions
diff --git a/arch/x86_64/include/arch/memory/frame_allocator.hpp b/arch/x86_64/include/arch/memory/frame_allocator.hpp index 3d1f826..89f2570 100644 --- a/arch/x86_64/include/arch/memory/frame_allocator.hpp +++ b/arch/x86_64/include/arch/memory/frame_allocator.hpp @@ -119,16 +119,7 @@ namespace teachos::arch::memory * @param area_count Amount of total entries in the memory_areas array. */ area_frame_allocator(std::size_t kernel_start, std::size_t kernel_end, std::size_t multiboot_start, - std::size_t multiboot_end, memory_area * memory_areas, uint8_t area_count) - : area_begin(memory_areas) - , area_end(memory_areas + area_count) - , kernel_start(physical_frame::containing_address(kernel_start)) - , kernel_end(physical_frame::containing_address(kernel_end)) - , multiboot_start(physical_frame::containing_address(multiboot_start)) - , multiboot_end(physical_frame::containing_address(multiboot_end)) - { - choose_next_area(); - } + std::size_t multiboot_end, memory_area * memory_areas, uint8_t area_count); /** * @brief Allocate memory by finding and returning a free physical_frame. @@ -171,14 +162,14 @@ namespace teachos::arch::memory */ auto choose_next_area() -> void; - physical_frame next_free_frame{0}; ///< The physical_frame after the last allocated one. - std::optional<memory_area> current_area{std::nullopt}; ///< The current memory area. - memory_area_iterator area_begin; ///< Pointer to the first element of all memory areas. - memory_area_iterator area_end; ///< Pointer to one pas the last element of all memory areas. - physical_frame const kernel_start; ///< The start address of the kernel code in memory. - physical_frame const kernel_end; ///< The end address of the kernel code in memory. - physical_frame const multiboot_start; ///< The start address of the multiboot code in memory. - physical_frame const multiboot_end; ///< The end address of the multiboot code in memory. + physical_frame next_free_frame; ///< The physical_frame after the last allocated one. + std::optional<memory_area> current_area; ///< The current memory area. + memory_area_iterator area_begin; ///< Pointer to the first element of all memory areas. + memory_area_iterator area_end; ///< Pointer to one pas the last element of all memory areas. + physical_frame const kernel_start; ///< The start address of the kernel code in memory. + physical_frame const kernel_end; ///< The end address of the kernel code in memory. + physical_frame const multiboot_start; ///< The start address of the multiboot code in memory. + physical_frame const multiboot_end; ///< The end address of the multiboot code in memory. }; } // namespace teachos::arch::memory diff --git a/arch/x86_64/include/arch/memory/paging.hpp b/arch/x86_64/include/arch/memory/paging.hpp index c13c3fe..4092d18 100644 --- a/arch/x86_64/include/arch/memory/paging.hpp +++ b/arch/x86_64/include/arch/memory/paging.hpp @@ -140,11 +140,7 @@ namespace teachos::arch::memory * @param index * @return The address of the accessed entry */ - entry & operator[](std::size_t index) - { - arch::exception_handling::assert(index < PAGE_TABLE_ENTRY_COUNT, "[Page Table] index out of bounds"); - return entries[index]; - } + entry & operator[](std::size_t index); private: entry entries[PAGE_TABLE_ENTRY_COUNT]; |
