Palacios Public Git Repository

To checkout Palacios execute

  git clone http://v3vee.org/palacios/palacios.web/palacios.git
This will give you the master branch. You probably want the devel branch or one of the release branches. To switch to the devel branch, simply execute
  cd palacios
  git checkout --track -b devel origin/devel
The other branches are similar.


*** empty log message ***
[palacios.git] / palacios / src / geekos / vmm_stubs.c
1 #include <geekos/vmm_stubs.h>
2 #include <geekos/serial.h>
3
4
5
6 void * Identity(void *addr) { return addr; };
7
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); 
11   int i = 1;
12
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); 
16     
17     if (tmp_page != start_page + (PAGE_SIZE * i)) {
18       //we have to start over...;
19       while (i >= 0) {
20         Free_Page(start_page + (PAGE_SIZE * i));
21         i--;
22       }
23       start_page = Alloc_Page();
24       //SerialPrint("Allocating Page: %x (%d of %d)\n",start_page, 1, num_pages);
25       i = 1;
26       continue;
27     }
28     i++;
29   }
30
31   return start_page;
32 }
33
34 void Free_VMM_Page(void * page) {
35   Free_Page(page);
36 }
37
38
39 void * VMM_Malloc(uint_t size) {
40   return Malloc((ulong_t) size);
41 }
42
43
44 void VMM_Free(void * addr) {
45   Free(addr);
46 }