15#define BITMASK(SHIFT, CNT) (((1ul << (CNT)) - 1) << (SHIFT))
20#define PGSIZE (1 << PGBITS)
21#define PGMASK BITMASK(PGSHIFT, PGBITS)
24static inline unsigned pg_ofs (
const void *va) {
53#define PHYS_BASE ((void *) LOADER_PHYS_BASE)
#define ASSERT(CONDITION)
This is outside the header guard so that debug.h may be included multiple times with different settin...
static uintptr_t vtop(const void *vaddr)
Returns physical address at which kernel virtual address VADDR is mapped.
static uintptr_t pg_no(const void *va)
Virtual page number.
static void * pg_round_down(const void *va)
Round down to nearest page boundary.
#define PGSIZE
Bytes in a page.
static bool is_user_vaddr(const void *vaddr)
Returns true if VADDR is a user virtual address.
#define PHYS_BASE
Base address of the 1:1 physical-to-virtual mapping.
#define PGBITS
Number of offset bits.
static unsigned pg_ofs(const void *va)
Offset within a page.
static void * ptov(uintptr_t paddr)
Returns kernel virtual address at which physical address PADDR is mapped.
static bool is_kernel_vaddr(const void *vaddr)
Returns true if VADDR is a kernel virtual address.
static void * pg_round_up(const void *va)
Round up to nearest page boundary.
#define PGMASK
Page offset bits (0:12).