2012-09-26 23:59:58 -04:00
|
|
|
/*
|
|
|
|
Copyright (C) 2012, Aaron Lindsay <aaron@aclindsay.com>
|
|
|
|
|
|
|
|
This file is part of Aedrix.
|
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation; either version 2 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License along
|
|
|
|
with this program; if not, write to the Free Software Foundation, Inc.,
|
|
|
|
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
|
|
*/
|
|
|
|
|
2012-09-17 23:27:11 -04:00
|
|
|
#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 */
|