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
- if (FeaturePcdGet (PcdPciBusHotplugDeviceSupport)) {\r
-\r
- //\r
- // Notify the bus allocation phase is finished for the first time\r
- //\r
- NotifyPhase (PciResAlloc, EfiPciHostBridgeEndBusAllocation);\r
+ //\r
+ // Notify the bus allocation phase is finished for the first time\r
+ //\r
+ NotifyPhase (PciResAlloc, EfiPciHostBridgeEndBusAllocation);\r
+ if (FeaturePcdGet (PcdPciBusHotplugDeviceSupport)) {\r
\r
if (gPciHotPlugInit != NULL) {\r
//\r
\r
if (gPciHotPlugInit != NULL) {\r
//\r
- // Notify the bus allocation phase is to end\r
+ // Notify the bus allocation phase is to end for the 2nd time\r
//\r
NotifyPhase (PciResAlloc, EfiPciHostBridgeEndBusAllocation);\r
}\r
//\r
NotifyPhase (PciResAlloc, EfiPciHostBridgeEndBusAllocation);\r
}\r
- } else {\r
- //\r
- // Notify the bus allocation phase is to end\r
- //\r
- NotifyPhase (PciResAlloc, EfiPciHostBridgeEndBusAllocation);\r
{\r
EFI_STATUS Status;\r
EFI_PCI_REGISTER_VALUE_DATA *PciRegisterData;\r
{\r
EFI_STATUS Status;\r
EFI_PCI_REGISTER_VALUE_DATA *PciRegisterData;\r
+ UINT32 AndValue;\r
+ UINT32 OrValue;\r
+ UINT32 TempValue;\r
\r
//\r
// check register value incompatibility\r
\r
//\r
// check register value incompatibility\r
\r
if (Status == EFI_SUCCESS) {\r
\r
\r
if (Status == EFI_SUCCESS) {\r
\r
+ AndValue = ((UINT32) PciRegisterData->AndValue) >> (((UINT8) Address & 0x3) * 8);\r
+ OrValue = ((UINT32) PciRegisterData->OrValue) >> (((UINT8) Address & 0x3) * 8);\r
+\r
TempValue = * (UINT32 *) Buffer;\r
TempValue = * (UINT32 *) Buffer;\r
+ if (PciRegisterData->AndValue != VALUE_NOCARE) {\r
+ TempValue &= AndValue;\r
+ }\r
+ if (PciRegisterData->OrValue != VALUE_NOCARE) {\r
+ TempValue |= OrValue;\r
+ }\r
\r
switch (Width) {\r
case EfiPciWidthUint8:\r
\r
switch (Width) {\r
case EfiPciWidthUint8:\r
- * (UINT8 *) Buffer = (UINT8) TempValue;\r
+ *(UINT8 *)Buffer = (UINT8) TempValue;\r
case EfiPciWidthUint16:\r
case EfiPciWidthUint16:\r
- * (UINT16 *) Buffer = (UINT16) TempValue;\r
+ *(UINT16 *)Buffer = (UINT16) TempValue;\r
break;\r
case EfiPciWidthUint32:\r
break;\r
case EfiPciWidthUint32:\r
- * (UINT32 *) Buffer = (UINT32) TempValue;\r
+ *(UINT32 *)Buffer = TempValue;\r
- Data = Data >> ((1 << AccessWidth) * 8);\r
+ Data = RShiftU64 (Data, ((1 << AccessWidth) * 8));\r
\r
Stride = 1 << AccessWidth;\r
AccessAddress += Stride;\r
\r
Stride = 1 << AccessWidth;\r
AccessAddress += Stride;\r
\r
//\r
// If bridge doesn't support Prefetchable\r
\r
//\r
// If bridge doesn't support Prefetchable\r
- // memory64, degrade it to Mem64\r
+ // memory64, degrade it to Prefetchable memory32\r
//\r
if (!BridgeSupportResourceDecode (Bridge, EFI_BRIDGE_PMEM64_DECODE_SUPPORTED)) {\r
MergeResourceTree (\r
//\r
if (!BridgeSupportResourceDecode (Bridge, EFI_BRIDGE_PMEM64_DECODE_SUPPORTED)) {\r
MergeResourceTree (\r