]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Print PCI Interrupt Line/Interrupt Pin registers before booting legacy OS.
authorniruiyu <niruiyu@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 4 Aug 2011 09:14:31 +0000 (09:14 +0000)
committerniruiyu <niruiyu@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 4 Aug 2011 09:14:31 +0000 (09:14 +0000)
Signed-off-by: niruiyu
Reviewed-by: li-elvin
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12088 6f19259b-4bc3-4df7-8a09-765794883524

IntelFrameworkModulePkg/Csm/LegacyBiosDxe/LegacyBootSupport.c

index 40d027a5238746b5b358ff2205f577a7f286b57d..207d6e9bcd973f25ad83c8f1c0335a5b6de29339 100644 (file)
@@ -135,6 +135,72 @@ PrintHddInfo (
   return ;\r
 }\r
 \r
+/**\r
+  Print the PCI Interrupt Line and Interrupt Pin registers.\r
+**/\r
+VOID\r
+PrintPciInterruptRegister (\r
+  VOID\r
+  )\r
+{\r
+  EFI_STATUS                  Status;\r
+  UINTN                       Index;\r
+  EFI_HANDLE                  *Handles;\r
+  UINTN                       HandleNum;\r
+  EFI_PCI_IO_PROTOCOL         *PciIo;\r
+  UINT8                       Interrupt[2];\r
+  UINTN                       Segment;\r
+  UINTN                       Bus;\r
+  UINTN                       Device;\r
+  UINTN                       Function;\r
+\r
+  gBS->LocateHandleBuffer (\r
+         ByProtocol,\r
+         &gEfiPciIoProtocolGuid,\r
+         NULL,\r
+         &HandleNum,\r
+         &Handles\r
+         );\r
+\r
+  Bus      = 0;\r
+  Device   = 0;\r
+  Function = 0;\r
+\r
+  DEBUG ((EFI_D_INFO, "\n"));\r
+  DEBUG ((EFI_D_INFO, " bb/dd/ff interrupt line interrupt pin\n"));\r
+  DEBUG ((EFI_D_INFO, "======================================\n"));\r
+  for (Index = 0; Index < HandleNum; Index++) {\r
+    Status = gBS->HandleProtocol (Handles[Index], &gEfiPciIoProtocolGuid, (VOID **) &PciIo);\r
+    if (!EFI_ERROR (Status)) {\r
+      Status = PciIo->Pci.Read (\r
+                            PciIo,\r
+                            EfiPciIoWidthUint8,\r
+                            PCI_INT_LINE_OFFSET,\r
+                            2,\r
+                            Interrupt\r
+                            );\r
+    }\r
+    if (!EFI_ERROR (Status)) {\r
+      Status = PciIo->GetLocation (\r
+                        PciIo,\r
+                        &Segment,\r
+                        &Bus,\r
+                        &Device,\r
+                        &Function\r
+                        );\r
+    }\r
+    if (!EFI_ERROR (Status)) {\r
+      DEBUG ((EFI_D_INFO, " %02x/%02x/%02x 0x%02x           0x%02x\n",\r
+              Bus, Device, Function, Interrupt[0], Interrupt[1]));\r
+    }\r
+  }\r
+  DEBUG ((EFI_D_INFO, "\n"));\r
+\r
+  if (Handles != NULL) {\r
+    FreePool (Handles);\r
+  }\r
+}\r
+\r
 /**\r
   Identify drive data must be updated to actual parameters before boot.\r
 \r
@@ -1031,9 +1097,11 @@ GenericLegacyBoot (
     &LocalBbsTable\r
     );\r
 \r
-  PrintBbsTable (LocalBbsTable);\r
-  PrintHddInfo (LocalHddInfo);\r
-\r
+  DEBUG_CODE (\r
+    PrintPciInterruptRegister ();\r
+    PrintBbsTable (LocalBbsTable);\r
+    PrintHddInfo (LocalHddInfo);\r
+    );\r
   //\r
   // If drive wasn't spun up then BuildIdeData may have found new drives.\r
   // Need to update BBS boot priority.\r