X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=palacios%2Finclude%2Fgeekos%2Fvmm.h;h=896598f367f37109795ea8c8b3cf6929b1e44e8d;hb=9be2a31f574121ab4aa0289b7714eefe070b0db0;hp=c1c82d9474c8f0bd0c542c0886815bbbc79203d2;hpb=2e05f3b8f738466246add183c55bcb17abf33ec9;p=palacios-OLD.git diff --git a/palacios/include/geekos/vmm.h b/palacios/include/geekos/vmm.h index c1c82d9..896598f 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...) \ @@ -37,6 +39,28 @@ } while (0) \ + + +/* 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; \ + if ((os_hooks) && (os_hooks)->malloc) { \ + (os_hooks)->malloc(size); \ + } \ + } 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) \ + + /* ** */ @@ -46,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; @@ -67,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 *(*paddr_to_vaddr)(void *addr); + void *(*vaddr_to_paddr)(void *addr); + void (*start_kernel_thread)(); // include pointer to function };