1
0
Fork 0
mirror of https://github.com/hermitcore/libhermit.git synced 2025-03-09 00:00:03 +01:00

simplify code by using the macros PAGE_2M_FLOOR & PAGE_2M_CEIL

This commit is contained in:
Stefan Lankes 2016-08-07 11:07:29 +02:00
parent 3bfe462da0
commit 0e0fd5640e
2 changed files with 5 additions and 3 deletions

View file

@ -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

View file

@ -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
*