2022-09-24 19:27:45 +00:00
|
|
|
#pragma once
|
|
|
|
#include <stdint.h>
|
|
|
|
|
2022-09-24 21:09:39 +00:00
|
|
|
#define PMM_FAILED (void*)-1
|
|
|
|
#define PMM_DID_FAIL(addr) (void*)addr == PMM_FAILED
|
|
|
|
|
2022-09-24 19:27:45 +00:00
|
|
|
namespace PMM
|
|
|
|
{
|
|
|
|
void init();
|
|
|
|
|
|
|
|
void* request_page();
|
|
|
|
void* request_pages(uint64_t count);
|
|
|
|
|
|
|
|
void free_page(void* address);
|
|
|
|
void free_pages(void* address, uint64_t count);
|
|
|
|
|
|
|
|
void lock_page(void* address);
|
|
|
|
void lock_pages(void* address, uint64_t count);
|
|
|
|
|
|
|
|
uint64_t get_free();
|
|
|
|
uint64_t get_used();
|
|
|
|
uint64_t get_reserved();
|
|
|
|
};
|