mem: change TO_PHYS and TO_VIRT

Signed-off-by: Michael Shaw <m@michaelsshaw.com>
This commit is contained in:
Michael Shaw 2026-07-07 00:24:50 +02:00
commit 569f24aea1
3 changed files with 6 additions and 7 deletions

View file

@ -7,8 +7,8 @@
#define ALIGN(_a) __attribute__((aligned(_a)))
#define PHYSICAL_PAGE_MASK (~(hhdm_start))
#define TO_VIRT(addr) ((addr) + hhdm_start)
#define TO_PHYS(addr) ((addr) - hhdm_start)
#define TO_VIRT(addr) ((void *)((paddr_t)(addr) + hhdm_start))
#define TO_PHYS(addr) ((paddr_t)(addr) - hhdm_start)
#define ALIGN_UP(x, a) (((x) + (a) - 1) & ~((__typeof__(x))(a) - 1))
@ -36,5 +36,4 @@ void *align(void *p, size_t align);
extern vaddr_t hhdm_start;
extern vaddr_t hhdm_end;
#endif /* _MEM_H_ */