2020-07-25 16:54:37 -05:00
|
|
|
/**
|
|
|
|
* \file
|
|
|
|
*/
|
|
|
|
|
2019-03-11 09:32:55 -05:00
|
|
|
#ifndef PMEM_H
|
|
|
|
#define PMEM_H
|
|
|
|
|
2019-04-27 15:03:31 -05:00
|
|
|
#include <grub/multiboot2.h>
|
2019-03-11 09:32:55 -05:00
|
|
|
|
2020-07-25 16:54:37 -05:00
|
|
|
/**
|
|
|
|
* Initialize the physical memory manager
|
|
|
|
* \param tags The multiboot header
|
|
|
|
*/
|
2019-04-27 15:03:31 -05:00
|
|
|
void pmem_init(struct multiboot_boot_header_tag* tags);
|
2020-07-25 16:54:37 -05:00
|
|
|
/**
|
|
|
|
* Allocate physical frames
|
|
|
|
* \param num_pages The number of frames to allocate
|
|
|
|
* \return the physical address of the allocated frames
|
|
|
|
*/
|
2019-03-11 09:32:55 -05:00
|
|
|
void* pmem_alloc(int num_pages);
|
2020-07-25 16:54:37 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Free allocated physical frames
|
2020-07-27 19:02:09 -05:00
|
|
|
* \param start The address to start freeing at.
|
2020-07-25 16:54:37 -05:00
|
|
|
* \param num_pages The number of frames to free
|
|
|
|
*/
|
2020-08-01 08:47:13 -05:00
|
|
|
void pmem_free(void* start,int num_pages);
|
2019-03-11 09:32:55 -05:00
|
|
|
|
|
|
|
#endif
|