]> git.proxmox.com Git - mirror_edk2.git/commitdiff
1. Fixed one bug in UpdateDataCheck().
authorvanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 17 Apr 2007 13:31:47 +0000 (13:31 +0000)
committervanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 17 Apr 2007 13:31:47 +0000 (13:31 +0000)
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

EdkModulePkg/Bus/Pci/PciBus/Dxe/PciLib.c
EdkModulePkg/Bus/Pci/PciBus/Dxe/PciResourceSupport.c

index 1296836a3089592868fd1055f8195671fb455552..1601a4d61703698f5b63e63bc227ed4bc1dac913 100644 (file)
@@ -1892,13 +1892,12 @@ Returns:
     //\r
   }\r
 \r
-  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
 \r
+  if (FeaturePcdGet (PcdPciBusHotplugDeviceSupport)) {\r
 \r
     if (gPciHotPlugInit != NULL) {\r
       //\r
@@ -1944,15 +1943,10 @@ Returns:
       }\r
 \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
-  } else {\r
-    //\r
-    // Notify the bus allocation phase is to end\r
-    //\r
-    NotifyPhase (PciResAlloc, EfiPciHostBridgeEndBusAllocation);\r
   }\r
 \r
   //\r
@@ -2215,7 +2209,9 @@ UpdateConfigData (
 {\r
   EFI_STATUS                    Status;\r
   EFI_PCI_REGISTER_VALUE_DATA   *PciRegisterData;\r
-  UINT64                        TempValue;\r
+  UINT32                        AndValue;\r
+  UINT32                        OrValue;\r
+  UINT32                        TempValue;\r
 \r
   //\r
   // check register value incompatibility\r
@@ -2224,17 +2220,27 @@ UpdateConfigData (
 \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
+    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
-      * (UINT8 *) Buffer = (UINT8) TempValue;\r
+      *(UINT8 *)Buffer = (UINT8) TempValue;\r
       break;\r
+\r
     case EfiPciWidthUint16:\r
-      * (UINT16 *) Buffer = (UINT16) TempValue;\r
+      *(UINT16 *)Buffer = (UINT16) TempValue;\r
       break;\r
     case EfiPciWidthUint32:\r
-      * (UINT32 *) Buffer = (UINT32) TempValue;\r
+      *(UINT32 *)Buffer = TempValue;\r
       break;\r
 \r
     default:\r
@@ -2366,7 +2372,7 @@ WriteConfigData (
           return Status;\r
         }\r
 \r
-        Data = Data >> ((1 << AccessWidth) * 8);\r
+        Data = RShiftU64 (Data, ((1 << AccessWidth) * 8));\r
 \r
         Stride = 1 << AccessWidth;\r
         AccessAddress += Stride;\r
index cd781841a1f10d32070560cae299863c9586a131..a6ae80f4c5939e6692de7f5dee4536e831cbb744 100644 (file)
@@ -1010,7 +1010,7 @@ Returns:
 \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