summaryrefslogtreecommitdiff
path: root/EdkModulePkg
diff options
context:
space:
mode:
authorvanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524>2007-04-17 13:31:47 +0000
committervanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524>2007-04-17 13:31:47 +0000
commitcaecffd105b6cbd5e5f6f09c3200df205e0a0a12 (patch)
tree7ecfea47e930491aac8cb8ab294998b6d3c1e8a1 /EdkModulePkg
parent9035a497440577b1bd199f055ce8a0542884ffa2 (diff)
downloadedk2-platforms-caecffd105b6cbd5e5f6f09c3200df205e0a0a12.tar.xz
1. Fixed one bug in UpdateDataCheck().
2. Reduce one time notify function calling. 3. Fix comments bug in resources degrade function. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@2573 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'EdkModulePkg')
-rw-r--r--EdkModulePkg/Bus/Pci/PciBus/Dxe/PciLib.c40
-rw-r--r--EdkModulePkg/Bus/Pci/PciBus/Dxe/PciResourceSupport.c2
2 files changed, 24 insertions, 18 deletions
diff --git a/EdkModulePkg/Bus/Pci/PciBus/Dxe/PciLib.c b/EdkModulePkg/Bus/Pci/PciBus/Dxe/PciLib.c
index 1296836a30..1601a4d617 100644
--- a/EdkModulePkg/Bus/Pci/PciBus/Dxe/PciLib.c
+++ b/EdkModulePkg/Bus/Pci/PciBus/Dxe/PciLib.c
@@ -1892,13 +1892,12 @@ Returns:
//
}
- if (FeaturePcdGet (PcdPciBusHotplugDeviceSupport)) {
-
- //
- // Notify the bus allocation phase is finished for the first time
- //
- NotifyPhase (PciResAlloc, EfiPciHostBridgeEndBusAllocation);
+ //
+ // Notify the bus allocation phase is finished for the first time
+ //
+ NotifyPhase (PciResAlloc, EfiPciHostBridgeEndBusAllocation);
+ if (FeaturePcdGet (PcdPciBusHotplugDeviceSupport)) {
if (gPciHotPlugInit != NULL) {
//
@@ -1944,15 +1943,10 @@ Returns:
}
//
- // Notify the bus allocation phase is to end
+ // Notify the bus allocation phase is to end for the 2nd time
//
NotifyPhase (PciResAlloc, EfiPciHostBridgeEndBusAllocation);
}
- } else {
- //
- // Notify the bus allocation phase is to end
- //
- NotifyPhase (PciResAlloc, EfiPciHostBridgeEndBusAllocation);
}
//
@@ -2215,7 +2209,9 @@ UpdateConfigData (
{
EFI_STATUS Status;
EFI_PCI_REGISTER_VALUE_DATA *PciRegisterData;
- UINT64 TempValue;
+ UINT32 AndValue;
+ UINT32 OrValue;
+ UINT32 TempValue;
//
// check register value incompatibility
@@ -2224,17 +2220,27 @@ UpdateConfigData (
if (Status == EFI_SUCCESS) {
+ AndValue = ((UINT32) PciRegisterData->AndValue) >> (((UINT8) Address & 0x3) * 8);
+ OrValue = ((UINT32) PciRegisterData->OrValue) >> (((UINT8) Address & 0x3) * 8);
+
TempValue = * (UINT32 *) Buffer;
+ if (PciRegisterData->AndValue != VALUE_NOCARE) {
+ TempValue &= AndValue;
+ }
+ if (PciRegisterData->OrValue != VALUE_NOCARE) {
+ TempValue |= OrValue;
+ }
switch (Width) {
case EfiPciWidthUint8:
- * (UINT8 *) Buffer = (UINT8) TempValue;
+ *(UINT8 *)Buffer = (UINT8) TempValue;
break;
+
case EfiPciWidthUint16:
- * (UINT16 *) Buffer = (UINT16) TempValue;
+ *(UINT16 *)Buffer = (UINT16) TempValue;
break;
case EfiPciWidthUint32:
- * (UINT32 *) Buffer = (UINT32) TempValue;
+ *(UINT32 *)Buffer = TempValue;
break;
default:
@@ -2366,7 +2372,7 @@ WriteConfigData (
return Status;
}
- Data = Data >> ((1 << AccessWidth) * 8);
+ Data = RShiftU64 (Data, ((1 << AccessWidth) * 8));
Stride = 1 << AccessWidth;
AccessAddress += Stride;
diff --git a/EdkModulePkg/Bus/Pci/PciBus/Dxe/PciResourceSupport.c b/EdkModulePkg/Bus/Pci/PciBus/Dxe/PciResourceSupport.c
index cd781841a1..a6ae80f4c5 100644
--- a/EdkModulePkg/Bus/Pci/PciBus/Dxe/PciResourceSupport.c
+++ b/EdkModulePkg/Bus/Pci/PciBus/Dxe/PciResourceSupport.c
@@ -1010,7 +1010,7 @@ Returns:
//
// If bridge doesn't support Prefetchable
- // memory64, degrade it to Mem64
+ // memory64, degrade it to Prefetchable memory32
//
if (!BridgeSupportResourceDecode (Bridge, EFI_BRIDGE_PMEM64_DECODE_SUPPORTED)) {
MergeResourceTree (