diff --git a/repos/base-hw/src/include/hw/spec/x86_64/page_table.h b/repos/base-hw/src/include/hw/spec/x86_64/page_table.h index 4da316858..0cfcf510d 100644 --- a/repos/base-hw/src/include/hw/spec/x86_64/page_table.h +++ b/repos/base-hw/src/include/hw/spec/x86_64/page_table.h @@ -57,13 +57,6 @@ namespace Hw template class Page_directory; - using Level_3_translation_table = - Page_directory; - using Level_2_translation_table = - Page_directory; - /** * IA-32e common descriptor. * @@ -489,7 +482,24 @@ class Hw::Page_directory */ void remove_translation(addr_t vo, size_t size, Allocator & alloc) { _range_op(vo, 0, size, Remove_func(alloc)); } -} __attribute__((aligned(1 << ALIGNM_LOG2))); +}; + + +namespace Hw { + + struct Level_3_translation_table : + Page_directory< + Level_4_translation_table, + SIZE_LOG2_2MB, SIZE_LOG2_1GB> + { } __attribute__((aligned(1 << ALIGNM_LOG2))); + + struct Level_2_translation_table : + Page_directory< + Level_3_translation_table, + SIZE_LOG2_1GB, SIZE_LOG2_512GB> + { } __attribute__((aligned(1 << ALIGNM_LOG2))); + +} class Hw::Pml4_table diff --git a/repos/base-hw/src/include/hw/util.h b/repos/base-hw/src/include/hw/util.h index 336e5fd2d..8c7e1f66d 100644 --- a/repos/base-hw/src/include/hw/util.h +++ b/repos/base-hw/src/include/hw/util.h @@ -56,7 +56,7 @@ namespace Hw * \param p pointer * \param alignm_log2 log2 of the required alignment */ - constexpr bool aligned(void * const p, addr_t alignm_log2) { + inline bool aligned(void * const p, addr_t alignm_log2) { return (addr_t)p == trunc((addr_t)p, alignm_log2); } /**