Add simple page allocator and doubly-linked list implementation.
This commit is contained in:
20
include/mm.h
Normal file
20
include/mm.h
Normal 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 */
|
Reference in New Issue
Block a user