Skip to content

Commit ba1298b

Browse files
committed
debug: convert to DBG
Change-Id: Ic7a6222e609f9362cb9435c61510e88182b19e00
1 parent fed67f8 commit ba1298b

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

src/pci.h

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -248,15 +248,15 @@ union VSEC {
248248
template <class MatchFunc, class ProcessFunc>
249249
void processDVSEC(MatchFunc matchFunc, ProcessFunc processFunc)
250250
{
251-
forAllIntelDevices([&](const uint32 group, const uint32 bus, const uint32 device, const uint32 function, const uint32 /* device_id */)
251+
forAllIntelDevices([&](const uint32 group, const uint32 bus, const uint32 device, const uint32 function, const uint32 device_id)
252252
{
253-
// std::cerr << "Intel device scan. found " << std::hex << group << ":" << bus << ":" << device << ":" << function << " " << device_id << std::dec;
253+
DBG(2, "Intel device scan.found " , std::hex , group , ":" , bus , " : " , device , " : " , function , " " , device_id);
254254
uint32 status{0};
255255
PciHandleType h(group, bus, device, function);
256256
h.read32(4, &status); // read status
257257
if (status & 0x100000) // has capability list
258258
{
259-
// std::cerr << "Intel device scan. found "<< std::hex << group << ":" << bus << ":" << device << ":" << function << " " << device_id << " with capability list\n" << std::dec;
259+
DBG(2, "Intel device scan. found ", std::hex , group , ":" , bus , ":" , device , ":" , function , " " , device_id , " with capability list");
260260
VSEC header;
261261
uint64 offset = 0x100;
262262
do
@@ -269,11 +269,11 @@ void processDVSEC(MatchFunc matchFunc, ProcessFunc processFunc)
269269
{
270270
return;
271271
}
272-
// std::cerr << "offset 0x" << std::hex << offset << " header.fields.cap_id: 0x" << header.fields.cap_id << std::dec << "\n";
273-
// std::cerr << ".. found entryID: 0x" << std::hex << header.fields.entryID << std::dec << "\n";
272+
DBG(2, "offset 0x" , std::hex , offset , " header.fields.cap_id: 0x" , header.fields.cap_id , std::dec );
273+
DBG(2, ".. found entryID: 0x" , std::hex , header.fields.entryID , std::dec);
274274
if (matchFunc(header))
275275
{
276-
// std::cerr << ".... found match\n";
276+
DBG(2, ".... found match");
277277
auto barOffset = 0x10 + header.fields.tBIR * 4;
278278
uint32 bar = 0;
279279
if (h.read32(barOffset, &bar) == sizeof(uint32) && bar != 0) // read bar
@@ -290,6 +290,7 @@ void processDVSEC(MatchFunc matchFunc, ProcessFunc processFunc)
290290
offset = header.fields.cap_next & ~3;
291291
if (lastOffset == offset) // the offset did not change
292292
{
293+
DBG(2, " lastOffset == offset ", lastOffset , "==", offset);
293294
return; // deadlock protection
294295
}
295296
} while (1);

0 commit comments

Comments
 (0)