diff options
author | niruiyu <niruiyu@6f19259b-4bc3-4df7-8a09-765794883524> | 2011-08-04 09:14:31 +0000 |
---|---|---|
committer | niruiyu <niruiyu@6f19259b-4bc3-4df7-8a09-765794883524> | 2011-08-04 09:14:31 +0000 |
commit | 7dad86fc603f53bc959fa285b0103d9bd1ccc55c (patch) | |
tree | f1d3bd6172ef253dda00d8cf06d5fd7eb7f8d61b | |
parent | 8db6a82c50fe16bd16a8dc53e890f13a8a91896c (diff) | |
download | edk2-7dad86fc603f53bc959fa285b0103d9bd1ccc55c.zip edk2-7dad86fc603f53bc959fa285b0103d9bd1ccc55c.tar.gz edk2-7dad86fc603f53bc959fa285b0103d9bd1ccc55c.tar.bz2 |
Print PCI Interrupt Line/Interrupt Pin registers before booting legacy OS.
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
-rw-r--r-- | IntelFrameworkModulePkg/Csm/LegacyBiosDxe/LegacyBootSupport.c | 74 |
1 files changed, 71 insertions, 3 deletions
diff --git a/IntelFrameworkModulePkg/Csm/LegacyBiosDxe/LegacyBootSupport.c b/IntelFrameworkModulePkg/Csm/LegacyBiosDxe/LegacyBootSupport.c index 40d027a..207d6e9 100644 --- a/IntelFrameworkModulePkg/Csm/LegacyBiosDxe/LegacyBootSupport.c +++ b/IntelFrameworkModulePkg/Csm/LegacyBiosDxe/LegacyBootSupport.c @@ -136,6 +136,72 @@ PrintHddInfo ( }
/**
+ Print the PCI Interrupt Line and Interrupt Pin registers.
+**/
+VOID
+PrintPciInterruptRegister (
+ VOID
+ )
+{
+ EFI_STATUS Status;
+ UINTN Index;
+ EFI_HANDLE *Handles;
+ UINTN HandleNum;
+ EFI_PCI_IO_PROTOCOL *PciIo;
+ UINT8 Interrupt[2];
+ UINTN Segment;
+ UINTN Bus;
+ UINTN Device;
+ UINTN Function;
+
+ gBS->LocateHandleBuffer (
+ ByProtocol,
+ &gEfiPciIoProtocolGuid,
+ NULL,
+ &HandleNum,
+ &Handles
+ );
+
+ Bus = 0;
+ Device = 0;
+ Function = 0;
+
+ DEBUG ((EFI_D_INFO, "\n"));
+ DEBUG ((EFI_D_INFO, " bb/dd/ff interrupt line interrupt pin\n"));
+ DEBUG ((EFI_D_INFO, "======================================\n"));
+ for (Index = 0; Index < HandleNum; Index++) {
+ Status = gBS->HandleProtocol (Handles[Index], &gEfiPciIoProtocolGuid, (VOID **) &PciIo);
+ if (!EFI_ERROR (Status)) {
+ Status = PciIo->Pci.Read (
+ PciIo,
+ EfiPciIoWidthUint8,
+ PCI_INT_LINE_OFFSET,
+ 2,
+ Interrupt
+ );
+ }
+ if (!EFI_ERROR (Status)) {
+ Status = PciIo->GetLocation (
+ PciIo,
+ &Segment,
+ &Bus,
+ &Device,
+ &Function
+ );
+ }
+ if (!EFI_ERROR (Status)) {
+ DEBUG ((EFI_D_INFO, " %02x/%02x/%02x 0x%02x 0x%02x\n",
+ Bus, Device, Function, Interrupt[0], Interrupt[1]));
+ }
+ }
+ DEBUG ((EFI_D_INFO, "\n"));
+
+ if (Handles != NULL) {
+ FreePool (Handles);
+ }
+}
+
+/**
Identify drive data must be updated to actual parameters before boot.
@param IdentifyDriveData ATA Identify Data
@@ -1031,9 +1097,11 @@ GenericLegacyBoot ( &LocalBbsTable
);
- PrintBbsTable (LocalBbsTable);
- PrintHddInfo (LocalHddInfo);
-
+ DEBUG_CODE (
+ PrintPciInterruptRegister ();
+ PrintBbsTable (LocalBbsTable);
+ PrintHddInfo (LocalHddInfo);
+ );
//
// If drive wasn't spun up then BuildIdeData may have found new drives.
// Need to update BBS boot priority.
|