From a281e5583f033f4d26a31858330660742087d687 Mon Sep 17 00:00:00 2001 From: Steffen Vogel Date: Mon, 13 Sep 2021 15:12:37 +0200 Subject: [PATCH] vfio: make compatible with 32bit compilation --- common/lib/kernel/vfio.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/common/lib/kernel/vfio.cpp b/common/lib/kernel/vfio.cpp index 5d8963aa4..0fda27844 100644 --- a/common/lib/kernel/vfio.cpp +++ b/common/lib/kernel/vfio.cpp @@ -514,21 +514,21 @@ Device::pciEnable() { int ret; uint32_t reg; - const off_t offset = PCI_COMMAND + - (static_cast(VFIO_PCI_CONFIG_REGION_INDEX) << 40); + const off64_t offset = PCI_COMMAND + + (static_cast(VFIO_PCI_CONFIG_REGION_INDEX) << 40); /* Check if this is really a vfio-pci device */ if (!(this->info.flags & VFIO_DEVICE_FLAGS_PCI)) return false; - ret = pread(this->fd, ®, sizeof(reg), offset); + ret = pread64(this->fd, ®, sizeof(reg), offset); if (ret != sizeof(reg)) return false; /* Enable memory access and PCI bus mastering which is required for DMA */ reg |= PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER; - ret = pwrite(this->fd, ®, sizeof(reg), offset); + ret = pwrite64(this->fd, ®, sizeof(reg), offset); if (ret != sizeof(reg)) return false;