Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
ACS
Public
VILLASframework
VILLAScommon
Commits
de0d8524
Commit
de0d8524
authored
Sep 13, 2021
by
Steffen Vogel
🎅🏼
Browse files
vfio: make compatible with 32bit compilation
parent
ca958433
Changes
1
Show whitespace changes
Inline
Side-by-side
lib/kernel/vfio.cpp
View file @
de0d8524
...
@@ -514,21 +514,21 @@ Device::pciEnable()
...
@@ -514,21 +514,21 @@ Device::pciEnable()
{
{
int
ret
;
int
ret
;
uint32_t
reg
;
uint32_t
reg
;
const
off_t
offset
=
PCI_COMMAND
+
const
off
64
_t
offset
=
PCI_COMMAND
+
(
static_cast
<
off_t
>
(
VFIO_PCI_CONFIG_REGION_INDEX
)
<<
40
);
(
static_cast
<
off
64
_t
>
(
VFIO_PCI_CONFIG_REGION_INDEX
)
<<
40
);
/* Check if this is really a vfio-pci device */
/* Check if this is really a vfio-pci device */
if
(
!
(
this
->
info
.
flags
&
VFIO_DEVICE_FLAGS_PCI
))
if
(
!
(
this
->
info
.
flags
&
VFIO_DEVICE_FLAGS_PCI
))
return
false
;
return
false
;
ret
=
pread
(
this
->
fd
,
&
reg
,
sizeof
(
reg
),
offset
);
ret
=
pread
64
(
this
->
fd
,
&
reg
,
sizeof
(
reg
),
offset
);
if
(
ret
!=
sizeof
(
reg
))
if
(
ret
!=
sizeof
(
reg
))
return
false
;
return
false
;
/* Enable memory access and PCI bus mastering which is required for DMA */
/* Enable memory access and PCI bus mastering which is required for DMA */
reg
|=
PCI_COMMAND_MEMORY
|
PCI_COMMAND_MASTER
;
reg
|=
PCI_COMMAND_MEMORY
|
PCI_COMMAND_MASTER
;
ret
=
pwrite
(
this
->
fd
,
&
reg
,
sizeof
(
reg
),
offset
);
ret
=
pwrite
64
(
this
->
fd
,
&
reg
,
sizeof
(
reg
),
offset
);
if
(
ret
!=
sizeof
(
reg
))
if
(
ret
!=
sizeof
(
reg
))
return
false
;
return
false
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment