mirror of
https://git.rwth-aachen.de/acs/public/villas/node/
synced 2025-03-09 00:00:00 +01:00
vfio: make compatible with 32bit compilation
This commit is contained in:
parent
85573b82a3
commit
a281e5583f
1 changed files with 4 additions and 4 deletions
|
@ -514,21 +514,21 @@ Device::pciEnable()
|
|||
{
|
||||
int ret;
|
||||
uint32_t reg;
|
||||
const off_t offset = PCI_COMMAND +
|
||||
(static_cast<off_t>(VFIO_PCI_CONFIG_REGION_INDEX) << 40);
|
||||
const off64_t offset = PCI_COMMAND +
|
||||
(static_cast<off64_t>(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;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue