kernel/inc/mm/page_frame.h

31 lines
930 B
C
Raw Permalink Normal View History

// This file is part of noxos and licensed under the MIT open source license
2023-02-05 13:39:35 +00:00
#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