#pragma once
#include "uefi.h"

#define PAGE_PRESENT   (1ULL << 0)
#define PAGE_WRITE     (1ULL << 1)
#define PAGE_USER      (1ULL << 2)
#define PAGE_WRITETHROUGH (1ULL << 3)
#define PAGE_CACHE_DISABLE (1ULL << 4)
#define PAGE_ACCESSED  (1ULL << 5)
#define PAGE_DIRTY     (1ULL << 6)
#define PAGE_HUGE      (1ULL << 7)
#define PAGE_GLOBAL    (1ULL << 8)

#define HIGHER_HALF_BASE  0xFFFF800000000000ULL

void paging_init(void);
void paging_map_page(uint64_t virt, uint64_t phys, uint64_t flags);
void paging_map_page_uc(uint64_t virt, uint64_t phys);
void paging_map_mmio_range(uint64_t phys, uint32_t size);
void paging_enable(void);
