]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Fix bug: The lower 2 bits of Width and stripped, Count will always be multiplied...
authorvanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524>
Fri, 12 Nov 2010 02:10:21 +0000 (02:10 +0000)
committervanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524>
Fri, 12 Nov 2010 02:10:21 +0000 (02:10 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11043 6f19259b-4bc3-4df7-8a09-765794883524

MdeModulePkg/Bus/Pci/PciBusDxe/PciIo.c

index 3fa985f567caeafd59e2874492a5382292a2786f..86c9135afd6929b6a1e34afe2e70403f4f9379d7 100644 (file)
@@ -451,8 +451,8 @@ PciIoMemRead (
   //  \r
   if (FeaturePcdGet (PcdUnalignedPciIoEnable)) {\r
     if ((Offset & ((1 << (Width & 0x03)) - 1)) != 0) {\r
-      Width = (EFI_PCI_IO_PROTOCOL_WIDTH) (Width & (~0x03));\r
       Count *=  (UINTN)(1 << (Width & 0x03));\r
+      Width = (EFI_PCI_IO_PROTOCOL_WIDTH) (Width & (~0x03));\r
     }\r
   }  \r
   \r
@@ -526,8 +526,8 @@ PciIoMemWrite (
   //  \r
   if (FeaturePcdGet (PcdUnalignedPciIoEnable)) {\r
     if ((Offset & ((1 << (Width & 0x03)) - 1)) != 0) {\r
-      Width = (EFI_PCI_IO_PROTOCOL_WIDTH) (Width & (~0x03));\r
       Count *=  (UINTN)(1 << (Width & 0x03));\r
+      Width = (EFI_PCI_IO_PROTOCOL_WIDTH) (Width & (~0x03));\r
     }\r
   }\r
 \r
@@ -600,8 +600,8 @@ PciIoIoRead (
   //  \r
   if (FeaturePcdGet (PcdUnalignedPciIoEnable)) {\r
     if ((Offset & ((1 << (Width & 0x03)) - 1)) != 0) {\r
-      Width = (EFI_PCI_IO_PROTOCOL_WIDTH) (Width & (~0x03));\r
       Count *=  (UINTN)(1 << (Width & 0x03));\r
+      Width = (EFI_PCI_IO_PROTOCOL_WIDTH) (Width & (~0x03));\r
     }\r
   }    \r
 \r
@@ -674,8 +674,8 @@ PciIoIoWrite (
   //  \r
   if (FeaturePcdGet (PcdUnalignedPciIoEnable)) {\r
     if ((Offset & ((1 << (Width & 0x03)) - 1)) != 0) {\r
-      Width = (EFI_PCI_IO_PROTOCOL_WIDTH) (Width & (~0x03));\r
       Count *=  (UINTN)(1 << (Width & 0x03));\r
+      Width = (EFI_PCI_IO_PROTOCOL_WIDTH) (Width & (~0x03));\r
     }\r
   }  \r
 \r
@@ -739,8 +739,8 @@ PciIoConfigRead (
   //  \r
   if (FeaturePcdGet (PcdUnalignedPciIoEnable)) {\r
     if ((Offset & ((1 << (Width & 0x03)) - 1)) != 0) {\r
-      Width = (EFI_PCI_IO_PROTOCOL_WIDTH) (Width & (~0x03));\r
       Count *=  (UINTN)(1 << (Width & 0x03));\r
+      Width = (EFI_PCI_IO_PROTOCOL_WIDTH) (Width & (~0x03));\r
     }\r
   }    \r
 \r
@@ -804,8 +804,8 @@ PciIoConfigWrite (
   //  \r
   if (FeaturePcdGet (PcdUnalignedPciIoEnable)) {\r
     if ((Offset & ((1 << (Width & 0x03)) - 1)) != 0) {\r
-      Width = (EFI_PCI_IO_PROTOCOL_WIDTH) (Width & (~0x03));\r
       Count *=  (UINTN)(1 << (Width & 0x03));\r
+      Width = (EFI_PCI_IO_PROTOCOL_WIDTH) (Width & (~0x03));\r
     }\r
   }  \r
   \r
@@ -899,8 +899,8 @@ PciIoCopyMem (
   //  \r
   if (FeaturePcdGet (PcdUnalignedPciIoEnable)) {\r
     if ((SrcOffset & ((1 << (Width & 0x03)) - 1)) != 0 || (DestOffset & ((1 << (Width & 0x03)) - 1)) != 0) {\r
-      Width = (EFI_PCI_IO_PROTOCOL_WIDTH) (Width & (~0x03));\r
       Count *=  (UINTN)(1 << (Width & 0x03));\r
+      Width = (EFI_PCI_IO_PROTOCOL_WIDTH) (Width & (~0x03));\r
     }\r
   }  \r
 \r