summaryrefslogtreecommitdiffstats
path: root/MdeModulePkg
diff options
context:
space:
mode:
authorRuiyu Ni <ruiyu.ni@intel.com>2018-08-23 10:34:33 +0800
committerRuiyu Ni <ruiyu.ni@intel.com>2018-08-27 09:40:21 +0800
commit06da1e310bcea971073a8dabc5c3d35bc190847c (patch)
treed47013893ca1f6c433d14806ad56f7b510d310a1 /MdeModulePkg
parent6861765935d5b69803321ba6e43240845c7ab0e5 (diff)
downloadedk2-06da1e310bcea971073a8dabc5c3d35bc190847c.tar.gz
edk2-06da1e310bcea971073a8dabc5c3d35bc190847c.tar.bz2
edk2-06da1e310bcea971073a8dabc5c3d35bc190847c.zip
MdeModulePkg/PciBus: Refine ActiveVGADeviceOnTheRootBridge
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1109 The patch doesn't change any behavior of this function. It just renames the function to LocateVgaDevice() and renames some parameters and local variables. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
Diffstat (limited to 'MdeModulePkg')
-rw-r--r--MdeModulePkg/Bus/Pci/PciBusDxe/PciDeviceSupport.c35
-rw-r--r--MdeModulePkg/Bus/Pci/PciBusDxe/PciDeviceSupport.h10
2 files changed, 21 insertions, 24 deletions
diff --git a/MdeModulePkg/Bus/Pci/PciBusDxe/PciDeviceSupport.c b/MdeModulePkg/Bus/Pci/PciBusDxe/PciDeviceSupport.c
index f7039da992..5a4b830604 100644
--- a/MdeModulePkg/Bus/Pci/PciBusDxe/PciDeviceSupport.c
+++ b/MdeModulePkg/Bus/Pci/PciBusDxe/PciDeviceSupport.c
@@ -1002,7 +1002,7 @@ ActiveVGADeviceOnTheSameSegment (
if (Temp->PciRootBridgeIo->SegmentNumber == VgaDevice->PciRootBridgeIo->SegmentNumber) {
- Temp = ActiveVGADeviceOnTheRootBridge (Temp);
+ Temp = LocateVgaDevice (Temp);
if (Temp != NULL) {
return Temp;
@@ -1016,41 +1016,41 @@ ActiveVGADeviceOnTheSameSegment (
}
/**
- Get the active VGA device on the root bridge.
+ Locate the active VGA device under the bridge.
- @param RootBridge PCI IO instance for the root bridge.
+ @param Bridge PCI IO instance for the bridge.
@return The active VGA device.
**/
PCI_IO_DEVICE *
-ActiveVGADeviceOnTheRootBridge (
- IN PCI_IO_DEVICE *RootBridge
+LocateVgaDevice (
+ IN PCI_IO_DEVICE *Bridge
)
{
LIST_ENTRY *CurrentLink;
- PCI_IO_DEVICE *Temp;
+ PCI_IO_DEVICE *PciIoDevice;
- CurrentLink = RootBridge->ChildList.ForwardLink;
+ CurrentLink = Bridge->ChildList.ForwardLink;
- while (CurrentLink != NULL && CurrentLink != &RootBridge->ChildList) {
+ while (CurrentLink != NULL && CurrentLink != &Bridge->ChildList) {
- Temp = PCI_IO_DEVICE_FROM_LINK (CurrentLink);
+ PciIoDevice = PCI_IO_DEVICE_FROM_LINK (CurrentLink);
- if (IS_PCI_VGA(&Temp->Pci) &&
- (Temp->Attributes &
+ if (IS_PCI_VGA(&PciIoDevice->Pci) &&
+ (PciIoDevice->Attributes &
(EFI_PCI_IO_ATTRIBUTE_VGA_MEMORY |
EFI_PCI_IO_ATTRIBUTE_VGA_IO |
EFI_PCI_IO_ATTRIBUTE_VGA_IO_16)) != 0) {
- return Temp;
+ return PciIoDevice;
}
- if (IS_PCI_BRIDGE (&Temp->Pci)) {
+ if (IS_PCI_BRIDGE (&PciIoDevice->Pci)) {
- Temp = ActiveVGADeviceOnTheRootBridge (Temp);
+ PciIoDevice = LocateVgaDevice (PciIoDevice);
- if (Temp != NULL) {
- return Temp;
+ if (PciIoDevice != NULL) {
+ return PciIoDevice;
}
}
@@ -1060,6 +1060,3 @@ ActiveVGADeviceOnTheRootBridge (
return NULL;
}
-
-
-
diff --git a/MdeModulePkg/Bus/Pci/PciBusDxe/PciDeviceSupport.h b/MdeModulePkg/Bus/Pci/PciBusDxe/PciDeviceSupport.h
index c282381f85..1ec2178a21 100644
--- a/MdeModulePkg/Bus/Pci/PciBusDxe/PciDeviceSupport.h
+++ b/MdeModulePkg/Bus/Pci/PciBusDxe/PciDeviceSupport.h
@@ -1,7 +1,7 @@
/** @file
Supporting functions declaration for PCI devices management.
-Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -243,16 +243,16 @@ ActiveVGADeviceOnTheSameSegment (
);
/**
- Get the active VGA device on the root bridge.
+ Locate the active VGA device under the bridge.
- @param RootBridge PCI IO instance for the root bridge.
+ @param Bridge PCI IO instance for the bridge.
@return The active VGA device.
**/
PCI_IO_DEVICE *
-ActiveVGADeviceOnTheRootBridge (
- IN PCI_IO_DEVICE *RootBridge
+LocateVgaDevice (
+ IN PCI_IO_DEVICE *Bridge
);