X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=palacios%2Finclude%2Fgeekos%2Fvmm.h;h=336c9e06f83e97ce0daa84422897abbeda9249d2;hb=271ad3fd89672d441db3c5ffa673ee649e4ce532;hp=8f0dfbc34d6888445b3c80a3f6b02c6e16e9aa97;hpb=b4963a8a43ca9103946f926e062e609e4498c2e2;p=palacios.git diff --git a/palacios/include/geekos/vmm.h b/palacios/include/geekos/vmm.h index 8f0dfbc..336c9e0 100644 --- a/palacios/include/geekos/vmm.h +++ b/palacios/include/geekos/vmm.h @@ -6,7 +6,9 @@ #include #include +//#include +#include /* 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; \ @@ -49,6 +51,16 @@ } 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) \ + + /* ** */ @@ -58,16 +70,6 @@ -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 };