summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorPablo de Lara <pablo.de.lara.guarch@intel.com>2016-04-10 20:25:52 +0100
committerThomas Monjalon <thomas.monjalon@6wind.com>2016-04-10 21:36:54 +0200
commit8a78fa6115e24a42495d19365d73b8c69c68d54d (patch)
tree7a416f59a84a573575ff193e878d320bd756300b /examples
parent57d78d33bedce710a7fb64c44b47d1cd0eed6fdc (diff)
downloaddpdk-8a78fa6115e24a42495d19365d73b8c69c68d54d.zip
dpdk-8a78fa6115e24a42495d19365d73b8c69c68d54d.tar.gz
dpdk-8a78fa6115e24a42495d19365d73b8c69c68d54d.tar.xz
examples/vhost_xen: fix 32-bit build
Compilation fails on 32 bits on Vhost_xen sample app, due to wrong casting: examples/vhost_xen/vhost_monitor.c: In function ‘new_device’: examples/vhost_xen/vhost_monitor.c:288:62: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast] Fixes: 47bd46112b71 ("xen: import xenvirt pmd and vhost_xen") Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Diffstat (limited to 'examples')
-rw-r--r--examples/vhost_xen/vhost_monitor.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/examples/vhost_xen/vhost_monitor.c b/examples/vhost_xen/vhost_monitor.c
index 605cd4d..fb9606b 100644
--- a/examples/vhost_xen/vhost_monitor.c
+++ b/examples/vhost_xen/vhost_monitor.c
@@ -285,9 +285,13 @@ virtio_net_config_ll *new_device(unsigned int virtio_idx, struct xen_guest *gues
new_ll_dev->dev.mem = malloc(sizeof(struct virtio_memory) + sizeof(struct virtio_memory_regions) * MAX_XENVIRT_MEMPOOL);
new_ll_dev->dev.mem->nregions = guest->pool_num;
for (i = 0; i < guest->pool_num; i++) {
- gpa = new_ll_dev->dev.mem->regions[i].guest_phys_address = (uint64_t)guest->mempool[i].gva;
- new_ll_dev->dev.mem->regions[i].guest_phys_address_end = gpa + guest->mempool[i].mempfn_num * getpagesize();
- new_ll_dev->dev.mem->regions[i].address_offset = (uint64_t)guest->mempool[i].hva - gpa;
+ gpa = new_ll_dev->dev.mem->regions[i].guest_phys_address =
+ (uint64_t)((uintptr_t)guest->mempool[i].gva);
+ new_ll_dev->dev.mem->regions[i].guest_phys_address_end =
+ gpa + guest->mempool[i].mempfn_num * getpagesize();
+ new_ll_dev->dev.mem->regions[i].address_offset =
+ (uint64_t)((uintptr_t)guest->mempool[i].hva -
+ (uintptr_t)gpa);
}
new_ll_dev->next = NULL;