diff --git a/hermit/arch/x86/include/asm/page.h b/hermit/arch/x86/include/asm/page.h index 176eda5de..134b04603 100644 --- a/hermit/arch/x86/include/asm/page.h +++ b/hermit/arch/x86/include/asm/page.h @@ -46,9 +46,9 @@ #define PAGE_SIZE ( 1L << PAGE_BITS) /// Mask the page address without page map flags and XD flag #if 0 -#define PAGE_MASK (-1L << PAGE_BITS) +#define PAGE_MASK ((~0L) << PAGE_BITS) #else -#define PAGE_MASK ((-1L << PAGE_BITS) & ~PG_XD) +#define PAGE_MASK (((~0L) << PAGE_BITS) & ~PG_XD) #endif #if 0 diff --git a/hermit/mm/vma.c b/hermit/mm/vma.c index 10d5a4bd6..43014fc9d 100644 --- a/hermit/mm/vma.c +++ b/hermit/mm/vma.c @@ -39,8 +39,8 @@ extern const void kernel_start; extern const void kernel_end; -#define PAGE_2M_FLOOR(addr) (((addr) + (1L << 21) - 1) & (-1L << 21)) -#define PAGE_2M_CEIL(addr) ( (addr) & (-1L << 21)) +#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