From: Peter Dinda Date: Wed, 20 Apr 2011 23:30:08 +0000 (-0500) Subject: More interfaces changes for host devices + tweak to pci_front device to match X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=commitdiff_plain;h=b283373f3067fe329fb6c526f62d72cec27f4149;p=palacios.git More interfaces changes for host devices + tweak to pci_front device to match --- diff --git a/palacios/include/interfaces/vmm_host_dev.h b/palacios/include/interfaces/vmm_host_dev.h index 57fea7c..2b893b5 100644 --- a/palacios/include/interfaces/vmm_host_dev.h +++ b/palacios/include/interfaces/vmm_host_dev.h @@ -23,7 +23,6 @@ #include - /* The purpose of this interface is to make it possible to implement @@ -109,13 +108,13 @@ uint64_t v3_host_dev_write_mem(v3_host_dev_t hostdev, int v3_host_dev_ack_irq(v3_host_dev_t hostdev, uint8_t irq); -uint64_t v3_host_dev_config_read(v3_host_dev_t hostdev, +uint64_t v3_host_dev_read_config(v3_host_dev_t hostdev, uint64_t offset, void *dest, uint64_t len); -uint64_t v3_host_dev_config_write(v3_host_dev_t hostdev, - uint64_t offset, +uint64_t v3_host_dev_write_config(v3_host_dev_t hostdev, + uint64_t offset, void *src, uint64_t len); @@ -155,12 +154,12 @@ struct v3_host_dev_hooks { // fail, returning != len // Callee gets the host dev id, and the guest physical address uint64_t (*read_mem)(v3_host_dev_t hostdev, - addr_t gpa, + void * gpa, void *dest, uint64_t len); uint64_t (*write_mem)(v3_host_dev_t hostdev, - addr_t gpa, + void * gpa, void *src, uint64_t len); @@ -210,13 +209,13 @@ int v3_host_dev_raise_irq(v3_host_dev_t hostdev, */ uint64_t v3_host_dev_read_guest_mem(v3_host_dev_t hostdev, v3_guest_dev_t guest_dev, - addr_t gpa, + void * gpa, void *dest, uint64_t len); uint64_t v3_host_dev_write_guest_mem(v3_host_dev_t hostdev, v3_guest_dev_t guest_dev, - addr_t gpa, + void * gpa, void *src, uint64_t len); diff --git a/palacios/src/devices/pci_front.c b/palacios/src/devices/pci_front.c index eb73076..487ab5c 100644 --- a/palacios/src/devices/pci_front.c +++ b/palacios/src/devices/pci_front.c @@ -151,7 +151,7 @@ static int push_config(struct pci_front_internal *state, uint8_t *config) static int pull_config(struct pci_front_internal *state, uint8_t *config) { - if (v3_host_dev_config_read(state->host_dev, 0, config, 256) != 256) { + if (v3_host_dev_read_config(state->host_dev, 0, config, 256) != 256) { return -1; } else { return 0; @@ -625,7 +625,7 @@ static int pci_front_config_update(uint_t reg_num, void * src, uint_t length, vo PrintDebug("\n"); - if (v3_host_dev_config_write(state->host_dev, + if (v3_host_dev_write_config(state->host_dev, pci_addr.value, src, length) != length) { diff --git a/palacios/src/interfaces/vmm_host_dev.c b/palacios/src/interfaces/vmm_host_dev.c index 531fc87..0002cb2 100644 --- a/palacios/src/interfaces/vmm_host_dev.c +++ b/palacios/src/interfaces/vmm_host_dev.c @@ -76,7 +76,7 @@ uint64_t v3_host_dev_read_mem(v3_host_dev_t hdev, V3_ASSERT(host_dev_hooks != NULL); V3_ASSERT(host_dev_hooks->read_mem != NULL); - return host_dev_hooks->read_mem(hdev,gpa,dst,len); + return host_dev_hooks->read_mem(hdev,(void*)gpa,dst,len); } uint64_t v3_host_dev_write_mem(v3_host_dev_t hdev, @@ -87,7 +87,7 @@ uint64_t v3_host_dev_write_mem(v3_host_dev_t hdev, V3_ASSERT(host_dev_hooks != NULL); V3_ASSERT(host_dev_hooks->write_mem != NULL); - return host_dev_hooks->write_mem(hdev,gpa,src,len); + return host_dev_hooks->write_mem(hdev,(void*)gpa,src,len); } uint64_t v3_host_dev_read_config(v3_host_dev_t hdev, @@ -141,7 +141,7 @@ int v3_host_dev_raise_irq(v3_host_dev_t hostdev, uint64_t v3_host_dev_read_guest_mem(v3_host_dev_t hostdev, v3_guest_dev_t guest_dev, - addr_t gpa, + void * gpa, void *dst, uint64_t len) { @@ -155,14 +155,14 @@ uint64_t v3_host_dev_read_guest_mem(v3_host_dev_t hostdev, if (!vm) { return 0; } else { - return v3_read_gpa_memory(&(vm->cores[0]), gpa, len, dst); + return v3_read_gpa_memory(&(vm->cores[0]), (addr_t)gpa, len, dst); } } } uint64_t v3_host_dev_write_guest_mem(v3_host_dev_t hostdev, v3_guest_dev_t guest_dev, - addr_t gpa, + void * gpa, void *src, uint64_t len) { @@ -176,7 +176,7 @@ uint64_t v3_host_dev_write_guest_mem(v3_host_dev_t hostdev, if (!vm) { return 0; } else { - return v3_write_gpa_memory(&(vm->cores[0]), gpa, len, src); + return v3_write_gpa_memory(&(vm->cores[0]), (addr_t)gpa, len, src); } } }