]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/PcatSingleSegmentPciCfg2Pei/PciCfg2.c
1. Sync the latest network stack. Add NetLibCreateIPv4DPathNode () in netlib library.
[mirror_edk2.git] / MdeModulePkg / Universal / PcatSingleSegmentPciCfg2Pei / PciCfg2.c
index 3542bdd6465c9af93bd29b8e8b9f1a74c7f5a66c..bf1fb2d88768357f22fd193fa58148d87854589e 100644 (file)
@@ -20,7 +20,7 @@
 #include <Library/PciLib.h>\r
 #include <Library/PeimEntryPoint.h>\r
 \r
-#include <IndustryStandard\Pci.h>\r
+#include <IndustryStandard/Pci.h>\r
 \r
 /**\r
    Convert EFI_PEI_PCI_CFG_PPI_PCI_ADDRESS to PCI_LIB_ADDRESS.\r
@@ -327,16 +327,24 @@ PciCfg2Modify (
   IN CONST  VOID                      *ClearBits\r
 )\r
 {\r
-  UINTN  PciLibAddress;\r
+  UINTN   PciLibAddress;\r
+  UINT16  ClearValue16;\r
+  UINT16  SetValue16;\r
+  UINT32  ClearValue32;\r
+  UINT32  SetValue32;\r
 \r
   PciLibAddress = PciCfgAddressConvert ((EFI_PEI_PCI_CFG_PPI_PCI_ADDRESS *) &Address);\r
 \r
   if (Width == EfiPeiPciCfgWidthUint8) {\r
-    PciAndThenOr8 (PciLibAddress, ~(*(UINT8 *)ClearBits), *((UINT8 *) SetBits));\r
+    PciAndThenOr8 (PciLibAddress, (UINT8) (~(*(UINT8 *) ClearBits)), *((UINT8 *) SetBits));\r
   } else if (Width == EfiPeiPciCfgWidthUint16) {\r
-    PciAndThenOr16 (PciLibAddress, ~ReadUnaligned16 ((UINT16 *) ClearBits), ReadUnaligned16 ((UINT16 *) SetBits));\r
+    ClearValue16  = (UINT16) (~ReadUnaligned16 ((UINT16 *) ClearBits));\r
+    SetValue16    = ReadUnaligned16 ((UINT16 *) SetBits);\r
+    PciAndThenOr16 (PciLibAddress, ClearValue16, SetValue16);\r
   } else if (Width == EfiPeiPciCfgWidthUint32) {\r
-    PciAndThenOr32 (PciLibAddress, ~ReadUnaligned32 ((UINT32 *) ClearBits), ReadUnaligned32 ((UINT32 *) SetBits));\r
+    ClearValue32  = (UINT32) (~ReadUnaligned32 ((UINT32 *) ClearBits));\r
+    SetValue32    = ReadUnaligned32 ((UINT32 *) SetBits);\r
+    PciAndThenOr32 (PciLibAddress, ClearValue32, SetValue32);\r
   } else {\r
     return EFI_INVALID_PARAMETER;\r
   }\r