)\r
{\r
EFI_DEVICE_PATH_PROTOCOL *DevPathNode;\r
+ EFI_DEVICE_PATH_PROTOCOL *DevPath;\r
UINTN RootSlot;\r
UINTN Idx;\r
UINT8 IrqLine;\r
\r
DevPathNode = DevicePathFromHandle (Handle);\r
ASSERT (DevPathNode != NULL);\r
+ DevPath = DevPathNode;\r
\r
//\r
// Compute index into PciHostIrqs[] table by walking\r
Idx %= ARRAY_SIZE (PciHostIrqs);\r
IrqLine = PciHostIrqs[Idx];\r
\r
+ DEBUG_CODE_BEGIN ();\r
+ {\r
+ CHAR16 *DevPathString;\r
+ STATIC CHAR16 Fallback[] = L"<failed to convert>";\r
+ UINTN Segment, Bus, Device, Function;\r
+\r
+ DevPathString = ConvertDevicePathToText (DevPath, FALSE, FALSE);\r
+ if (DevPathString == NULL) {\r
+ DevPathString = Fallback;\r
+ }\r
+ Status = PciIo->GetLocation (PciIo, &Segment, &Bus, &Device, &Function);\r
+ ASSERT_EFI_ERROR (Status);\r
+\r
+ DEBUG ((EFI_D_VERBOSE, "%a: [%02x:%02x.%x] %s -> 0x%02x\n", __FUNCTION__,\r
+ (UINT32)Bus, (UINT32)Device, (UINT32)Function, DevPathString,\r
+ IrqLine));\r
+\r
+ if (DevPathString != Fallback) {\r
+ FreePool (DevPathString);\r
+ }\r
+ }\r
+ DEBUG_CODE_END ();\r
+\r
//\r
// Set PCI Interrupt Line register for this device to PciHostIrqs[Idx]\r
//\r