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.


added new copyright and license
[palacios.git] / palacios / src / palacios / vmm_paging.c
index 95240ad..61e34a3 100644 (file)
@@ -1,3 +1,22 @@
+/* 
+ * This file is part of the Palacios Virtual Machine Monitor developed
+ * by the V3VEE Project with funding from the United States National 
+ * Science Foundation and the Department of Energy.  
+ *
+ * The V3VEE Project is a joint project between Northwestern University
+ * and the University of New Mexico.  You can find out more at 
+ * http://www.v3vee.org
+ *
+ * Copyright (c) 2008, Jack Lange <jarusl@cs.northwestern.edu> 
+ * Copyright (c) 2008, The V3VEE Project <http://www.v3vee.org> 
+ * All rights reserved.
+ *
+ * Author: Jack Lange <jarusl@cs.northwestern.edu>
+ *
+ * This is free software.  You are permitted to use,
+ * redistribute, and modify it as specified in the file "V3VEE_LICENSE".
+ */
+
 #include <palacios/vmm_paging.h>
 
 #include <palacios/vmm.h>
@@ -5,7 +24,7 @@
 #include <palacios/vm_guest_mem.h>
 
 
-extern struct vmm_os_hooks * os_hooks;
+
 
 void delete_page_tables_pde32(pde32_t * pde) {
   int i;//, j;
@@ -26,12 +45,12 @@ void delete_page_tables_pde32(pde32_t * pde) {
        }
       */
       //PrintDebug("Deleting PTE %d (%x)\n", i, pte);
-      os_hooks->free_page(pte);
+      V3_FreePage(pte);
     }
   }
 
   //  PrintDebug("Deleting PDE (%x)\n", pde);
-  os_hooks->free_page(pde);
+  V3_FreePage(pde);
 }
 
 
@@ -115,7 +134,7 @@ pt_access_status_t can_access_pde32(pde32_t * pde, addr_t addr, pf_error_t acces
   } else if ((entry->writable == 0) && (access_type.write == 1)) {
     return PT_WRITE_ERROR;
   } else if ((entry->user_page == 0) && (access_type.user == 1)) {
-    // Check CR0.WP
+    // Check CR0.WP?
     return PT_USER_ERROR;
   }
 
@@ -131,7 +150,7 @@ pt_access_status_t can_access_pte32(pte32_t * pte, addr_t addr, pf_error_t acces
   } else if ((entry->writable == 0) && (access_type.write == 1)) {
     return PT_WRITE_ERROR;
   } else if ((entry->user_page == 0) && (access_type.user == 1)) {
-    // Check CR0.WP
+    // Check CR0.WP?
     return PT_USER_ERROR;
   }
 
@@ -150,11 +169,11 @@ pde32_t * create_passthrough_pde32_pts(struct guest_info * guest_info) {
   int i, j;
   struct shadow_map * map = &(guest_info->mem_map);
 
-  pde32_t * pde = os_hooks->allocate_pages(1);
+  pde32_t * pde = V3_AllocPages(1);
 
   for (i = 0; i < MAX_PDE32_ENTRIES; i++) {
     int pte_present = 0;
-    pte32_t * pte = os_hooks->allocate_pages(1);
+    pte32_t * pte = V3_AllocPages(1);
     
 
     for (j = 0; j < MAX_PTE32_ENTRIES; j++) {
@@ -205,7 +224,7 @@ pde32_t * create_passthrough_pde32_pts(struct guest_info * guest_info) {
     }
 
     if (pte_present == 0) { 
-      os_hooks->free_page(pte);
+      V3_FreePage(pte);
 
       pde[i].present = 0;
       pde[i].writable = 0;