From 04bd6a059b9eb105024044d74122b0cb76cebf14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matteo=20Gm=C3=BCr?= Date: Sun, 20 Oct 2024 09:34:03 +0000 Subject: Add translate huge page method --- .../include/arch/memory/paging/page_mapper.hpp | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) (limited to 'arch/x86_64/include') 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; /** - * @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; + + /** + * @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; -- cgit v1.2.3