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

fix readHostBar throwing errors when BAR is correct

Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
This commit is contained in:
Niklas Eiling 2023-10-23 16:51:34 +02:00 committed by Steffen Vogel
parent 66569cf9c4
commit ad2619cba5

View file

@ -367,11 +367,12 @@ uint32_t Device::readHostBar(unsigned barNum) const {
if (std::sscanf(line.c_str(), "%llx %llx %llx", &start, &end, &flags) != 3)
throw SystemError("Failed to parse BAR line");
if (end > start)
if (end <= start) {
throw SystemError("Invalid BAR: start={}, end={}", start, end);
}
log->debug("Host BAR: start={:#x}, end={:#x}, size={:#x}, flags={:#x}", start,
end, end - start, flags);
end, end - start + 1, flags);
return start;
}