platform_drv/x86: fix report for many PCI devices

When there are too many PCI devices, the Expanding_reporter regenerates
the report. However, this doesn't reset the BDF counter used to iterate
over the devices. This results in starting the new report after the PCI
device that triggered the report buffer overflow. This commit fixes the
issue by putting the BDF counter initialization inside the lambda
function used to generate the report.

Fixes #3317
This commit is contained in:
Ben Larson 2019-05-06 00:34:51 -06:00 committed by Christian Helmuth
parent ba51800b31
commit 5f0aa16184
1 changed files with 2 additions and 1 deletions

View File

@ -1078,9 +1078,10 @@ class Platform::Root : public Genode::Root_component<Session_component>
Config_access config_access(*_pci_confspace);
Device_config config;
int bus = 0, device = 0, function = -1;
_pci_reporter->generate([&] (Genode::Reporter::Xml_generator &xml) {
int bus = 0, device = 0, function = -1;
/* iterate over pci devices */
while (true) {
function += 1;