1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/node/ synced 2025-03-09 00:00:00 +01:00

format file

This commit is contained in:
Pascal Bauer 2024-09-20 17:01:55 +02:00 committed by Niklas Eiling
parent 7e53452767
commit 3d9d376180

View file

@ -247,8 +247,9 @@ bool Device::pciEnable() {
return true;
}
int Device::platformInterruptInit(int efds[]){
size_t efd_cnt = 0; // FIXME: efds currently has a fixed size of 32. But we don't check that and there may be more efds.
int Device::platformInterruptInit(int efds[]) {
size_t efd_cnt =
0; // FIXME: efds currently has a fixed size of 32. But we don't check that and there may be more efds.
for (auto irq : irqs) {
const size_t irqCount = irq.count;
const size_t irqSetSize =
@ -269,15 +270,15 @@ int Device::platformInterruptInit(int efds[]){
// Now set the new eventfds
for (size_t i = 0; i < irqCount; i++) {
efds[efd_cnt+i] = eventfd(0, 0);
if (efds[efd_cnt+i] < 0) {
efds[efd_cnt + i] = eventfd(0, 0);
if (efds[efd_cnt + i] < 0) {
delete[] irqSetBuf;
return -1;
}
eventfdList.push_back(efds[efd_cnt+i]);
eventfdList.push_back(efds[efd_cnt + i]);
}
memcpy(irqSet->data, efds+efd_cnt, sizeof(int) * irqCount);
memcpy(irqSet->data, efds + efd_cnt, sizeof(int) * irqCount);
if (ioctl(fd, VFIO_DEVICE_SET_IRQS, irqSet) != 0) {
delete[] irqSetBuf;
@ -287,9 +288,7 @@ int Device::platformInterruptInit(int efds[]){
efd_cnt += irqCount;
}
return efd_cnt;
}
int Device::pciMsiInit(int efds[]) {