1
0

Add simple page allocator and doubly-linked list implementation.

This commit is contained in:
2012-09-17 23:27:11 -04:00
parent b531496f8e
commit 0b3865d16a
5 changed files with 223 additions and 0 deletions

20
include/mm.h Normal file
View File

@ -0,0 +1,20 @@
#ifndef MM_H
#define MM_H
#include <list.h>
#define MM_PAGE_SIZE 4096
struct page {
void *address;
struct dlist_node list;
char free;
};
void mm_init();
void mm_add_free_region(void *start, void *end);
struct page* mm_get_free_pages(unsigned int power);
int mm_put_free_pages(struct page *p);
#endif /* MM_H */