diff options
| author | Matteo Gmür <matteo.gmuer1@ost.ch> | 2024-10-20 09:34:03 +0000 |
|---|---|---|
| committer | Matteo Gmür <matteo.gmuer1@ost.ch> | 2024-10-20 09:34:03 +0000 |
| commit | 04bd6a059b9eb105024044d74122b0cb76cebf14 (patch) | |
| tree | 69f9c12d0da0cbb1d3f4fcabeb0872d30cff1cf4 /arch/x86_64/include | |
| parent | 1d157101eb550f99dac9ec943053f85bbf6c7644 (diff) | |
| download | teachos-04bd6a059b9eb105024044d74122b0cb76cebf14.tar.xz teachos-04bd6a059b9eb105024044d74122b0cb76cebf14.zip | |
Add translate huge page method
Diffstat (limited to 'arch/x86_64/include')
| -rw-r--r-- | arch/x86_64/include/arch/memory/paging/page_mapper.hpp | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/arch/x86_64/include/arch/memory/paging/page_mapper.hpp b/arch/x86_64/include/arch/memory/paging/page_mapper.hpp index b151a7f..ad9db52 100644 --- a/arch/x86_64/include/arch/memory/paging/page_mapper.hpp +++ b/arch/x86_64/include/arch/memory/paging/page_mapper.hpp @@ -8,18 +8,27 @@ namespace teachos::arch::memory::paging { /** - * @brief Translate page into physical_frame + * @brief Translates page into physical frame, will first attempt to parse normally using default page size and if it + * failed attempt to parse using huge pages. * - * @param page Page to translate into physical_frame - * @return Physical frame corresponding to the provided page_table + * @param page Page to translate into physical frame. + * @return Physical frame corresponding to the provided virtual page. */ auto translate_page(virtual_page page) -> std::optional<allocator::physical_frame>; /** - * @brief Translate virtual into phyical address + * @brief Translates huge page into actual physical frame. * - * @param virtual_address Address to translate into physical - * @return Physical address + * @param page Page to translate into physical frame. + * @return Physical frame corresponding to the provided virtual page. + */ + auto translate_huge_page(virtual_page page) -> std::optional<allocator::physical_frame>; + + /** + * @brief Translate virtual into phyical address. + * + * @param virtual_address Address to translate into physical. + * @return Physical address. */ auto translate_address(std::size_t virtual_address) -> std::optional<std::size_t>; |
