1
0
Fork 0
mirror of https://github.com/tailix/kernel.git synced 2024-10-30 12:03:52 -04:00

Add function "memory_free_page"

This commit is contained in:
Braiden Vasco 2017-11-05 08:08:33 +00:00
parent 940d0734b1
commit b981271c64
2 changed files with 13 additions and 0 deletions

View file

@ -45,6 +45,17 @@ unsigned long memory_alloc_page()
return 0;
}
void memory_free_page(const unsigned long addr)
{
const unsigned long i = addr / PAGE_SIZE;
if (i >= FRAMES_COUNT) {
return;
}
frames[i] = 0;
}
void mark_used(const unsigned long base, const unsigned long limit)
{
const unsigned int start = base / PAGE_SIZE;

View file

@ -4,6 +4,8 @@
#include <kernelmq/info.h>
void memory_initialize(const struct KernelMQ_Info *kinfo);
unsigned long memory_alloc_page();
void memory_free_page(unsigned long addr);
#endif