kernel/inc/mm/page_frame.h

31 lines
930 B
C

// This file is part of noxos and licensed under the MIT open source license
#ifndef NOX_PAGE_FRAME_H
#define NOX_PAGE_FRAME_H
#include "utils/stdtypes.h"
#include "utils/bitmap.h"
#include "boot/boot_info.h"
#define PFRAME_SIZE 4096 // The size of a page frame
typedef struct {
uint64_t free_memory;
uint64_t reserved_memory;
uint64_t used_memory;
uint64_t page_bitmap_index;
bitmap_T page_bitmap;
bool blocked;
} page_frame_manager_T;
void pframe_manager_init (boot_info_T* boot_info);
void pframe_reserve (void* address);
void pframe_reserve_multi (void* address, uint32_t n);
void pframe_unreserve (void* address);
void pframe_unreserve_multi (void* address, uint32_t n);
void pframe_free (void* address);
void pframe_free_multi (void* address, uint32_t n);
void* pframe_request ();
#endif //NOX_PAGE_FRAME_H