diff --git a/hermit/arch/x86/include/asm/page.h b/hermit/arch/x86/include/asm/page.h index 7a860c0ff..8cb6adaa7 100644 --- a/hermit/arch/x86/include/asm/page.h +++ b/hermit/arch/x86/include/asm/page.h @@ -102,6 +102,11 @@ static inline size_t sign_extend(ssize_t addr, int bits) /// Align to page #define PAGE_CEIL(addr) ( (addr) & PAGE_MASK) +/// Align to next 2M boundary +#define PAGE_2M_FLOOR(addr) (((addr) + (1L << 21) - 1) & ((~0L) << 21)) +/// Align to nex 2M boundary +#define PAGE_2M_CEIL(addr) ( (addr) & ((~0L) << 21)) + /// Page is present #define PG_PRESENT (1 << 0) /// Page is read- and writable diff --git a/hermit/mm/vma.c b/hermit/mm/vma.c index c7e863dc3..4186fdd39 100644 --- a/hermit/mm/vma.c +++ b/hermit/mm/vma.c @@ -39,9 +39,6 @@ extern const void kernel_start; extern const void kernel_end; -#define PAGE_2M_FLOOR(addr) (((addr) + (1L << 21) - 1) & ((~0L) << 21)) -#define PAGE_2M_CEIL(addr) ( (addr) & ((~0L) << 21)) - /* * Kernel space VMA list and lock *