14#define ALIGNMENT_MASK(x, a) ((typeof(x))(a) - 1)
22#define ALIGN_UP(x, a) (((x) + ALIGNMENT_MASK(x, a)) & ~ALIGNMENT_MASK(x, a))
30#define ALIGN_DOWN(x, a) ((x) & ~ALIGNMENT_MASK(x, a))
void * hhdm_physical_to_virtual(size_t phys)
Converts a physical address to a virtual address according to the Higher Half Direct Mapping (HHDM) s...
Definition kalloc.c:25
void kalloc_init(void)
Initializes the kernel memory allocator.
Definition kalloc.c:32
size_t page_align_down(size_t addr)
Rounds down the given address to the nearest page boundary.
Definition kalloc.c:16
size_t hhdm_virtual_to_physical(void *virt)
Converts a virtual address to a physical address according to the Higher Half Direct Mapping (HHDM) s...
Definition kalloc.c:28
size_t page_align_up(size_t addr)
Rounds up the given address to the nearest page boundary.
Definition kalloc.c:13