#include <geekos/string.h>
#include <geekos/vmm_mem.h>
+#include <geekos/vmm_paging.h>
/* utility definitions */
-// 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) \
+
+
/* ** */
ullong_t rip;
ullong_t rsp;
- vmm_mem_map_t mem_map;
- // preallocation map
+ vmm_mem_list_t mem_list;
+ vmm_mem_layout_t mem_layout;
// device_map
+ vmm_pde_t * page_tables;
void * vmm_data;
} guest_info_t;
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);