Skip to content
This repository was archived by the owner on Feb 29, 2024. It is now read-only.

Commit 5dfe9b4

Browse files
author
IgnoreWarnings
committed
fix double init
1 parent 49b98ad commit 5dfe9b4

File tree

1 file changed

+9
-11
lines changed

1 file changed

+9
-11
lines changed

lib/core.cpp

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -185,24 +185,22 @@ std::list<std::shared_ptr<Core>> CoreFactory::make(Card *card,
185185
// });
186186

187187
//! TODO: Order of interrupts is hardcoded and not tested (may be reversed). Aviable in vfio device irq.id .
188+
auto intc = new PlatformInterruptController();
189+
intc->id = id;
190+
intc->logger = villas::logging.get(id.getName());
191+
intc->card = card;
192+
188193
std::vector<const char *> intc_names = {"mm2s_introut", "s2mm_introut"};
189194
int num = 0;
190195
for (auto name : intc_names)
191196
{
192-
auto intc = new PlatformInterruptController();
193-
intc->id = id;
194-
intc->logger = villas::logging.get(id.getName());
195-
intc->card = card;
196-
intc->init();
197-
198-
const char *irqName = name;
199197
std::string irqControllerName = "PlatformInterruptController";
200-
201-
logger->debug("IRQ: {} -> {}:{}", irqName, irqControllerName, num);
202-
ip->irqs[irqName] = {num, intc, ""};
203-
198+
logger->debug("IRQ: {} -> {}:{}", std::string(name), irqControllerName, num);
199+
ip->irqs[std::string(name)] = {num, intc, ""};
204200
num++;
205201
}
202+
203+
intc->init();
206204
}
207205

208206
json_t *json_memory_view = json_object_get(json_ip, "memory-view");

0 commit comments

Comments
 (0)