1 #include <geekos/vmm_stubs.h>
2 #include <geekos/serial.h>
6 void * Identity(void *addr) { return addr; };
8 void * Allocate_VMM_Pages(int num_pages) {
9 void * start_page = Alloc_Page();
10 //SerialPrint("Allocating Page: %x (%d of %d)\n",start_page, 1, num_pages);
13 while (i < num_pages) {
14 void * tmp_page = Alloc_Page();
15 //SerialPrint("Allocating Page: %x (%d of %d)\n",tmp_page, i+1, num_pages);
17 if (tmp_page != start_page + (PAGE_SIZE * i)) {
18 //we have to start over...;
20 Free_Page(start_page + (PAGE_SIZE * i));
23 start_page = Alloc_Page();
24 //SerialPrint("Allocating Page: %x (%d of %d)\n",start_page, 1, num_pages);
34 void Free_VMM_Page(void * page) {
39 void * VMM_Malloc(unsigned int size) {
40 return Malloc((unsigned long) size);
44 void VMM_Free(void * addr) {