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.


V3VEE compiles. Segfaults, but the callback structures work.
[palacios-OLD.git] / kitten / palacios-glue / vmm_stubs.c
index 3d44102..789eee7 100644 (file)
  * redistribute, and modify it as specified in the file "V3VEE_LICENSE".
  */
 
-#include <palacios/vmm.h>
-#include <palacios/vmm_host_events.h>
-
+#include <lwk/palacios.h>
+#include <lwk/types.h>
 #include <lwk/pmem.h>
+#include <lwk/string.h>
+#include <lwk/cpuinfo.h>
+#include <lwk/kernel.h>
+#include <arch/page.h>
+#include <arch/ptrace.h>
+#include <arch/apic.h>
 
 struct guest_info * g_vm_guest = NULL;
 
@@ -44,12 +49,12 @@ void Init_Stubs(struct guest_info * info) {
 
 void * kitten_pa_to_va(void *ptr)
 {
-  return __va(ptr);
+  return (void*) __va(ptr);
 }
 
 void * kitten_va_to_pa(void *ptr)
 {
-  return __pa(ptr);
+  return (void*) __pa(ptr);
 }
 
 void * Allocate_VMM_Pages(int num_pages) 
@@ -80,7 +85,7 @@ void Free_VMM_Page(void * page)
   rc=pmem_query(&query,&result);
 
   if (!rc) { 
-    result.allocated=FALSE;
+    result.allocated=0;
     pmem_update(&result);
   } else {
     // BAD
@@ -88,15 +93,6 @@ void Free_VMM_Page(void * page)
 }
 
 
-void * VMM_Malloc(unsigned int size) {
-  return Malloc((unsigned long) size);
-}
-
-
-void VMM_Free(void * addr) {
-  Free(addr);
-}
-
 
 
 void send_key_to_vmm(unsigned char status, unsigned char scancode) {
@@ -178,3 +174,18 @@ unsigned int get_cpu_khz()
 }
 
 
+struct v3_os_hooks v3vee_os_hooks = {
+       .print_debug = &printk,  // serial print ideally
+       .print_info = &printk,   // serial print ideally
+       .print_trace = &printk,  // serial print ideally
+       .allocate_pages = &Allocate_VMM_Pages, // defined in vmm_stubs
+       .free_page = &Free_VMM_Page, // defined in vmm_stubs
+       .malloc = &kmem_alloc,
+       .free = &kmem_free,
+       .vaddr_to_paddr = &kitten_va_to_pa,
+       .paddr_to_vaddr = &kitten_pa_to_va,
+       .hook_interrupt = &kitten_hook_interrupt,
+       .ack_irq = &ack_irq,
+       .get_cpu_khz = &get_cpu_khz,
+};
+