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 / include / geekos / vmm.h
index 8f0dfbc..336c9e0 100644 (file)
@@ -6,7 +6,9 @@
 #include <geekos/string.h>
 
 #include <geekos/vmm_mem.h>
+//#include <geekos/vmm_paging.h>
 
+#include <geekos/vm_guest.h>
 
 /* utility definitions */
 #define PrintDebug(fmt, args...)                       \
@@ -39,7 +41,7 @@
 
 
 
-// We need to check the hook structure at runtime to ensure its SAFE
+/* This clearly won't work, we need some way to get a return value out of it */
 #define VMMMalloc(size)                                 \
   do {                                                 \
     extern struct vmm_os_hooks * os_hooks;             \
   } while (0)                                          \
 
 
+// We need to check the hook structure at runtime to ensure its SAFE
+#define VMMFree(addr)                                  \
+  do {                                                 \
+    extern struct vmm_os_hooks * os_hooks;             \
+    if ((os_hooks) && (os_hooks)->free) {              \
+      (os_hooks)->free(addr);                          \
+    }                                                  \
+  } while (0)                                          \
+
+
 /* ** */
 
 
 
 
 
-typedef struct guest_info {
-  ullong_t rip;
-  ullong_t rsp;
-
-  vmm_mem_map_t mem_map;
-  // preallocation map
-  // device_map
-
-  void * vmm_data;
-} guest_info_t;
 
 
 
@@ -79,12 +81,15 @@ struct vmm_os_hooks {
   void (*print_debug)(const char * format, ...);
   void (*print_trace)(const char * format, ...);
   
-  void *(*Allocate_Pages)(int numPages);
-  void (*Free_Page)(void * page);
+  void *(*allocate_pages)(int numPages);
+  void (*free_page)(void * page);
 
   void *(*malloc)(uint_t size);
   void (*free)(void * addr);
 
+  void *(*physical_to_virtual)(void *addr);
+  void *(*virtual_to_physical)(void *addr);
+
 
   void (*start_kernel_thread)(); // include pointer to function
 };