summaryrefslogtreecommitdiff
path: root/EdkModulePkg/Bus/Pci/PciBus
diff options
context:
space:
mode:
Diffstat (limited to 'EdkModulePkg/Bus/Pci/PciBus')
-rw-r--r--EdkModulePkg/Bus/Pci/PciBus/Dxe/PciCommand.c4
-rw-r--r--EdkModulePkg/Bus/Pci/PciBus/Dxe/PciEnumeratorSupport.c5
-rw-r--r--EdkModulePkg/Bus/Pci/PciBus/Dxe/PciIo.c13
-rw-r--r--EdkModulePkg/Bus/Pci/PciBus/Dxe/PciLib.c3
-rw-r--r--EdkModulePkg/Bus/Pci/PciBus/Dxe/PciOptionRomSupport.c2
-rw-r--r--EdkModulePkg/Bus/Pci/PciBus/Dxe/PciResourceSupport.c35
-rw-r--r--EdkModulePkg/Bus/Pci/PciBus/Dxe/PciRomTable.c4
7 files changed, 35 insertions, 31 deletions
diff --git a/EdkModulePkg/Bus/Pci/PciBus/Dxe/PciCommand.c b/EdkModulePkg/Bus/Pci/PciBus/Dxe/PciCommand.c
index f07c73fd3f..6b472448d9 100644
--- a/EdkModulePkg/Bus/Pci/PciBus/Dxe/PciCommand.c
+++ b/EdkModulePkg/Bus/Pci/PciBus/Dxe/PciCommand.c
@@ -71,9 +71,9 @@ Returns:
}
if (Operation == EFI_ENABLE_REGISTER) {
- OldCommand |= Command;
+ OldCommand = (UINT16) (OldCommand | Command);
} else if (Operation == EFI_DISABLE_REGISTER) {
- OldCommand &= ~(Command);
+ OldCommand = (UINT16) (OldCommand & ~(Command));
} else {
OldCommand = Command;
}
diff --git a/EdkModulePkg/Bus/Pci/PciBus/Dxe/PciEnumeratorSupport.c b/EdkModulePkg/Bus/Pci/PciBus/Dxe/PciEnumeratorSupport.c
index ce605cc813..3b796a6b42 100644
--- a/EdkModulePkg/Bus/Pci/PciBus/Dxe/PciEnumeratorSupport.c
+++ b/EdkModulePkg/Bus/Pci/PciBus/Dxe/PciEnumeratorSupport.c
@@ -969,6 +969,7 @@ Returns:
}
+STATIC
EFI_STATUS
ProcessOptionRomLight (
IN PCI_IO_DEVICE *PciIoDevice
@@ -1432,7 +1433,6 @@ Returns:
// TODO: BarIndex - add argument and description to function comment
{
UINT32 Value;
- UINT64 BarValue64;
UINT32 OriginalValue;
UINT32 Mask;
UINT32 Data;
@@ -1441,7 +1441,6 @@ Returns:
OriginalValue = 0;
Value = 0;
- BarValue64 = 0;
Status = BarExisted (
PciIoDevice,
@@ -1491,7 +1490,7 @@ Returns:
// Need to treat it as no-bar
//
if (PciIoDevice->PciBar[BarIndex].Length == 0) {
- PciIoDevice->PciBar[BarIndex].BarType = 0;
+ PciIoDevice->PciBar[BarIndex].BarType = (PCI_BAR_TYPE) 0;
}
PciIoDevice->PciBar[BarIndex].Prefetchable = FALSE;
diff --git a/EdkModulePkg/Bus/Pci/PciBus/Dxe/PciIo.c b/EdkModulePkg/Bus/Pci/PciBus/Dxe/PciIo.c
index 040c57095d..a636d4ff2c 100644
--- a/EdkModulePkg/Bus/Pci/PciBus/Dxe/PciIo.c
+++ b/EdkModulePkg/Bus/Pci/PciBus/Dxe/PciIo.c
@@ -184,7 +184,7 @@ Returns:
Count = 1;
}
- Width &= 0x03;
+ Width = (EFI_PCI_IO_PROTOCOL_WIDTH) (Width & 0x03);
if ((*Offset + Count * (UINTN)(1 << Width)) - 1 >= PciIoDevice->PciBar[BarIndex].Length) {
return EFI_INVALID_PARAMETER;
@@ -233,7 +233,7 @@ Returns:
//
// If Width is EfiPciIoWidthFillUintX then convert to EfiPciIoWidthUintX
//
- Width &= 0x03;
+ Width = (EFI_PCI_IO_PROTOCOL_WIDTH) (Width & 0x03);
if (PciIoDevice->IsPciExp) {
if ((*Offset + Count * (UINTN)(1 << Width)) - 1 >= PCI_EXP_MAX_CONFIG_OFFSET) {
@@ -876,7 +876,7 @@ Returns:
}
if (PciIoDevice->Attributes & EFI_PCI_IO_ATTRIBUTE_DUAL_ADDRESS_CYCLE) {
- Operation = Operation + EfiPciOperationBusMasterRead64;
+ Operation = (EFI_PCI_IO_PROTOCOL_OPERATION) (Operation + EfiPciOperationBusMasterRead64);
}
Status = PciIoDevice->PciRootBridgeIo->Map (
@@ -1966,10 +1966,15 @@ Returns:
// TODO: PciDevice1 - add argument and description to function comment
// TODO: PciDevice2 - add argument and description to function comment
{
+ BOOLEAN Existed1;
+ BOOLEAN Existed2;
if (PciDevice1->Parent == PciDevice2->Parent) {
return TRUE;
}
- return (PciDeviceExisted (PciDevice1->Parent, PciDevice2)|| PciDeviceExisted (PciDevice2->Parent, PciDevice1));
+ Existed1 = PciDeviceExisted (PciDevice1->Parent, PciDevice2);
+ Existed2 = PciDeviceExisted (PciDevice2->Parent, PciDevice1);
+
+ return (BOOLEAN) (Existed1 || Existed2);
}
diff --git a/EdkModulePkg/Bus/Pci/PciBus/Dxe/PciLib.c b/EdkModulePkg/Bus/Pci/PciBus/Dxe/PciLib.c
index a4d3577d35..c9c46b3adf 100644
--- a/EdkModulePkg/Bus/Pci/PciBus/Dxe/PciLib.c
+++ b/EdkModulePkg/Bus/Pci/PciBus/Dxe/PciLib.c
@@ -94,6 +94,7 @@ Returns:
EFI_NATIVE_INTERFACE,
NULL
);
+ ASSERT_EFI_ERROR (Status);
}
}
@@ -1446,7 +1447,7 @@ Returns:
SecondBus = 0;
Register = 0;
State = 0;
- Attributes = 0;
+ Attributes = (EFI_HPC_PADDING_ATTRIBUTES) 0;
BusRange = 0;
ResetAllPpbBusReg (Bridge, StartBusNumber);
diff --git a/EdkModulePkg/Bus/Pci/PciBus/Dxe/PciOptionRomSupport.c b/EdkModulePkg/Bus/Pci/PciBus/Dxe/PciOptionRomSupport.c
index 449d0dc443..2ced4acb0b 100644
--- a/EdkModulePkg/Bus/Pci/PciBus/Dxe/PciOptionRomSupport.c
+++ b/EdkModulePkg/Bus/Pci/PciBus/Dxe/PciOptionRomSupport.c
@@ -151,7 +151,6 @@ Returns:
UINT16 OffsetPcir;
UINT32 RomBarOffset;
UINT32 RomBar;
- UINT64 Temp;
EFI_STATUS retStatus;
BOOLEAN FirstCheck;
UINT8 *Image;
@@ -167,7 +166,6 @@ Returns:
Indicator = 0;
RomImageSize = 0;
RomInMemory = NULL;
- Temp = 0;
CodeType = 0xFF;
//
diff --git a/EdkModulePkg/Bus/Pci/PciBus/Dxe/PciResourceSupport.c b/EdkModulePkg/Bus/Pci/PciBus/Dxe/PciResourceSupport.c
index 58dbc9fd4c..482ddc9274 100644
--- a/EdkModulePkg/Bus/Pci/PciBus/Dxe/PciResourceSupport.c
+++ b/EdkModulePkg/Bus/Pci/PciBus/Dxe/PciResourceSupport.c
@@ -647,10 +647,8 @@ Returns:
// TODO: ResType - add argument and description to function comment
// TODO: ResUsage - add argument and description to function comment
{
- EFI_STATUS Status;
PCI_RESOURCE_NODE *Node;
- Status = 0;
Node = NULL;
Node = AllocatePool (sizeof (PCI_RESOURCE_NODE));
@@ -704,7 +702,6 @@ Returns:
// TODO: EFI_SUCCESS - add return value to function comment
{
PCI_IO_DEVICE *Temp;
- EFI_STATUS Status;
PCI_RESOURCE_NODE *IoBridge;
PCI_RESOURCE_NODE *Mem32Bridge;
PCI_RESOURCE_NODE *PMem32Bridge;
@@ -789,14 +786,14 @@ Returns:
//
// Recursively create resouce map on this bridge
//
- Status = CreateResourceMap (
- Temp,
- IoBridge,
- Mem32Bridge,
- PMem32Bridge,
- Mem64Bridge,
- PMem64Bridge
- );
+ CreateResourceMap (
+ Temp,
+ IoBridge,
+ Mem32Bridge,
+ PMem32Bridge,
+ Mem64Bridge,
+ PMem64Bridge
+ );
if (ResourceRequestExisted (IoBridge)) {
InsertResourceNode (
@@ -895,14 +892,14 @@ Returns:
//
// To do some platform specific resource padding ...
//
- Status = ResourcePaddingPolicy (
- Bridge,
- IoNode,
- Mem32Node,
- PMem32Node,
- Mem64Node,
- PMem64Node
- );
+ ResourcePaddingPolicy (
+ Bridge,
+ IoNode,
+ Mem32Node,
+ PMem32Node,
+ Mem64Node,
+ PMem64Node
+ );
//
// Degrade resource if necessary
diff --git a/EdkModulePkg/Bus/Pci/PciBus/Dxe/PciRomTable.c b/EdkModulePkg/Bus/Pci/PciBus/Dxe/PciRomTable.c
index a1e16a0eea..8f5a450d75 100644
--- a/EdkModulePkg/Bus/Pci/PciBus/Dxe/PciRomTable.c
+++ b/EdkModulePkg/Bus/Pci/PciBus/Dxe/PciRomTable.c
@@ -101,6 +101,7 @@ Returns:
mNumberOfPciRomImages++;
}
+STATIC
VOID
HexToString (
CHAR16 *String,
@@ -134,6 +135,8 @@ Returns:
}
}
}
+
+STATIC
EFI_STATUS
PciRomLoadEfiDriversFromRomImage (
IN EFI_DRIVER_BINDING_PROTOCOL *This,
@@ -307,6 +310,7 @@ Returns:
return retStatus;
}
+STATIC
EFI_STATUS
PciRomLoadEfiDriversFromOptionRomTable (
IN EFI_DRIVER_BINDING_PROTOCOL *This,