]> git.proxmox.com Git - mirror_edk2.git/blobdiff - EdkModulePkg/Bus/Pci/PciBus/Dxe/PciEnumeratorSupport.c
Partially make EdkModulePkg pass intel IPF compiler with /W4 /WX switched on.
[mirror_edk2.git] / EdkModulePkg / Bus / Pci / PciBus / Dxe / PciEnumeratorSupport.c
index 2c548979532b9d83c23e4b5c426be1eb879f5e82..3b796a6b42822364e2f2a0e39effba14e4802fa5 100644 (file)
@@ -21,7 +21,7 @@ Revision History
 \r
 --*/\r
 \r
-#include "Pcibus.h"\r
+#include "pcibus.h"\r
 #include "PciEnumeratorSupport.h"\r
 #include "PciCommand.h"\r
 #include "PciIo.h"\r
@@ -394,7 +394,7 @@ Returns:
   //\r
   if (gFullEnumeration) {\r
 \r
-    PciSetCommandRegister (PciIoDevice, 0);\r
+    PciDisableCommandRegister (PciIoDevice, EFI_PCI_COMMAND_BITS_OWNED);\r
 \r
   }\r
 \r
@@ -462,12 +462,12 @@ Returns:
     );\r
 \r
   if (gFullEnumeration) {\r
-    PciSetCommandRegister (PciIoDevice, 0);\r
+    PciDisableCommandRegister (PciIoDevice, EFI_PCI_COMMAND_BITS_OWNED);\r
 \r
     //\r
     // Initalize the bridge control register\r
     //\r
-    PciSetBridgeControlRegister (PciIoDevice, 0);\r
+    PciDisableBridgeControlRegister (PciIoDevice, EFI_PCI_BRIDGE_CONTROL_BITS_OWNED);\r
 \r
   }\r
 \r
@@ -586,12 +586,12 @@ Returns:
     );\r
 \r
   if (gFullEnumeration) {\r
-    PciSetCommandRegister (PciIoDevice, 0);\r
+    PciDisableCommandRegister (PciIoDevice, EFI_PCI_COMMAND_BITS_OWNED);\r
 \r
     //\r
     // Initalize the bridge control register\r
     //\r
-    PciSetBridgeControlRegister (PciIoDevice, 0);\r
+    PciDisableBridgeControlRegister (PciIoDevice, EFI_PCCARD_BRIDGE_CONTROL_BITS_OWNED);\r
 \r
   }\r
   //\r
@@ -871,6 +871,11 @@ Returns:
     Attributes |= EFI_PCI_IO_ATTRIBUTE_VGA_PALETTE_IO;\r
   }\r
 \r
+  if (BridgeControl & EFI_PCI_BRIDGE_CONTROL_VGA_16) {\r
+    Attributes |= EFI_PCI_IO_ATTRIBUTE_VGA_IO_16;\r
+    Attributes |= EFI_PCI_IO_ATTRIBUTE_VGA_PALETTE_IO_16;\r
+  }\r
+\r
   if (Option == EFI_SET_SUPPORTS) {\r
 \r
     Attributes |= EFI_PCI_IO_ATTRIBUTE_MEMORY_WRITE_COMBINE | \r
@@ -964,6 +969,7 @@ Returns:
 \r
 }\r
 \r
+STATIC\r
 EFI_STATUS\r
 ProcessOptionRomLight (\r
   IN PCI_IO_DEVICE                      *PciIoDevice\r
@@ -1066,7 +1072,7 @@ Returns:
               EFI_PCI_COMMAND_BUS_MASTER   |\r
               EFI_PCI_COMMAND_VGA_PALETTE_SNOOP;\r
 \r
-    BridgeControl = EFI_PCI_BRIDGE_CONTROL_ISA | EFI_PCI_BRIDGE_CONTROL_VGA;\r
+    BridgeControl = EFI_PCI_BRIDGE_CONTROL_ISA | EFI_PCI_BRIDGE_CONTROL_VGA | EFI_PCI_BRIDGE_CONTROL_VGA_16;\r
 \r
     //\r
     // Test whether the device can support attributes above\r
@@ -1427,7 +1433,6 @@ Returns:
 // TODO:    BarIndex - add argument and description to function comment\r
 {\r
   UINT32      Value;\r
-  UINT64      BarValue64;\r
   UINT32      OriginalValue;\r
   UINT32      Mask;\r
   UINT32      Data;\r
@@ -1436,7 +1441,6 @@ Returns:
 \r
   OriginalValue = 0;\r
   Value         = 0;\r
-  BarValue64    = 0;\r
 \r
   Status = BarExisted (\r
             PciIoDevice,\r
@@ -1486,7 +1490,7 @@ Returns:
     // Need to treat it as no-bar\r
     //\r
     if (PciIoDevice->PciBar[BarIndex].Length == 0) {\r
-      PciIoDevice->PciBar[BarIndex].BarType = 0;\r
+      PciIoDevice->PciBar[BarIndex].BarType = (PCI_BAR_TYPE) 0;\r
     }\r
 \r
     PciIoDevice->PciBar[BarIndex].Prefetchable  = FALSE;\r