#pragma once #include #define MAP_READ_WRITE 1 << 0 #define MAP_USER 1 << 1 namespace KernelMemoryManager { void init(); void* get_mapping(void* physicalAddress, int flags = MAP_READ_WRITE); void release_mapping(void* mapping); void* get_unaligned_mapping(void* physicalAddress, int flags = MAP_READ_WRITE); void* get_unaligned_mappings(void* physicalAddress, uint64_t count, int flags = MAP_READ_WRITE); void release_unaligned_mapping(void* mapping); void release_unaligned_mappings(void* mapping, uint64_t count); void* get_page(int flags = MAP_READ_WRITE); void* get_pages(uint64_t count, int flags = MAP_READ_WRITE); void release_page(void* page); void release_pages(void* pages, uint64_t count); }