}\r
}\r
\r
+ //\r
+ // if PcdPciBridgeIoAlignmentProbe is TRUE, PCI bus driver probes\r
+ // PCI bridge supporting non-stardard I/O window alignment less than 4K.\r
+ //\r
+\r
+ PciIoDevice->BridgeIoAlignment = 0xFFF;\r
+ if (FeaturePcdGet (PcdPciBridgeIoAlignmentProbe)) {\r
+ //\r
+ // Check any bits of bit 3-1 of I/O Base Register are writable.\r
+ // if so, it is assumed non-stardard I/O window alignment is supported by this bridge.\r
+ // Per spec, bit 3-1 of I/O Base Register are reserved bits, so its content can't be assumed.\r
+ //\r
+ Value = Temp ^ (BIT3 | BIT2 | BIT1);\r
+ PciIo->Pci.Write (PciIo, EfiPciIoWidthUint8, 0x1C, 1, &Value);\r
+ PciIo->Pci.Read (PciIo, EfiPciIoWidthUint8, 0x1C, 1, &Value);\r
+ PciIo->Pci.Write (PciIo, EfiPciIoWidthUint8, 0x1C, 1, &Temp);\r
+ Value = (Value ^ Temp) & (BIT3 | BIT2 | BIT1);\r
+ switch (Value) {\r
+ case BIT3:\r
+ PciIoDevice->BridgeIoAlignment = 0x7FF;\r
+ break;\r
+ case BIT3 | BIT2:\r
+ PciIoDevice->BridgeIoAlignment = 0x3FF;\r
+ break;\r
+ case BIT3 | BIT2 | BIT1:\r
+ PciIoDevice->BridgeIoAlignment = 0x1FF;\r
+ break;\r
+ }\r
+ }\r
+\r
Status = BarExisted (\r
PciIoDevice,\r
0x24,\r