]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdeModulePkg BaseSerialPortLib16550: Correct MemoryLimit and MemoryBase offset.
authorLiming Gao <liming.gao@intel.com>
Wed, 19 Nov 2014 02:30:21 +0000 (02:30 +0000)
committerlgao4 <lgao4@Edk2>
Wed, 19 Nov 2014 02:30:21 +0000 (02:30 +0000)
Their offset in PCI-to-PCI Bridge Configuration Space.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Michael Kinney <michael.d.kinney@intel.com>
Reviewed-by: Guo Dong <guo.dong@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16402 6f19259b-4bc3-4df7-8a09-765794883524

MdeModulePkg/Library/BaseSerialPortLib16550/BaseSerialPortLib16550.c

index d21c00c5a4ae4fd0251cf9ee585e45abb50286ea..0ade9b231104748d8f5d11d589c84969941dddde 100644 (file)
@@ -244,8 +244,8 @@ GetSerialRegisterBase (
     // Retrieve and verify the I/O or MMIO decode window in the PCI to PCI Bridge\r
     //\r
     if (PcdGetBool (PcdSerialUseMmio)) {\r
-      MemoryLimit = PciRead16 (PciLibAddress + OFFSET_OF (PCI_BRIDGE_CONTROL_REGISTER, MemoryLimit)) & 0xfff0;\r
-      MemoryBase  = PciRead16 (PciLibAddress + OFFSET_OF (PCI_BRIDGE_CONTROL_REGISTER, MemoryBase))  & 0xfff0;\r
+      MemoryLimit = PciRead16 (PciLibAddress + OFFSET_OF (PCI_TYPE01, Bridge.MemoryLimit)) & 0xfff0;\r
+      MemoryBase  = PciRead16 (PciLibAddress + OFFSET_OF (PCI_TYPE01, Bridge.MemoryBase))  & 0xfff0;\r
 \r
       //\r
       // If PCI Bridge MMIO window is disabled, then return 0\r
@@ -263,17 +263,17 @@ GetSerialRegisterBase (
       ParentMemoryBase  = MemoryBase;\r
       ParentMemoryLimit = MemoryLimit;\r
     } else {\r
-      IoLimit = PciRead8 (PciLibAddress + OFFSET_OF (PCI_BRIDGE_CONTROL_REGISTER, IoLimit));\r
+      IoLimit = PciRead8 (PciLibAddress + OFFSET_OF (PCI_TYPE01, Bridge.IoLimit));\r
       if ((IoLimit & PCI_BRIDGE_32_BIT_IO_SPACE ) == 0) {\r
         IoLimit = IoLimit >> 4;\r
       } else {\r
-        IoLimit = (PciRead16 (PciLibAddress + OFFSET_OF (PCI_BRIDGE_CONTROL_REGISTER, IoLimitUpper16)) << 4) | (IoLimit >> 4);\r
+        IoLimit = (PciRead16 (PciLibAddress + OFFSET_OF (PCI_TYPE01, Bridge.IoLimitUpper16)) << 4) | (IoLimit >> 4);\r
       }\r
-      IoBase = PciRead8 (PciLibAddress + OFFSET_OF (PCI_BRIDGE_CONTROL_REGISTER, IoBase));\r
+      IoBase = PciRead8 (PciLibAddress + OFFSET_OF (PCI_TYPE01, Bridge.IoBase));\r
       if ((IoBase & PCI_BRIDGE_32_BIT_IO_SPACE ) == 0) {\r
         IoBase = IoBase >> 4;\r
       } else {\r
-        IoBase = (PciRead16 (PciLibAddress + OFFSET_OF (PCI_BRIDGE_CONTROL_REGISTER, IoBaseUpper16)) << 4) | (IoBase >> 4);\r
+        IoBase = (PciRead16 (PciLibAddress + OFFSET_OF (PCI_TYPE01, Bridge.IoBaseUpper16)) << 4) | (IoBase >> 4);\r
       }\r
       \r
       //\r