diff --git a/EdkModulePkg/Application/HelloWorld/HelloWorld.c b/EdkModulePkg/Application/HelloWorld/HelloWorld.c
index d3714ebca5..18705100be 100644
--- a/EdkModulePkg/Application/HelloWorld/HelloWorld.c
+++ b/EdkModulePkg/Application/HelloWorld/HelloWorld.c
@@ -12,6 +12,7 @@
**/
+STATIC
VOID
Print (
IN CONST CHAR16 *Format,
@@ -27,6 +28,13 @@ Print (
return;
}
+EFI_STATUS
+EFIAPI
+UefiMain (
+ IN EFI_HANDLE ImageHandle,
+ IN EFI_SYSTEM_TABLE *SystemTable
+ );
+
EFI_STATUS
EFIAPI
UefiMain (
diff --git a/EdkModulePkg/Bus/Pci/AtapiPassThru/Dxe/AtapiPassThru.c b/EdkModulePkg/Bus/Pci/AtapiPassThru/Dxe/AtapiPassThru.c
index f11158bb9c..28be3f7026 100644
--- a/EdkModulePkg/Bus/Pci/AtapiPassThru/Dxe/AtapiPassThru.c
+++ b/EdkModulePkg/Bus/Pci/AtapiPassThru/Dxe/AtapiPassThru.c
@@ -45,7 +45,7 @@ static IDE_BASE_REGISTERS gAtapiIoPortRegisters[2] = {
{ 0x170, { 0x171 }, 0x172, 0x173, 0x174, 0x175, 0x176, { 0x177 }, { 0x376 }, 0x377, 0 }
};
-static SCSI_COMMAND_SET gEndTable = { 0xff, 0xff };
+static SCSI_COMMAND_SET gEndTable = { 0xff, (DATA_DIRECTION) 0xff };
///
/// This table contains all the supported ATAPI commands.
@@ -83,7 +83,7 @@ static SCSI_COMMAND_SET gSupportedATAPICommands[] = {
{ OP_WRITE_10, DataOut },
{ OP_WRITE_12, DataOut },
{ OP_WRITE_AND_VERIFY, DataOut },
- { 0xff, 0xff }
+ { 0xff, (DATA_DIRECTION) 0xff }
};
static CHAR16 *gControllerNameString = (CHAR16 *) L"ATAPI Controller";
@@ -595,14 +595,8 @@ AtapiScsiPassThruBuildDevicePath (
IN OUT EFI_DEVICE_PATH_PROTOCOL **DevicePath
)
{
- ATAPI_SCSI_PASS_THRU_DEV *AtapiScsiPrivate;
EFI_DEV_PATH *Node;
- //
- // Retrieve Device Private Data Structure.
- //
- AtapiScsiPrivate = ATAPI_SCSI_PASS_THRU_DEV_FROM_THIS (This);
-
//
// Validate parameters passed in.
//
@@ -995,7 +989,7 @@ SubmitBlockingIoCommand (
PacketCommand,
Packet->DataBuffer,
&(Packet->TransferLength),
- Packet->DataDirection,
+ (DATA_DIRECTION) Packet->DataDirection,
TimeoutInMicroSeconds
);
if (!EFI_ERROR (PacketCommandStatus) || (Packet->SenseData == NULL)) {
@@ -1319,11 +1313,9 @@ AtapiPassThruPioReadWriteData (
//
// get current data transfer size from Cylinder Registers.
//
- WordCount =
- (
- (ReadPortB (AtapiScsiPrivate->PciIo, AtapiScsiPrivate->IoPort->CylinderMsb) << 8) |
- ReadPortB (AtapiScsiPrivate->PciIo, AtapiScsiPrivate->IoPort->CylinderLsb)
- ) & 0xffff;
+ WordCount = ReadPortB (AtapiScsiPrivate->PciIo, AtapiScsiPrivate->IoPort->CylinderMsb) << 8;
+ WordCount = WordCount | ReadPortB (AtapiScsiPrivate->PciIo, AtapiScsiPrivate->IoPort->CylinderLsb);
+ WordCount = WordCount & 0xffff;
WordCount /= 2;
//
diff --git a/EdkModulePkg/Bus/Pci/CirrusLogic/Dxe/CirrusLogic5430UgaDraw.c b/EdkModulePkg/Bus/Pci/CirrusLogic/Dxe/CirrusLogic5430UgaDraw.c
index 60e0582cf0..be05f8766f 100644
--- a/EdkModulePkg/Bus/Pci/CirrusLogic/Dxe/CirrusLogic5430UgaDraw.c
+++ b/EdkModulePkg/Bus/Pci/CirrusLogic/Dxe/CirrusLogic5430UgaDraw.c
@@ -176,6 +176,7 @@ inw (
@retval EFI_SUCCESS TODO: Add description for return value
**/
+STATIC
EFI_STATUS
EFIAPI
CirrusLogic5430UgaDrawGetMode (
@@ -223,6 +224,7 @@ CirrusLogic5430UgaDrawGetMode (
@retval EFI_NOT_FOUND TODO: Add description for return value
**/
+STATIC
EFI_STATUS
EFIAPI
CirrusLogic5430UgaDrawSetMode (
@@ -301,6 +303,7 @@ CirrusLogic5430UgaDrawSetMode (
@retval EFI_SUCCESS TODO: Add description for return value
**/
+STATIC
EFI_STATUS
EFIAPI
CirrusLogic5430UgaDrawBlt (
diff --git a/EdkModulePkg/Bus/Pci/CirrusLogic/Dxe/ComponentName.c b/EdkModulePkg/Bus/Pci/CirrusLogic/Dxe/ComponentName.c
index 933899fa12..38d86a556c 100644
--- a/EdkModulePkg/Bus/Pci/CirrusLogic/Dxe/ComponentName.c
+++ b/EdkModulePkg/Bus/Pci/CirrusLogic/Dxe/ComponentName.c
@@ -142,7 +142,6 @@ CirrusLogic5430ComponentNameGetControllerName (
{
EFI_UGA_DRAW_PROTOCOL *UgaDraw;
EFI_STATUS Status;
- CIRRUS_LOGIC_5430_PRIVATE_DATA *Private;
EFI_PCI_IO_PROTOCOL *PciIoProtocol;
//
@@ -196,8 +195,6 @@ CirrusLogic5430ComponentNameGetControllerName (
//
// Get the Cirrus Logic 5430's Device structure
//
- Private = CIRRUS_LOGIC_5430_PRIVATE_DATA_FROM_UGA_DRAW_THIS (UgaDraw);
-
return LookupUnicodeString (
Language,
gCirrusLogic5430ComponentName.SupportedLanguages,
diff --git a/EdkModulePkg/Bus/Pci/Ehci/Dxe/Ehci.c b/EdkModulePkg/Bus/Pci/Ehci/Dxe/Ehci.c
index 2d6dc838a4..baea1f608d 100644
--- a/EdkModulePkg/Bus/Pci/Ehci/Dxe/Ehci.c
+++ b/EdkModulePkg/Bus/Pci/Ehci/Dxe/Ehci.c
@@ -1281,9 +1281,9 @@ EhciGetRootHubPortStatus (
// Not Low Speed Device Attached
//
if ((PORTSC_CCS & PortStatusControlReg) && (PORTSC_CSC & PortStatusControlReg)) {
- HcDev->DeviceSpeed[PortNumber] = IsHighSpeedDevice (This, PortNumber) ? USB_PORT_STAT_HIGH_SPEED : 0;
+ HcDev->DeviceSpeed[PortNumber] = (UINT16) (IsHighSpeedDevice (This, PortNumber) ? USB_PORT_STAT_HIGH_SPEED : 0);
}
- PortStatus->PortStatus |= HcDev->DeviceSpeed[PortNumber];
+ PortStatus->PortStatus = (UINT16) (PortStatus->PortStatus | HcDev->DeviceSpeed[PortNumber]);
}
//
// Fill Port Status Change bits
diff --git a/EdkModulePkg/Bus/Pci/Ehci/Dxe/EhciMem.c b/EdkModulePkg/Bus/Pci/Ehci/Dxe/EhciMem.c
index 0a992fe8ad..aba27cb82c 100644
--- a/EdkModulePkg/Bus/Pci/Ehci/Dxe/EhciMem.c
+++ b/EdkModulePkg/Bus/Pci/Ehci/Dxe/EhciMem.c
@@ -380,7 +380,7 @@ Returns:
// reset associated bits in bit arry
//
for (Index = StartBytePos, Index2 = StartBitPos, Count = 0; Count < (RealAllocSize / 32); Count++) {
- TempHeaderPtr->BitArrayPtr[Index] ^= (UINT8) (bit (Index2));
+ TempHeaderPtr->BitArrayPtr[Index] = (UINT8) (TempHeaderPtr->BitArrayPtr[Index] ^ (bit (Index2)));
Index2++;
if (Index2 == 8) {
Index += 1;
@@ -595,7 +595,7 @@ Returns:
//
for (TempBytePos = FoundBytePos, Index = FoundBitPos, Count = 0; Count < NumberOfMemoryUnit; Count++) {
- MemoryHeader->BitArrayPtr[TempBytePos] |= bit (Index);
+ MemoryHeader->BitArrayPtr[TempBytePos] = (UINT8) (MemoryHeader->BitArrayPtr[TempBytePos] | (bit (Index)));
Index++;
if (Index == 8) {
TempBytePos += 1;
diff --git a/EdkModulePkg/Bus/Pci/Ehci/Dxe/EhciReg.c b/EdkModulePkg/Bus/Pci/Ehci/Dxe/EhciReg.c
index 5767bbc024..d5271c25b2 100644
--- a/EdkModulePkg/Bus/Pci/Ehci/Dxe/EhciReg.c
+++ b/EdkModulePkg/Bus/Pci/Ehci/Dxe/EhciReg.c
@@ -1136,7 +1136,7 @@ Returns:
&PortStatusControlReg
);
- return ((PortStatusControlReg & PORTSC_PED) ? TRUE : FALSE);
+ return ((BOOLEAN) ((PortStatusControlReg & PORTSC_PED) ? TRUE : FALSE));
}
BOOLEAN
@@ -1347,7 +1347,7 @@ Returns:
//
gBS->Stall (EHCI_CLEAR_PORT_RESET_RECOVERY_TIME);
- return (IsEhcPortEnabled (HcDev, PortNum) ? TRUE : FALSE);
+ return ((BOOLEAN) (IsEhcPortEnabled (HcDev, PortNum) ? TRUE : FALSE));
}
EFI_STATUS
diff --git a/EdkModulePkg/Bus/Pci/Ehci/Dxe/EhciSched.c b/EdkModulePkg/Bus/Pci/Ehci/Dxe/EhciSched.c
index 9f1a15d093..48432c0b98 100644
--- a/EdkModulePkg/Bus/Pci/Ehci/Dxe/EhciSched.c
+++ b/EdkModulePkg/Bus/Pci/Ehci/Dxe/EhciSched.c
@@ -2547,7 +2547,7 @@ Returns:
MatchPtr = NULL;
QhHwPtr = NULL;
- EndPointNum = EndPointAddress & 0x0f;
+ EndPointNum = (UINT8) (EndPointAddress & 0x0f);
AsyncRequestPtr = HcDev->AsyncRequestList;
//
@@ -2916,13 +2916,11 @@ Returns:
EFI_STATUS Status;
UINTN ErrQtdPos;
UINTN Delay;
- UINTN RequireLen;
BOOLEAN Finished;
Status = EFI_SUCCESS;
ErrQtdPos = 0;
*TransferResult = EFI_USB_NOERROR;
- RequireLen = *ActualLen;
*ActualLen = 0;
Finished = FALSE;
diff --git a/EdkModulePkg/Bus/Pci/IdeBus/Dxe/DriverConfiguration.c b/EdkModulePkg/Bus/Pci/IdeBus/Dxe/DriverConfiguration.c
index 75794f8125..6a05562a17 100644
--- a/EdkModulePkg/Bus/Pci/IdeBus/Dxe/DriverConfiguration.c
+++ b/EdkModulePkg/Bus/Pci/IdeBus/Dxe/DriverConfiguration.c
@@ -64,6 +64,7 @@ EFI_DRIVER_CONFIGURATION_PROTOCOL gIDEBusDriverConfiguration = {
@retval EFI_NOT_FOUND TODO: Add description for return value
**/
+STATIC
EFI_STATUS
GetResponse (
VOID
@@ -190,7 +191,7 @@ IDEBusDriverConfigurationSetOptions (
}
if (!EFI_ERROR (Status)) {
- NewValue |= (UINT8) (1 << Index);
+ NewValue = (UINT8) (NewValue | (1 << Index));
}
}
diff --git a/EdkModulePkg/Bus/Pci/IdeBus/Dxe/ata.c b/EdkModulePkg/Bus/Pci/IdeBus/Dxe/ata.c
index 3273380da0..7ea54b9a4f 100644
--- a/EdkModulePkg/Bus/Pci/IdeBus/Dxe/ata.c
+++ b/EdkModulePkg/Bus/Pci/IdeBus/Dxe/ata.c
@@ -2073,7 +2073,7 @@ AtaCommandIssue (
Lba1 = (UINT8) RShiftU64 (LbaAddress, 8);
Lba2 = (UINT8) RShiftU64 (LbaAddress, 16);
Lba3 = (UINT8) RShiftU64 (LbaAddress, 24);
- Device |= Lba3;
+ Device = (UINT8) (Device | Lba3);
//
// Pass parameter into device register block
diff --git a/EdkModulePkg/Bus/Pci/IdeBus/Dxe/atapi.c b/EdkModulePkg/Bus/Pci/IdeBus/Dxe/atapi.c
index a54acf6994..93f7081516 100644
--- a/EdkModulePkg/Bus/Pci/IdeBus/Dxe/atapi.c
+++ b/EdkModulePkg/Bus/Pci/IdeBus/Dxe/atapi.c
@@ -713,11 +713,6 @@ PioReadWriteData (
EFI_STATUS Status;
UINT16 *PtrBuffer;
- //
- // containing status byte read from Status Register.
- //
- UINT8 StatusRegister;
-
//
// No data transfer is premitted.
//
@@ -750,16 +745,14 @@ PioReadWriteData (
//
// read Status Register will clear interrupt
//
- StatusRegister = IDEReadPortB (IdeDev->PciIo, IdeDev->IoPort->Reg.Status);
+ IDEReadPortB (IdeDev->PciIo, IdeDev->IoPort->Reg.Status);
//
// get current data transfer size from Cylinder Registers.
//
- WordCount =
- (
- (IDEReadPortB (IdeDev->PciIo, IdeDev->IoPort->CylinderMsb) << 8) |
- IDEReadPortB (IdeDev->PciIo, IdeDev->IoPort->CylinderLsb)
- ) & 0xffff;
+ WordCount = IDEReadPortB (IdeDev->PciIo, IdeDev->IoPort->CylinderMsb) << 8;
+ WordCount = WordCount | IDEReadPortB (IdeDev->PciIo, IdeDev->IoPort->CylinderLsb);
+ WordCount = WordCount & 0xffff;
WordCount /= 2;
WordCount = EFI_MIN (WordCount, (RequiredWordCount - ActualWordCount));
diff --git a/EdkModulePkg/Bus/Pci/IdeBus/Dxe/ide.c b/EdkModulePkg/Bus/Pci/IdeBus/Dxe/ide.c
index 0b28c57a03..14cdb251bb 100644
--- a/EdkModulePkg/Bus/Pci/IdeBus/Dxe/ide.c
+++ b/EdkModulePkg/Bus/Pci/IdeBus/Dxe/ide.c
@@ -236,6 +236,7 @@ IDEWritePortWMultiple (
TODO: add return values
**/
+STATIC
BOOLEAN
BadIdeDeviceCheck (
IN IDE_BLK_IO_DEV *IdeDev
diff --git a/EdkModulePkg/Bus/Pci/IdeBus/Dxe/idebus.c b/EdkModulePkg/Bus/Pci/IdeBus/Dxe/idebus.c
index c0cec601b8..fd04b67216 100644
--- a/EdkModulePkg/Bus/Pci/IdeBus/Dxe/idebus.c
+++ b/EdkModulePkg/Bus/Pci/IdeBus/Dxe/idebus.c
@@ -189,7 +189,6 @@ IDEBusDriverBindingStart (
EFI_IDE_CONTROLLER_INIT_PROTOCOL *IdeInit;
BOOLEAN EnumAll;
BOOLEAN ChannelEnabled;
- UINT8 ChannelCount;
UINT8 MaxDevices;
EFI_IDENTIFY_DATA IdentifyData;
EFI_ATA_COLLECTIVE_MODE *SupportedModes;
@@ -239,10 +238,9 @@ IDEBusDriverBindingStart (
}
//
- // Save Enumall and ChannelCount. Step7.2
+ // Save Enumall. Step7.2
//
EnumAll = IdeInit->EnumAll;
- ChannelCount = IdeInit->ChannelCount;
//
// Consume PCI I/O protocol. Note that the OpenProtocol with _GET_PROTOCOL
@@ -453,8 +451,8 @@ IDEBusDriverBindingStart (
ZeroMem (IdeBlkIoDevicePtr, sizeof (IDE_BLK_IO_DEV));
IdeBlkIoDevicePtr->Signature = IDE_BLK_IO_DEV_SIGNATURE;
- IdeBlkIoDevicePtr->Channel = IdeChannel;
- IdeBlkIoDevicePtr->Device = IdeDevice;
+ IdeBlkIoDevicePtr->Channel = (EFI_IDE_CHANNEL) IdeChannel;
+ IdeBlkIoDevicePtr->Device = (EFI_IDE_DEVICE) IdeDevice;
//
// initialize Block IO interface's Media pointer
@@ -666,7 +664,7 @@ IDEBusDriverBindingStart (
//
// Record PIO mode used in private data
//
- IdeBlkIoDevicePtr->PioMode = SupportedModes->PioMode.Mode;
+ IdeBlkIoDevicePtr->PioMode = (ATA_PIO_MODE) SupportedModes->PioMode.Mode;
//
// Set IDE controller Timing Blocks in the PCI Configuration Space
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,
diff --git a/EdkModulePkg/Bus/Pci/Uhci/Dxe/uhchlp.c b/EdkModulePkg/Bus/Pci/Uhci/Dxe/uhchlp.c
index 74ddc6bb12..8dbc0d9a33 100644
--- a/EdkModulePkg/Bus/Pci/Uhci/Dxe/uhchlp.c
+++ b/EdkModulePkg/Bus/Pci/Uhci/Dxe/uhchlp.c
@@ -21,6 +21,7 @@ Revision History
#include "uhci.h"
+STATIC
EFI_STATUS
USBReadPortW (
IN EFI_PCI_IO_PROTOCOL *PciIo,
@@ -58,6 +59,7 @@ Returns:
);
}
+STATIC
EFI_STATUS
USBReadPortDW (
IN EFI_PCI_IO_PROTOCOL *PciIo,
@@ -95,6 +97,7 @@ Returns:
);
}
+STATIC
EFI_STATUS
USBWritePortW (
IN EFI_PCI_IO_PROTOCOL *PciIo,
@@ -132,6 +135,7 @@ Returns:
);
}
+STATIC
EFI_STATUS
USBWritePortDW (
IN EFI_PCI_IO_PROTOCOL *PciIo,
@@ -654,13 +658,12 @@ Returns:
--*/
{
UINT16 CommandContent;
- EFI_STATUS Status;
- Status = ReadUHCCommandReg (
- HcDev->PciIo,
- (UINT32) (USBCMD),
- &CommandContent
- );
+ ReadUHCCommandReg (
+ HcDev->PciIo,
+ (UINT32) (USBCMD),
+ &CommandContent
+ );
if ((CommandContent & USBCMD_MAXP) != USBCMD_MAXP) {
CommandContent |= USBCMD_MAXP;
@@ -835,6 +838,7 @@ Returns:
//
// functions for QH
//
+STATIC
EFI_STATUS
AllocateQHStruct (
IN USB_HC_DEV *HcDev,
@@ -1196,6 +1200,7 @@ Returns:
return (BOOLEAN) (!(PtrQH->QH.QHVerticalTerminate));
}
+STATIC
BOOLEAN
GetQHHorizontalValidorInvalid (
IN QH_STRUCT *PtrQH
@@ -1769,6 +1774,7 @@ Returns:
return (VOID *) ((UINTN) (ptrTDStruct->TDData.TDLinkPtr << 4));
}
+STATIC
BOOLEAN
IsTDLinkPtrQHOrTD (
IN TD_STRUCT *ptrTDStruct
@@ -2325,6 +2331,7 @@ SetCurFrameListQHorTD (
pCurEntry->FrameListPtrQSelect = (IsQH ? 1 : 0);
}
+STATIC
BOOLEAN
IsCurFrameListQHorTD (
IN FRAMELIST_ENTRY *pCurEntry
@@ -3854,7 +3861,7 @@ Returns:
//
for (Index = StartBytePos, Index2 = StartBitPos, Count = 0; Count < (RealAllocSize / 32); Count++) {
- TempHeaderPtr->BitArrayPtr[Index] ^= (UINT8) (bit (Index2));
+ TempHeaderPtr->BitArrayPtr[Index] = (UINT8) (TempHeaderPtr->BitArrayPtr[Index] ^ bit (Index2));
Index2++;
if (Index2 == 8) {
Index += 1;
@@ -4067,7 +4074,7 @@ Returns:
for (TempBytePos = FoundBytePos, Index = FoundBitPos,Count = 0;
Count < NumberOfMemoryUnit; Count ++) {
- MemoryHeader->BitArrayPtr[TempBytePos] |= bit (Index);
+ MemoryHeader->BitArrayPtr[TempBytePos] = (UINT8) (MemoryHeader->BitArrayPtr[TempBytePos] | bit (Index));
Index++;
if (Index == 8) {
TempBytePos += 1;
diff --git a/EdkModulePkg/Bus/Pci/Uhci/Dxe/uhci.c b/EdkModulePkg/Bus/Pci/Uhci/Dxe/uhci.c
index 96c5be48ba..3d81d2c5c3 100644
--- a/EdkModulePkg/Bus/Pci/Uhci/Dxe/uhci.c
+++ b/EdkModulePkg/Bus/Pci/Uhci/Dxe/uhci.c
@@ -759,7 +759,7 @@ UHCIDriverBindingStart (
return EFI_SUCCESS;
}
-
+STATIC
EFI_STATUS
UnInstallUHCInterface (
IN EFI_HANDLE Controller,
@@ -3845,7 +3845,7 @@ UHCI2ControlTransfer (
--*/
{
USB_HC_DEV *HcDev;
- BOOLEAN IsSlowDevice = (EFI_USB_SPEED_LOW == DeviceSpeed) ? TRUE : FALSE;
+ BOOLEAN IsSlowDevice = (BOOLEAN) ((EFI_USB_SPEED_LOW == DeviceSpeed) ? TRUE : FALSE);
HcDev = USB2_HC_DEV_FROM_THIS (This);
@@ -4056,7 +4056,7 @@ UHCI2AsyncInterruptTransfer (
--*/
{
USB_HC_DEV *HcDev;
- BOOLEAN IsSlowDevice = (EFI_USB_SPEED_LOW == DeviceSpeed) ? TRUE : FALSE;
+ BOOLEAN IsSlowDevice = (BOOLEAN) ((EFI_USB_SPEED_LOW == DeviceSpeed) ? TRUE : FALSE);
HcDev = USB2_HC_DEV_FROM_THIS (This);
return UHCIAsyncInterruptTransfer(
@@ -4155,7 +4155,7 @@ UHCI2SyncInterruptTransfer (
if(DeviceSpeed==EFI_USB_SPEED_HIGH)
return EFI_INVALID_PARAMETER;
- IsSlowDevice = (EFI_USB_SPEED_LOW == DeviceSpeed) ? TRUE : FALSE;
+ IsSlowDevice = (BOOLEAN) ((EFI_USB_SPEED_LOW == DeviceSpeed) ? TRUE : FALSE);
HcDev = USB2_HC_DEV_FROM_THIS (This);
return UHCISyncInterruptTransfer(
@@ -4437,11 +4437,9 @@ MonitorInterruptTrans (
UINTN DataLen;
UINTN ActualLen;
UINTN ErrTDPos;
- UINT32 StatusAddr;
LIST_ENTRY *NextLink;
HcDev = (USB_HC_DEV *) Context;
- StatusAddr = (UINT32) (USBSTS);
//
// interrupt transfer list is empty, means that no interrupt transfer
diff --git a/EdkModulePkg/Bus/Scsi/ScsiBus/Dxe/ScsiBus.c b/EdkModulePkg/Bus/Scsi/ScsiBus/Dxe/ScsiBus.c
index 2ef31fb38c..b7b59615fd 100644
--- a/EdkModulePkg/Bus/Scsi/ScsiBus/Dxe/ScsiBus.c
+++ b/EdkModulePkg/Bus/Scsi/ScsiBus/Dxe/ScsiBus.c
@@ -362,6 +362,7 @@ ScsiGetDeviceType (
return EFI_SUCCESS;
}
+STATIC
EFI_STATUS
EFIAPI
ScsiGetDeviceLocation (
diff --git a/EdkModulePkg/Bus/Scsi/ScsiDisk/Dxe/ScsiDisk.c b/EdkModulePkg/Bus/Scsi/ScsiDisk/Dxe/ScsiDisk.c
index 4be2c38817..10134e864e 100644
--- a/EdkModulePkg/Bus/Scsi/ScsiDisk/Dxe/ScsiDisk.c
+++ b/EdkModulePkg/Bus/Scsi/ScsiDisk/Dxe/ScsiDisk.c
@@ -1614,11 +1614,9 @@ Returns:
UINT8 MaxRetry;
BOOLEAN NeedRetry;
EFI_SCSI_SENSE_DATA *SenseData;
- UINT8 SenseDataLength;
UINTN NumberOfSenseKeys;
SenseData = NULL;
- SenseDataLength = 0;
NumberOfSenseKeys = 0;
Status = EFI_SUCCESS;
@@ -1728,11 +1726,9 @@ Returns:
UINT8 MaxRetry;
BOOLEAN NeedRetry;
EFI_SCSI_SENSE_DATA *SenseData;
- UINT8 SenseDataLength;
UINTN NumberOfSenseKeys;
SenseData = NULL;
- SenseDataLength = 0;
NumberOfSenseKeys = 0;
Status = EFI_SUCCESS;
diff --git a/EdkModulePkg/Bus/Usb/UsbCbi/Dxe/Cbi0/Cbi0.c b/EdkModulePkg/Bus/Usb/UsbCbi/Dxe/Cbi0/Cbi0.c
index d9b094d114..91a447de66 100644
--- a/EdkModulePkg/Bus/Usb/UsbCbi/Dxe/Cbi0/Cbi0.c
+++ b/EdkModulePkg/Bus/Usb/UsbCbi/Dxe/Cbi0/Cbi0.c
@@ -457,7 +457,6 @@ Cbi0DriverBindingStop (
EFI_STATUS Status;
EFI_USB_ATAPI_PROTOCOL *Cbi0AtapiProtocol;
USB_CBI_DEVICE *UsbCbiDev;
- EFI_USB_IO_PROTOCOL *UsbIo;
//
// Get our context back.
@@ -476,8 +475,6 @@ Cbi0DriverBindingStop (
UsbCbiDev = USB_CBI_DEVICE_FROM_THIS (Cbi0AtapiProtocol);
- UsbIo = UsbCbiDev->UsbIo;
-
Cbi0ReportStatusCode (
UsbCbiDev->DevicePath,
EFI_PROGRESS_CODE,
@@ -850,11 +847,9 @@ Cbi0MassStorageReset (
--*/
{
EFI_STATUS Status;
- EFI_USB_IO_PROTOCOL *UsbIo;
USB_CBI_DEVICE *UsbCbiDev;
UsbCbiDev = USB_CBI_DEVICE_FROM_THIS (This);
- UsbIo = UsbCbiDev->UsbIo;
if (ExtendedVerification) {
//
diff --git a/EdkModulePkg/Bus/Usb/UsbCbi/Dxe/Cbi1/cbi1.c b/EdkModulePkg/Bus/Usb/UsbCbi/Dxe/Cbi1/cbi1.c
index d778497096..008627b9dd 100644
--- a/EdkModulePkg/Bus/Usb/UsbCbi/Dxe/Cbi1/cbi1.c
+++ b/EdkModulePkg/Bus/Usb/UsbCbi/Dxe/Cbi1/cbi1.c
@@ -400,7 +400,6 @@ CBI1DriverBindingStop (
EFI_STATUS Status;
EFI_USB_ATAPI_PROTOCOL *CBI1AtapiProtocol;
USB_CBI_DEVICE *UsbCbiDev;
- EFI_USB_IO_PROTOCOL *UsbIo;
//
// Get our context back.
@@ -419,8 +418,6 @@ CBI1DriverBindingStop (
UsbCbiDev = USB_CBI_DEVICE_FROM_THIS (CBI1AtapiProtocol);
- UsbIo = UsbCbiDev->UsbIo;
-
Cbi1ReportStatusCode (
UsbCbiDev->DevicePath,
EFI_PROGRESS_CODE,
@@ -644,7 +641,6 @@ CBI1MassStorageReset (
--*/
{
UINT8 ResetCommand[12];
- EFI_STATUS Status;
EFI_USB_IO_PROTOCOL *UsbIo;
USB_CBI_DEVICE *UsbCbiDev;
UINT8 EndpointAddr;
@@ -669,12 +665,12 @@ CBI1MassStorageReset (
ResetCommand[0] = 0x1d;
ResetCommand[1] = 0x04;
- Status = CBI1CommandPhase (
- UsbCbiDev,
- ResetCommand,
- 12,
- &Result
- );
+ CBI1CommandPhase (
+ UsbCbiDev,
+ ResetCommand,
+ 12,
+ &Result
+ );
//
// clear bulk in endpoint stall feature
diff --git a/EdkModulePkg/Bus/Usb/UsbKb/Dxe/efikey.c b/EdkModulePkg/Bus/Usb/UsbKb/Dxe/efikey.c
index ec496a6e39..1b8c96166c 100644
--- a/EdkModulePkg/Bus/Usb/UsbKb/Dxe/efikey.c
+++ b/EdkModulePkg/Bus/Usb/UsbKb/Dxe/efikey.c
@@ -467,7 +467,6 @@ USBKeyboardDriverBindingStop (
EFI_STATUS Status;
EFI_SIMPLE_TEXT_IN_PROTOCOL *SimpleInput;
USB_KB_DEV *UsbKeyboardDevice;
- EFI_USB_IO_PROTOCOL *UsbIo;
Status = gBS->OpenProtocol (
Controller,
@@ -493,7 +492,6 @@ USBKeyboardDriverBindingStop (
Controller
);
- UsbIo = UsbKeyboardDevice->UsbIo;
//
// Uninstall the Asyn Interrupt Transfer from this device
// will disable the key data input from this device
@@ -574,12 +572,9 @@ USBKeyboardReset (
{
EFI_STATUS Status;
USB_KB_DEV *UsbKeyboardDevice;
- EFI_USB_IO_PROTOCOL *UsbIo;
UsbKeyboardDevice = USB_KB_DEV_FROM_THIS (This);
- UsbIo = UsbKeyboardDevice->UsbIo;
-
KbdReportStatusCode (
UsbKeyboardDevice->DevicePath,
EFI_PROGRESS_CODE,
diff --git a/EdkModulePkg/Bus/Usb/UsbKb/Dxe/keyboard.c b/EdkModulePkg/Bus/Usb/UsbKb/Dxe/keyboard.c
index b6b97c3b48..79eded33c3 100644
--- a/EdkModulePkg/Bus/Usb/UsbKb/Dxe/keyboard.c
+++ b/EdkModulePkg/Bus/Usb/UsbKb/Dxe/keyboard.c
@@ -210,9 +210,6 @@ InitUSBKeyboard (
UINT8 Duration;
EFI_STATUS Status;
UINT32 TransferResult;
- EFI_USB_IO_PROTOCOL *UsbIo;
-
- UsbIo = UsbKeyboardDevice->UsbIo;
KbdReportStatusCode (
UsbKeyboardDevice->DevicePath,
@@ -360,19 +357,16 @@ KeyboardHandler (
UINT8 Index;
UINT8 Index2;
BOOLEAN Down;
- EFI_STATUS Status;
BOOLEAN KeyRelease;
BOOLEAN KeyPress;
UINT8 SavedTail;
USB_KEY UsbKey;
UINT8 NewRepeatKey;
UINT32 UsbStatus;
- UINT8 *DataPtr;
ASSERT (Context);
NewRepeatKey = 0;
- DataPtr = (UINT8 *) Data;
UsbKeyboardDevice = (USB_KB_DEV *) Context;
UsbIo = UsbKeyboardDevice->UsbIo;
@@ -412,15 +406,15 @@ KeyboardHandler (
// Delete & Submit this interrupt again
//
- Status = UsbIo->UsbAsyncInterruptTransfer (
- UsbIo,
- UsbKeyboardDevice->IntEndpointDescriptor.EndpointAddress,
- FALSE,
- 0,
- 0,
- NULL,
- NULL
- );
+ UsbIo->UsbAsyncInterruptTransfer (
+ UsbIo,
+ UsbKeyboardDevice->IntEndpointDescriptor.EndpointAddress,
+ FALSE,
+ 0,
+ 0,
+ NULL,
+ NULL
+ );
gBS->SetTimer (
UsbKeyboardDevice->DelayedRecoveryEvent,
diff --git a/EdkModulePkg/Bus/Usb/UsbMassStorage/Dxe/UsbMassStorage.c b/EdkModulePkg/Bus/Usb/UsbMassStorage/Dxe/UsbMassStorage.c
index 0d57f7642d..b86c06a514 100644
--- a/EdkModulePkg/Bus/Usb/UsbMassStorage/Dxe/UsbMassStorage.c
+++ b/EdkModulePkg/Bus/Usb/UsbMassStorage/Dxe/UsbMassStorage.c
@@ -443,12 +443,10 @@ USBFloppyReadBlocks (
UINTN NumberOfBlocks;
BOOLEAN MediaChange;
EFI_TPL OldTpl;
- UINT32 Retry;
OldTpl = gBS->RaiseTPL (EFI_TPL_NOTIFY);
Status = EFI_SUCCESS;
MediaChange = FALSE;
- Retry = 0;
UsbFloppyDevice = USB_FLOPPY_DEV_FROM_THIS (This);
@@ -594,12 +592,10 @@ USBFloppyWriteBlocks (
UINTN NumberOfBlocks;
BOOLEAN MediaChange;
EFI_TPL OldTpl;
- UINT32 Retry;
OldTpl = gBS->RaiseTPL (EFI_TPL_NOTIFY);
Status = EFI_SUCCESS;
MediaChange = FALSE;
- Retry = 0;
UsbFloppyDevice = USB_FLOPPY_DEV_FROM_THIS (This);
diff --git a/EdkModulePkg/Bus/Usb/UsbMouse/Dxe/usbmouse.c b/EdkModulePkg/Bus/Usb/UsbMouse/Dxe/usbmouse.c
index 063247376b..442b5a2139 100644
--- a/EdkModulePkg/Bus/Usb/UsbMouse/Dxe/usbmouse.c
+++ b/EdkModulePkg/Bus/Usb/UsbMouse/Dxe/usbmouse.c
@@ -906,12 +906,9 @@ UsbMouseReset (
--*/
{
USB_MOUSE_DEV *UsbMouseDevice;
- EFI_USB_IO_PROTOCOL *UsbIo;
UsbMouseDevice = USB_MOUSE_DEV_FROM_MOUSE_PROTOCOL (This);
- UsbIo = UsbMouseDevice->UsbIo;
-
MouseReportStatusCode (
UsbMouseDevice->DevicePath,
EFI_PROGRESS_CODE,
diff --git a/EdkModulePkg/Core/Dxe/Dispatcher/Dispatcher.c b/EdkModulePkg/Core/Dxe/Dispatcher/Dispatcher.c
index 68bf63e601..e7c23b57b3 100644
--- a/EdkModulePkg/Core/Dxe/Dispatcher/Dispatcher.c
+++ b/EdkModulePkg/Core/Dxe/Dispatcher/Dispatcher.c
@@ -136,7 +136,7 @@ CoreProcessFvImageFile (
IN EFI_GUID *DriverName
);
-
+STATIC
VOID
CoreAcquireDispatcherLock (
VOID
@@ -161,6 +161,7 @@ Returns:
CoreAcquireLock (&mDispatcherLock);
}
+STATIC
VOID
CoreReleaseDispatcherLock (
VOID
@@ -184,7 +185,7 @@ Returns:
CoreReleaseLock (&mDispatcherLock);
}
-
+STATIC
EFI_STATUS
CoreGetDepexSectionAndPreProccess (
IN EFI_CORE_DRIVER_ENTRY *DriverEntry
@@ -593,7 +594,7 @@ Returns:
}
}
-
+STATIC
BOOLEAN
FvHasBeenProcessed (
IN EFI_HANDLE FvHandle
@@ -628,7 +629,7 @@ Returns:
return FALSE;
}
-
+STATIC
VOID
FvIsBeingProcesssed (
IN EFI_HANDLE FvHandle
diff --git a/EdkModulePkg/Core/Dxe/Dispatcher/dependency.c b/EdkModulePkg/Core/Dxe/Dispatcher/dependency.c
index c6ab876040..7c2093b61d 100644
--- a/EdkModulePkg/Core/Dxe/Dispatcher/dependency.c
+++ b/EdkModulePkg/Core/Dxe/Dispatcher/dependency.c
@@ -432,7 +432,7 @@ Returns:
break;
default:
- return FALSE;
+ goto Done;
}
//
@@ -445,6 +445,8 @@ Returns:
//
Iterator++;
}
+
+Done:
return FALSE;
}
diff --git a/EdkModulePkg/Core/Dxe/DxeMain/DxeProtocolNotify.c b/EdkModulePkg/Core/Dxe/DxeMain/DxeProtocolNotify.c
index a4d653c5aa..b485210aef 100644
--- a/EdkModulePkg/Core/Dxe/DxeMain/DxeProtocolNotify.c
+++ b/EdkModulePkg/Core/Dxe/DxeMain/DxeProtocolNotify.c
@@ -96,7 +96,7 @@ Returns:
return EFI_SUCCESS;
}
-
+STATIC
VOID
EFIAPI
GenericArchProtocolNotify (
diff --git a/EdkModulePkg/Core/Dxe/Event/event.c b/EdkModulePkg/Core/Dxe/Event/event.c
index 08cff427ff..3749657276 100644
--- a/EdkModulePkg/Core/Dxe/Event/event.c
+++ b/EdkModulePkg/Core/Dxe/Event/event.c
@@ -87,7 +87,7 @@ UINT32 mEventTable[] = {
EFI_EVENT_TIMER | EFI_EVENT_NOTIFY_WAIT,
};
-
+STATIC
VOID
CoreAcquireEventLock (
VOID
@@ -111,7 +111,7 @@ Returns:
CoreAcquireLock (&gEventQueueLock);
}
-
+STATIC
VOID
CoreReleaseEventLock (
VOID
@@ -232,8 +232,8 @@ Returns:
}
-VOID
STATIC
+VOID
CoreNotifyEvent (
IN IEVENT *Event
)
diff --git a/EdkModulePkg/Core/Dxe/FwVol/Ffs.c b/EdkModulePkg/Core/Dxe/FwVol/Ffs.c
index 6f7d353e05..23c84b34f8 100644
--- a/EdkModulePkg/Core/Dxe/FwVol/Ffs.c
+++ b/EdkModulePkg/Core/Dxe/FwVol/Ffs.c
@@ -143,7 +143,7 @@ Returns:
}
}
-
+STATIC
BOOLEAN
VerifyHeaderChecksum (
IN EFI_FFS_FILE_HEADER *FfsHeader
@@ -172,7 +172,7 @@ Returns:
HeaderChecksum = (UINT8)(HeaderChecksum + ptr[Index]);
}
- HeaderChecksum = HeaderChecksum - FfsHeader->State - FfsHeader->IntegrityCheck.Checksum.File;
+ HeaderChecksum = (UINT8) (HeaderChecksum - FfsHeader->State - FfsHeader->IntegrityCheck.Checksum.File);
if (HeaderChecksum == 0) {
return TRUE;
diff --git a/EdkModulePkg/Core/Dxe/Gcd/gcd.c b/EdkModulePkg/Core/Dxe/Gcd/gcd.c
index 0735bf00b9..181cb1a317 100644
--- a/EdkModulePkg/Core/Dxe/Gcd/gcd.c
+++ b/EdkModulePkg/Core/Dxe/Gcd/gcd.c
@@ -61,7 +61,7 @@ EFI_GCD_MAP_ENTRY mGcdMemorySpaceMapEntryTemplate = {
0,
0,
EfiGcdMemoryTypeNonExistent,
- 0,
+ (EFI_GCD_IO_TYPE) 0,
NULL,
NULL
};
@@ -73,7 +73,7 @@ EFI_GCD_MAP_ENTRY mGcdIoSpaceMapEntryTemplate = {
0,
0,
0,
- 0,
+ (EFI_GCD_MEMORY_TYPE) 0,
EfiGcdIoTypeNonExistent,
NULL,
NULL
@@ -136,7 +136,7 @@ Returns:
}
-
+STATIC
VOID
CoreAcquireGcdIoLock (
VOID
@@ -157,7 +157,7 @@ Returns:
CoreAcquireLock (&mGcdIoSpaceLock);
}
-
+STATIC
VOID
CoreReleaseGcdIoLock (
VOID
@@ -183,6 +183,7 @@ Returns:
//
// GCD Initialization Worker Functions
//
+STATIC
UINT64
AlignValue (
IN UINT64 Value,
@@ -217,6 +218,7 @@ Returns:
return Value & (~AlignmentMask);
}
+STATIC
UINT64
PageAlignAddress (
IN UINT64 Value
@@ -240,6 +242,7 @@ Returns:
return AlignValue (Value, EFI_PAGE_SHIFT, TRUE);
}
+STATIC
UINT64
PageAlignLength (
IN UINT64 Value
@@ -266,6 +269,7 @@ Returns:
//
// GCD Memory Space Worker Functions
//
+STATIC
EFI_STATUS
CoreAllocateGcdMapEntry (
IN OUT EFI_GCD_MAP_ENTRY **TopEntry,
@@ -303,6 +307,7 @@ Returns:
return EFI_SUCCESS;
}
+STATIC
EFI_STATUS
CoreInsertGcdMapEntry (
IN LIST_ENTRY *Link,
@@ -359,6 +364,7 @@ Returns:
return EFI_SUCCESS;
}
+STATIC
EFI_STATUS
CoreMergeGcdMapEntry (
IN LIST_ENTRY *Link,
@@ -440,6 +446,7 @@ Returns:
return EFI_SUCCESS;
}
+STATIC
EFI_STATUS
CoreCleanupGcdMapEntry (
IN EFI_GCD_MAP_ENTRY *TopEntry,
@@ -491,6 +498,7 @@ Returns:
return EFI_SUCCESS;
}
+STATIC
EFI_STATUS
CoreSearchGcdMapEntry (
IN EFI_PHYSICAL_ADDRESS BaseAddress,
@@ -551,6 +559,7 @@ Returns:
return EFI_NOT_FOUND;
}
+STATIC
UINTN
CoreCountGcdMapEntry (
IN LIST_ENTRY *Map
@@ -584,7 +593,7 @@ Returns:
}
-
+STATIC
UINT64
ConverToCpuArchAttributes (
UINT64 Attributes
@@ -629,7 +638,7 @@ Returns:
}
-
+STATIC
EFI_STATUS
CoreConvertSpace (
IN UINTN Operation,
@@ -897,6 +906,7 @@ Done:
return Status;
}
+STATIC
EFI_STATUS
CoreAllocateSpaceCheckEntry (
IN UINTN Operation,
@@ -950,6 +960,7 @@ Returns:
return EFI_SUCCESS;
}
+STATIC
EFI_STATUS
CoreAllocateSpace (
IN UINTN Operation,
@@ -1218,7 +1229,7 @@ Done:
return Status;
}
-
+STATIC
EFI_STATUS
CoreInternalAddMemorySpace (
IN EFI_GCD_MEMORY_TYPE GcdMemoryType,
@@ -1257,7 +1268,7 @@ Returns:
return EFI_INVALID_PARAMETER;
}
- return CoreConvertSpace (GCD_ADD_MEMORY_OPERATION, GcdMemoryType, 0, BaseAddress, Length, Capabilities, 0);
+ return CoreConvertSpace (GCD_ADD_MEMORY_OPERATION, GcdMemoryType, (EFI_GCD_IO_TYPE) 0, BaseAddress, Length, Capabilities, 0);
}
//
@@ -1310,7 +1321,7 @@ Returns:
GCD_ALLOCATE_MEMORY_OPERATION,
GcdAllocateType,
GcdMemoryType,
- 0,
+ (EFI_GCD_IO_TYPE) 0,
Alignment,
Length,
BaseAddress,
@@ -1427,7 +1438,7 @@ Returns:
--*/
{
- return CoreConvertSpace (GCD_FREE_MEMORY_OPERATION, 0, 0, BaseAddress, Length, 0, 0);
+ return CoreConvertSpace (GCD_FREE_MEMORY_OPERATION, (EFI_GCD_MEMORY_TYPE) 0, (EFI_GCD_IO_TYPE) 0, BaseAddress, Length, 0, 0);
}
EFI_STATUS
@@ -1454,9 +1465,10 @@ Returns:
--*/
{
- return CoreConvertSpace (GCD_REMOVE_MEMORY_OPERATION, 0, 0, BaseAddress, Length, 0, 0);
+ return CoreConvertSpace (GCD_REMOVE_MEMORY_OPERATION, (EFI_GCD_MEMORY_TYPE) 0, (EFI_GCD_IO_TYPE) 0, BaseAddress, Length, 0, 0);
}
+STATIC
VOID
BuildMemoryDescriptor (
IN OUT EFI_GCD_MEMORY_SPACE_DESCRIPTOR *Descriptor,
@@ -1574,7 +1586,7 @@ Returns:
--*/
{
- return CoreConvertSpace (GCD_SET_ATTRIBUTES_MEMORY_OPERATION, 0, 0, BaseAddress, Length, 0, Attributes);
+ return CoreConvertSpace (GCD_SET_ATTRIBUTES_MEMORY_OPERATION, (EFI_GCD_MEMORY_TYPE) 0, (EFI_GCD_IO_TYPE) 0, BaseAddress, Length, 0, Attributes);
}
EFI_STATUS
@@ -1687,7 +1699,7 @@ Returns:
if (GcdIoType <= EfiGcdIoTypeNonExistent || GcdIoType >= EfiGcdIoTypeMaximum) {
return EFI_INVALID_PARAMETER;
}
- return CoreConvertSpace (GCD_ADD_IO_OPERATION, 0, GcdIoType, BaseAddress, Length, 0, 0);
+ return CoreConvertSpace (GCD_ADD_IO_OPERATION, (EFI_GCD_MEMORY_TYPE) 0, GcdIoType, BaseAddress, Length, 0, 0);
}
EFI_STATUS
@@ -1736,7 +1748,7 @@ Returns:
return CoreAllocateSpace (
GCD_ALLOCATE_IO_OPERATION,
GcdAllocateType,
- 0,
+ (EFI_GCD_MEMORY_TYPE) 0,
GcdIoType,
Alignment,
Length,
@@ -1770,7 +1782,7 @@ Returns:
--*/
{
- return CoreConvertSpace (GCD_FREE_IO_OPERATION, 0, 0, BaseAddress, Length, 0, 0);
+ return CoreConvertSpace (GCD_FREE_IO_OPERATION, (EFI_GCD_MEMORY_TYPE) 0, (EFI_GCD_IO_TYPE) 0, BaseAddress, Length, 0, 0);
}
EFI_STATUS
@@ -1797,9 +1809,10 @@ Returns:
--*/
{
- return CoreConvertSpace (GCD_REMOVE_IO_OPERATION, 0, 0, BaseAddress, Length, 0, 0);
+ return CoreConvertSpace (GCD_REMOVE_IO_OPERATION, (EFI_GCD_MEMORY_TYPE) 0, (EFI_GCD_IO_TYPE) 0, BaseAddress, Length, 0, 0);
}
+STATIC
VOID
BuildIoDescriptor (
IN EFI_GCD_IO_SPACE_DESCRIPTOR *Descriptor,
@@ -1964,6 +1977,7 @@ Done:
return Status;
}
+STATIC
UINT64
CoreConvertResourceDescriptorHobAttributesToCapabilities (
EFI_GCD_MEMORY_TYPE GcdMemoryType,
diff --git a/EdkModulePkg/Core/Dxe/Hand/DriverSupport.c b/EdkModulePkg/Core/Dxe/Hand/DriverSupport.c
index 30738572c9..e8a400c757 100644
--- a/EdkModulePkg/Core/Dxe/Hand/DriverSupport.c
+++ b/EdkModulePkg/Core/Dxe/Hand/DriverSupport.c
@@ -149,6 +149,7 @@ Returns:
return ReturnStatus;
}
+STATIC
VOID
AddSortedDriverBindingProtocol (
IN EFI_HANDLE DriverBindingHandle,
@@ -265,8 +266,6 @@ Returns:
EFI_STATUS Status;
UINTN Index;
EFI_HANDLE DriverImageHandle;
- UINTN PlatformDriverOverrideHandleCount;
- EFI_HANDLE *PlatformDriverOverrideHandleBuffer;
EFI_PLATFORM_DRIVER_OVERRIDE_PROTOCOL *PlatformDriverOverride;
EFI_BUS_SPECIFIC_DRIVER_OVERRIDE_PROTOCOL *BusSpecificDriverOverride;
UINTN DriverBindingHandleCount;
@@ -290,8 +289,6 @@ Returns:
//
DriverBindingHandleCount = 0;
DriverBindingHandleBuffer = NULL;
- PlatformDriverOverrideHandleCount = 0;
- PlatformDriverOverrideHandleBuffer = NULL;
NumberOfSortedDriverBindingProtocols = 0;
SortedDriverBindingProtocols = NULL;
diff --git a/EdkModulePkg/Core/Dxe/Hand/handle.c b/EdkModulePkg/Core/Dxe/Hand/handle.c
index f0dea716df..2f43dc02b1 100644
--- a/EdkModulePkg/Core/Dxe/Hand/handle.c
+++ b/EdkModulePkg/Core/Dxe/Hand/handle.c
@@ -978,6 +978,7 @@ Returns:
return Status;
}
+STATIC
PROTOCOL_INTERFACE *
CoreGetProtocolInterface (
IN EFI_HANDLE UserHandle,
diff --git a/EdkModulePkg/Core/Dxe/Image/Image.c b/EdkModulePkg/Core/Dxe/Image/Image.c
index 9a2723765d..e9541f7f9d 100644
--- a/EdkModulePkg/Core/Dxe/Image/Image.c
+++ b/EdkModulePkg/Core/Dxe/Image/Image.c
@@ -254,7 +254,7 @@ Returns:
if (Image->ImageContext.ImageAddress >= 0x100000 || Image->ImageContext.RelocationsStripped) {
Status = CoreAllocatePages (
AllocateAddress,
- Image->ImageContext.ImageCodeMemoryType,
+ (EFI_MEMORY_TYPE) (Image->ImageContext.ImageCodeMemoryType),
Image->NumberOfPages,
&Image->ImageContext.ImageAddress
);
@@ -262,7 +262,7 @@ Returns:
if (EFI_ERROR (Status) && !Image->ImageContext.RelocationsStripped) {
Status = CoreAllocatePages (
AllocateAnyPages,
- Image->ImageContext.ImageCodeMemoryType,
+ (EFI_MEMORY_TYPE) (Image->ImageContext.ImageCodeMemoryType),
Image->NumberOfPages,
&Image->ImageContext.ImageAddress
);
@@ -389,8 +389,8 @@ Returns:
Image->Type = Image->ImageContext.ImageType;
Image->Info.ImageBase = (VOID *)(UINTN)Image->ImageContext.ImageAddress;
Image->Info.ImageSize = Image->ImageContext.ImageSize;
- Image->Info.ImageCodeType = Image->ImageContext.ImageCodeMemoryType;
- Image->Info.ImageDataType = Image->ImageContext.ImageDataMemoryType;
+ Image->Info.ImageCodeType = (EFI_MEMORY_TYPE) (Image->ImageContext.ImageCodeMemoryType);
+ Image->Info.ImageDataType = (EFI_MEMORY_TYPE) (Image->ImageContext.ImageDataMemoryType);
if (Attribute & EFI_LOAD_PE_IMAGE_ATTRIBUTE_RUNTIME_REGISTRATION) {
if (Image->ImageContext.ImageType == EFI_IMAGE_SUBSYSTEM_EFI_RUNTIME_DRIVER) {
//
@@ -514,7 +514,7 @@ Returns:
return Image;
}
-
+STATIC
EFI_STATUS
CoreLoadImageCommon (
IN BOOLEAN BootPolicy,
diff --git a/EdkModulePkg/Core/Dxe/Mem/Page.c b/EdkModulePkg/Core/Dxe/Mem/Page.c
index d14468945f..44116abcb6 100644
--- a/EdkModulePkg/Core/Dxe/Mem/Page.c
+++ b/EdkModulePkg/Core/Dxe/Mem/Page.c
@@ -308,7 +308,7 @@ Returns:
//
// Make sure the memory type in the gMemoryTypeInformation[] array is valid
//
- Type = gMemoryTypeInformation[Index].Type;
+ Type = (EFI_MEMORY_TYPE) (gMemoryTypeInformation[Index].Type);
if (Type < 0 || Type > EfiMaxMemoryType) {
continue;
}
@@ -333,7 +333,7 @@ Returns:
//
// Make sure the memory type in the gMemoryTypeInformation[] array is valid
//
- Type = gMemoryTypeInformation[FreeIndex].Type;
+ Type = (EFI_MEMORY_TYPE) (gMemoryTypeInformation[FreeIndex].Type);
if (Type < 0 || Type > EfiMaxMemoryType) {
continue;
}
@@ -376,7 +376,7 @@ Returns:
//
// Make sure the memory type in the gMemoryTypeInformation[] array is valid
//
- Type = gMemoryTypeInformation[Index].Type;
+ Type = (EFI_MEMORY_TYPE) (gMemoryTypeInformation[Index].Type);
if (Type < 0 || Type > EfiMaxMemoryType) {
continue;
}
@@ -394,7 +394,7 @@ Returns:
// If the number of pages reserved for a memory type is 0, then all allocations for that type
// should be in the default range.
//
- for (Type = 0; Type < EfiMaxMemoryType; Type++) {
+ for (Type = (EFI_MEMORY_TYPE) 0; Type < EfiMaxMemoryType; Type++) {
for (Index = 0; gMemoryTypeInformation[Index].Type != EfiMaxMemoryType; Index++) {
if (Type == (EFI_MEMORY_TYPE)gMemoryTypeInformation[Index].Type) {
mMemoryTypeStatistics[Type].InformationIndex = Index;
@@ -1457,7 +1457,6 @@ Returns:
--*/
{
- EFI_STATUS Status;
UINT64 Start;
//
@@ -1471,7 +1470,7 @@ Returns:
if (Start == 0) {
DEBUG ((EFI_D_ERROR | EFI_D_PAGE, "AllocatePoolPages: failed to allocate %d pages\n", NumberOfPages));
} else {
- Status = CoreConvertPages (Start, NumberOfPages, PoolType);
+ CoreConvertPages (Start, NumberOfPages, PoolType);
}
return (VOID *)(UINTN)Start;
diff --git a/EdkModulePkg/Core/Dxe/Mem/pool.c b/EdkModulePkg/Core/Dxe/Mem/pool.c
index 3201a97864..c024f0368c 100644
--- a/EdkModulePkg/Core/Dxe/Mem/pool.c
+++ b/EdkModulePkg/Core/Dxe/Mem/pool.c
@@ -111,7 +111,7 @@ Returns:
for (Type=0; Type < EfiMaxMemoryType; Type++) {
PoolHead[Type].Signature = 0;
PoolHead[Type].Used = 0;
- PoolHead[Type].MemoryType = Type;
+ PoolHead[Type].MemoryType = (EFI_MEMORY_TYPE) Type;
for (Index=0; Index < MAX_POOL_LIST; Index++) {
InitializeListHead (&PoolHead[Type].FreeList[Index]);
}
@@ -119,7 +119,7 @@ Returns:
InitializeListHead (&PoolHeadList);
}
-
+STATIC
POOL *
LookupPoolHead (
IN EFI_MEMORY_TYPE MemoryType
diff --git a/EdkModulePkg/Core/DxeIplPeim/DxeLoad.c b/EdkModulePkg/Core/DxeIplPeim/DxeLoad.c
index b157b9304c..4d9ec5218a 100644
--- a/EdkModulePkg/Core/DxeIplPeim/DxeLoad.c
+++ b/EdkModulePkg/Core/DxeIplPeim/DxeLoad.c
@@ -355,14 +355,12 @@ Returns:
{
EFI_FIRMWARE_VOLUME_HEADER *FwVolHeader;
EFI_FFS_FILE_HEADER *FfsFileHeader;
- VOID *SectionData;
EFI_STATUS Status;
EFI_PEI_HOB_POINTERS Hob;
FwVolHeader = NULL;
FfsFileHeader = NULL;
- SectionData = NULL;
Status = EFI_SUCCESS;
//
@@ -654,7 +652,6 @@ Returns:
UINTN SectionLength;
UINTN OccupiedSectionLength;
UINT64 FileSize;
- EFI_GUID_DEFINED_SECTION *GuidedSectionHeader;
UINT32 AuthenticationStatus;
EFI_PEI_SECTION_EXTRACTION_PPI *SectionExtract;
UINT32 BufferSize;
@@ -697,10 +694,6 @@ Returns:
// Was the DXE Core file encapsulated in a GUID'd section?
//
if (Section->Type == EFI_SECTION_GUID_DEFINED) {
- //
- // Locate the GUID'd Section Extractor
- //
- GuidedSectionHeader = (VOID *) (Section + 1);
//
// This following code constitutes the addition of the security model
diff --git a/EdkModulePkg/Core/Pei/BootMode/BootMode.c b/EdkModulePkg/Core/Pei/BootMode/BootMode.c
index 049cfd1a8f..bec0304113 100644
--- a/EdkModulePkg/Core/Pei/BootMode/BootMode.c
+++ b/EdkModulePkg/Core/Pei/BootMode/BootMode.c
@@ -65,7 +65,7 @@ Returns:
return EFI_SUCCESS;
-};
+}
EFI_STATUS
@@ -103,4 +103,4 @@ Returns:
return EFI_SUCCESS;
-};
+}
diff --git a/EdkModulePkg/Core/Pei/Dependency/dependency.c b/EdkModulePkg/Core/Pei/Dependency/dependency.c
index 0d9d797826..c817a3d171 100644
--- a/EdkModulePkg/Core/Pei/Dependency/dependency.c
+++ b/EdkModulePkg/Core/Pei/Dependency/dependency.c
@@ -125,12 +125,10 @@ Returns:
well-formed Grammar.
--*/
{
- EFI_STATUS Status;
DEPENDENCY_EXPRESSION_OPERAND *Iterator;
EVAL_STACK_ENTRY *StackPtr;
EVAL_STACK_ENTRY EvalStack[MAX_GRAMMAR_SIZE];
- Status = EFI_SUCCESS;
Iterator = DependencyExpression;
*Runnable = FALSE;
diff --git a/EdkModulePkg/Core/Pei/Ipf/SwitchToCacheMode.c b/EdkModulePkg/Core/Pei/Ipf/SwitchToCacheMode.c
index 34018d3100..36b66f93d9 100644
--- a/EdkModulePkg/Core/Pei/Ipf/SwitchToCacheMode.c
+++ b/EdkModulePkg/Core/Pei/Ipf/SwitchToCacheMode.c
@@ -73,4 +73,4 @@ Returns:
}
return;
-}
\ No newline at end of file
+}
diff --git a/EdkModulePkg/Library/BaseUefiTianoDecompressLib/BaseUefiTianoDecompressLib.c b/EdkModulePkg/Library/BaseUefiTianoDecompressLib/BaseUefiTianoDecompressLib.c
index bbf88f93e7..3d3fc4c7cb 100644
--- a/EdkModulePkg/Library/BaseUefiTianoDecompressLib/BaseUefiTianoDecompressLib.c
+++ b/EdkModulePkg/Library/BaseUefiTianoDecompressLib/BaseUefiTianoDecompressLib.c
@@ -19,59 +19,7 @@ Abstract:
--*/
-//
-// Decompression algorithm begins here
-//
-#define BITBUFSIZ 32
-#define MAXMATCH 256
-#define THRESHOLD 3
-#define CODE_BIT 16
-#define BAD_TABLE - 1
-
-//
-// C: Char&Len Set; P: Position Set; T: exTra Set
-//
-#define NC (0xff + MAXMATCH + 2 - THRESHOLD)
-#define CBIT 9
-#define MAXPBIT 5
-#define TBIT 5
-#define MAXNP ((1U << MAXPBIT) - 1)
-#define NT (CODE_BIT + 3)
-#if NT > MAXNP
-#define NPT NT
-#else
-#define NPT MAXNP
-#endif
-
-typedef struct {
- UINT8 *mSrcBase; // Starting address of compressed data
- UINT8 *mDstBase; // Starting address of decompressed data
- UINT32 mOutBuf;
- UINT32 mInBuf;
-
- UINT16 mBitCount;
- UINT32 mBitBuf;
- UINT32 mSubBitBuf;
- UINT16 mBlockSize;
- UINT32 mCompSize;
- UINT32 mOrigSize;
-
- UINT16 mBadTableFlag;
-
- UINT16 mLeft[2 * NC - 1];
- UINT16 mRight[2 * NC - 1];
- UINT8 mCLen[NC];
- UINT8 mPTLen[NPT];
- UINT16 mCTable[4096];
- UINT16 mPTTable[256];
-
- //
- // The length of the field 'Position Set Code Length Array Size' in Block Header.
- // For EFI 1.1 de/compression algorithm, mPBit = 4
- // For Tiano de/compression algorithm, mPBit = 5
- //
- UINT8 mPBit;
-} SCRATCH_DATA;
+#include "BaseUefiTianoDecompressLibInternals.h"
VOID
FillBuf (
@@ -196,6 +144,8 @@ Returns:
UINT16 Avail;
UINT16 NextCode;
UINT16 Mask;
+ UINT16 WordOfStart;
+ UINT16 WordOfCount;
for (Index = 1; Index <= 16; Index++) {
Count[Index] = 0;
@@ -208,7 +158,9 @@ Returns:
Start[1] = 0;
for (Index = 1; Index <= 16; Index++) {
- Start[Index + 1] = (UINT16) (Start[Index] + (Count[Index] << (16 - Index)));
+ WordOfStart = Start[Index];
+ WordOfCount = Count[Index];
+ Start[Index + 1] = (UINT16) (WordOfStart + (WordOfCount << (16 - Index)));
}
if (Start[17] != 0) {
@@ -610,7 +562,7 @@ Returns: (VOID)
for (;;) {
CharC = DecodeC (Sd);
if (Sd->mBadTableFlag != 0) {
- return ;
+ goto Done ;
}
if (CharC < 256) {
@@ -618,7 +570,7 @@ Returns: (VOID)
// Process an Original character
//
if (Sd->mOutBuf >= Sd->mOrigSize) {
- return ;
+ goto Done ;
} else {
Sd->mDstBase[Sd->mOutBuf++] = (UINT8) CharC;
}
@@ -637,7 +589,7 @@ Returns: (VOID)
while ((INT16) (BytesRemain) >= 0) {
Sd->mDstBase[Sd->mOutBuf++] = Sd->mDstBase[DataIdx++];
if (Sd->mOutBuf >= Sd->mOrigSize) {
- return ;
+ goto Done ;
}
BytesRemain--;
@@ -645,6 +597,7 @@ Returns: (VOID)
}
}
+Done:
return ;
}
diff --git a/EdkModulePkg/Library/BaseUefiTianoDecompressLib/BaseUefiTianoDecompressLib.msa b/EdkModulePkg/Library/BaseUefiTianoDecompressLib/BaseUefiTianoDecompressLib.msa
index a484e1041c..eab5f543e3 100644
--- a/EdkModulePkg/Library/BaseUefiTianoDecompressLib/BaseUefiTianoDecompressLib.msa
+++ b/EdkModulePkg/Library/BaseUefiTianoDecompressLib/BaseUefiTianoDecompressLib.msa
@@ -37,6 +37,7 @@
BaseUefiTianoDecompressLib.c
+ BaseUefiTianoDecompressLibInternals.h
diff --git a/EdkModulePkg/Library/BaseUefiTianoDecompressLib/BaseUefiTianoDecompressLibInternals.h b/EdkModulePkg/Library/BaseUefiTianoDecompressLib/BaseUefiTianoDecompressLibInternals.h
new file mode 100644
index 0000000000..bb7aa5ae13
--- /dev/null
+++ b/EdkModulePkg/Library/BaseUefiTianoDecompressLib/BaseUefiTianoDecompressLibInternals.h
@@ -0,0 +1,224 @@
+/** @file
+ Internal include file for Base UEFI Decompress Libary.
+
+ Copyright (c) 2006, Intel Corporation
+ All rights reserved. This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+ Module Name: BaseUefiDecompressLibInternals.h
+
+**/
+
+#ifndef __BASE_UEFI_TIANO_DECOMPRESS_LIB_INTERNALS_H__
+#define __BASE_UEFI_TIANO_DECOMPRESS_LIB_INTERNALS_H__
+
+//
+// Decompression algorithm begins here
+//
+#define BITBUFSIZ 32
+#define MAXMATCH 256
+#define THRESHOLD 3
+#define CODE_BIT 16
+#define BAD_TABLE - 1
+
+//
+// C: Char&Len Set; P: Position Set; T: exTra Set
+//
+#define NC (0xff + MAXMATCH + 2 - THRESHOLD)
+#define CBIT 9
+#define MAXPBIT 5
+#define TBIT 5
+#define MAXNP ((1U << MAXPBIT) - 1)
+#define NT (CODE_BIT + 3)
+#if NT > MAXNP
+#define NPT NT
+#else
+#define NPT MAXNP
+#endif
+
+typedef struct {
+ UINT8 *mSrcBase; // Starting address of compressed data
+ UINT8 *mDstBase; // Starting address of decompressed data
+ UINT32 mOutBuf;
+ UINT32 mInBuf;
+
+ UINT16 mBitCount;
+ UINT32 mBitBuf;
+ UINT32 mSubBitBuf;
+ UINT16 mBlockSize;
+ UINT32 mCompSize;
+ UINT32 mOrigSize;
+
+ UINT16 mBadTableFlag;
+
+ UINT16 mLeft[2 * NC - 1];
+ UINT16 mRight[2 * NC - 1];
+ UINT8 mCLen[NC];
+ UINT8 mPTLen[NPT];
+ UINT16 mCTable[4096];
+ UINT16 mPTTable[256];
+
+ //
+ // The length of the field 'Position Set Code Length Array Size' in Block Header.
+ // For EFI 1.1 de/compression algorithm, mPBit = 4
+ // For Tiano de/compression algorithm, mPBit = 5
+ //
+ UINT8 mPBit;
+} SCRATCH_DATA;
+
+/**
+ Read NumOfBit of bits from source into mBitBuf
+
+ Shift mBitBuf NumOfBits left. Read in NumOfBits of bits from source.
+
+ @param Sd The global scratch data
+ @param NumOfBits The number of bits to shift and read.
+
+**/
+VOID
+FillBuf (
+ IN SCRATCH_DATA *Sd,
+ IN UINT16 NumOfBits
+ );
+
+/**
+ Get NumOfBits of bits out from mBitBuf
+
+ Get NumOfBits of bits out from mBitBuf. Fill mBitBuf with subsequent
+ NumOfBits of bits from source. Returns NumOfBits of bits that are
+ popped out.
+
+ @param Sd The global scratch data.
+ @param NumOfBits The number of bits to pop and read.
+
+ @return The bits that are popped out.
+
+**/
+UINT32
+GetBits (
+ IN SCRATCH_DATA *Sd,
+ IN UINT16 NumOfBits
+ );
+
+/**
+ Creates Huffman Code mapping table according to code length array.
+
+ Creates Huffman Code mapping table for Extra Set, Char&Len Set
+ and Position Set according to code length array.
+
+ @param Sd The global scratch data
+ @param NumOfChar Number of symbols in the symbol set
+ @param BitLen Code length array
+ @param TableBits The width of the mapping table
+ @param Table The table
+
+ @retval 0 OK.
+ @retval BAD_TABLE The table is corrupted.
+
+**/
+UINT16
+MakeTable (
+ IN SCRATCH_DATA *Sd,
+ IN UINT16 NumOfChar,
+ IN UINT8 *BitLen,
+ IN UINT16 TableBits,
+ OUT UINT16 *Table
+ );
+
+/**
+ Decodes a position value.
+
+ Get a position value according to Position Huffman Table.
+
+ @param Sd the global scratch data
+
+ @return The position value decoded.
+
+**/
+UINT32
+DecodeP (
+ IN SCRATCH_DATA *Sd
+ );
+
+/**
+ Reads code lengths for the Extra Set or the Position Set.
+
+ Read in the Extra Set or Pointion Set Length Arrary, then
+ generate the Huffman code mapping for them.
+
+ @param Sd The global scratch data.
+ @param nn Number of symbols.
+ @param nbit Number of bits needed to represent nn.
+ @param Special The special symbol that needs to be taken care of.
+
+ @retval 0 OK.
+ @retval BAD_TABLE Table is corrupted.
+
+**/
+UINT16
+ReadPTLen (
+ IN SCRATCH_DATA *Sd,
+ IN UINT16 nn,
+ IN UINT16 nbit,
+ IN UINT16 Special
+ );
+
+/**
+ Reads code lengths for Char&Len Set.
+
+ Read in and decode the Char&Len Set Code Length Array, then
+ generate the Huffman Code mapping table for the Char&Len Set.
+
+ @param Sd the global scratch data
+
+**/
+VOID
+ReadCLen (
+ SCRATCH_DATA *Sd
+ );
+
+/**
+ Decode a character/length value.
+
+ Read one value from mBitBuf, Get one code from mBitBuf. If it is at block boundary, generates
+ Huffman code mapping table for Extra Set, Code&Len Set and
+ Position Set.
+
+ @param Sd The global scratch data.
+
+ @return The value decoded.
+
+**/
+UINT16
+DecodeC (
+ SCRATCH_DATA *Sd
+ );
+
+/**
+ Decode the source data and put the resulting data into the destination buffer.
+
+ Decode the source data and put the resulting data into the destination buffer.
+
+ @param Sd The global scratch data
+
+**/
+VOID
+Decode (
+ SCRATCH_DATA *Sd
+ );
+
+RETURN_STATUS
+EFIAPI
+UefiTianoDecompress (
+ IN CONST VOID *Source,
+ IN OUT VOID *Destination,
+ IN OUT VOID *Scratch,
+ IN UINT32 Version
+ );
+
+#endif
diff --git a/EdkModulePkg/Library/EdkDxeRuntimeSalLib/Ipf/EsalServiceLib.c b/EdkModulePkg/Library/EdkDxeRuntimeSalLib/Ipf/EsalServiceLib.c
index 199b14becc..55a25b46ca 100644
--- a/EdkModulePkg/Library/EdkDxeRuntimeSalLib/Ipf/EsalServiceLib.c
+++ b/EdkModulePkg/Library/EdkDxeRuntimeSalLib/Ipf/EsalServiceLib.c
@@ -22,6 +22,7 @@ Abstract:
EXTENDED_SAL_BOOT_SERVICE_PROTOCOL *mEsalBootService = NULL;
EFI_PLABEL mPlabel;
+STATIC
EFI_STATUS
EFIAPI
DxeSalLibInitialize (
@@ -43,7 +44,7 @@ DxeSalLibInitialize (
// virtual). So lets grap the physical PLABEL for the EsalEntryPoint and store it
// away. We cache it in a module global, so we can register the vitrual version.
//
- Status = gBS->LocateProtocol (&gEfiExtendedSalBootServiceProtocolGuid, NULL, &mEsalBootService);
+ Status = gBS->LocateProtocol (&gEfiExtendedSalBootServiceProtocolGuid, NULL, (VOID **) &mEsalBootService);
if (EFI_ERROR (Status)) {
mEsalBootService = NULL;
return EFI_SUCCESS;
diff --git a/EdkModulePkg/Library/EdkGraphicsLib/Graphics.c b/EdkModulePkg/Library/EdkGraphicsLib/Graphics.c
index 4f0d37894e..c94234d017 100644
--- a/EdkModulePkg/Library/EdkGraphicsLib/Graphics.c
+++ b/EdkModulePkg/Library/EdkGraphicsLib/Graphics.c
@@ -105,7 +105,7 @@ Returns:
return EFI_NOT_FOUND;
}
-
+STATIC
EFI_STATUS
ConvertBmpToGopBlt (
IN VOID *BmpImage,
@@ -664,6 +664,7 @@ Returns:
UINT32 VerticalResolution;
UINT32 ColorDepth;
UINT32 RefreshRate;
+ UINTN BufferGlyphWidth;
GlyphStatus = 0;
@@ -743,6 +744,7 @@ Returns:
//
// Blt a character to the screen
//
+ BufferGlyphWidth = GLYPH_WIDTH * StrLen (Buffer);
if (GraphicsOutput != NULL) {
Status = GraphicsOutput->Blt (
GraphicsOutput,
@@ -752,9 +754,9 @@ Returns:
0,
X,
Y,
- GLYPH_WIDTH * StrLen (Buffer),
+ BufferGlyphWidth,
GLYPH_HEIGHT,
- GLYPH_WIDTH * StrLen (Buffer) * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL)
+ BufferGlyphWidth * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL)
);
} else {
Status = UgaDraw->Blt (
@@ -765,9 +767,9 @@ Returns:
0,
X,
Y,
- GLYPH_WIDTH * StrLen (Buffer),
+ BufferGlyphWidth,
GLYPH_HEIGHT,
- GLYPH_WIDTH * StrLen (Buffer) * sizeof (EFI_UGA_PIXEL)
+ BufferGlyphWidth * sizeof (EFI_UGA_PIXEL)
);
}
diff --git a/EdkModulePkg/Library/EdkIfrSupportLib/IfrCommon.c b/EdkModulePkg/Library/EdkIfrSupportLib/IfrCommon.c
index cff559cf4d..b2c906476d 100644
--- a/EdkModulePkg/Library/EdkIfrSupportLib/IfrCommon.c
+++ b/EdkModulePkg/Library/EdkIfrSupportLib/IfrCommon.c
@@ -128,6 +128,8 @@ Returns:
UINT8 *Destination;
UINTN Index;
BOOLEAN Finished;
+ UINTN SizeofLanguage;
+ UINTN SizeofString;
StringPack = (EFI_HII_STRING_PACK *) StringBuffer;
Finished = FALSE;
@@ -248,14 +250,16 @@ Returns:
//
// Pointing to a new string pack location
//
+ SizeofLanguage = StrSize (Language);
+ SizeofString = StrSize (String);
StringPackBuffer->Header.Length = (UINT32)
(
sizeof (EFI_HII_STRING_PACK) -
sizeof (EFI_STRING) +
sizeof (RELOFST) +
sizeof (RELOFST) +
- StrSize (Language) +
- StrSize (String)
+ SizeofLanguage +
+ SizeofString
);
StringPackBuffer->Header.Type = EFI_HII_STRING;
StringPackBuffer->LanguageNameString = (UINT16) ((UINTN) &PackDestination[3] - (UINTN) StringPackBuffer);
@@ -423,7 +427,7 @@ Returns:
return EFI_SUCCESS;
}
-
+STATIC
EFI_STATUS
GetHiiInterface (
OUT EFI_HII_PROTOCOL **Hii
diff --git a/EdkModulePkg/Library/EdkIfrSupportLib/IfrVariable.c b/EdkModulePkg/Library/EdkIfrSupportLib/IfrVariable.c
index 3e37553668..a4aab0ff01 100644
--- a/EdkModulePkg/Library/EdkIfrSupportLib/IfrVariable.c
+++ b/EdkModulePkg/Library/EdkIfrSupportLib/IfrVariable.c
@@ -467,11 +467,15 @@ Returns:
{
EFI_STATUS Status;
CHAR16 *NameSuffixed;
+ UINTN NameLength;
+ UINTN SuffixLength;
//
// enough to concatenate both strings.
//
- NameSuffixed = AllocateZeroPool ((StrLen (Name) + StrLen (Suffix) + 1) * sizeof (CHAR16));
+ NameLength = StrLen (Name);
+ SuffixLength = StrLen (Suffix);
+ NameSuffixed = AllocateZeroPool ((NameLength + SuffixLength + 1) * sizeof (CHAR16));
StrCpy (NameSuffixed, Name);
StrCat (NameSuffixed, Suffix);
diff --git a/EdkModulePkg/Library/EdkPeCoffLoaderLib/EdkPeCoffLoader.c b/EdkModulePkg/Library/EdkPeCoffLoaderLib/EdkPeCoffLoader.c
index 86421dbff0..0c22e7d79b 100644
--- a/EdkModulePkg/Library/EdkPeCoffLoaderLib/EdkPeCoffLoader.c
+++ b/EdkModulePkg/Library/EdkPeCoffLoaderLib/EdkPeCoffLoader.c
@@ -20,7 +20,7 @@ Abstract:
--*/
-
+#include "EdkPeCoffLoaderLibInternals.h"
EFI_STATUS
EFIAPI
diff --git a/EdkModulePkg/Library/EdkPeCoffLoaderLib/EdkPeCoffLoaderLib.msa b/EdkModulePkg/Library/EdkPeCoffLoaderLib/EdkPeCoffLoaderLib.msa
index 09c1806016..d17b937225 100644
--- a/EdkModulePkg/Library/EdkPeCoffLoaderLib/EdkPeCoffLoaderLib.msa
+++ b/EdkModulePkg/Library/EdkPeCoffLoaderLib/EdkPeCoffLoaderLib.msa
@@ -31,6 +31,7 @@
EdkPeCoffLoader.c
+ EdkPeCoffLoaderLibInternals.h
diff --git a/EdkModulePkg/Library/EdkPeCoffLoaderLib/EdkPeCoffLoaderLibInternals.h b/EdkModulePkg/Library/EdkPeCoffLoaderLib/EdkPeCoffLoaderLibInternals.h
new file mode 100644
index 0000000000..b356724cf5
--- /dev/null
+++ b/EdkModulePkg/Library/EdkPeCoffLoaderLib/EdkPeCoffLoaderLibInternals.h
@@ -0,0 +1,48 @@
+/** @file
+ Declaration of internal functions in PE/COFF Lib.
+
+ Copyright (c) 2006, Intel Corporation
+ All rights reserved. This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+ Module Name: BasePeCoffLibInternals.h
+
+**/
+
+#ifndef __PECOFF_LOADER_LIB_INTERNALS__
+#define __PECOFF_LOADER_LIB_INTERNALS__
+
+EFI_STATUS
+EFIAPI
+TianoPeCoffLoaderLibGetImageInfo (
+ IN EFI_PEI_PE_COFF_LOADER_PROTOCOL *This,
+ IN OUT PE_COFF_LOADER_IMAGE_CONTEXT *ImageContext
+ );
+
+EFI_STATUS
+EFIAPI
+TianoPeCoffLoaderLibLoadImage (
+ IN EFI_PEI_PE_COFF_LOADER_PROTOCOL *This,
+ IN OUT PE_COFF_LOADER_IMAGE_CONTEXT *ImageContext
+ );
+
+EFI_STATUS
+EFIAPI
+TianoPeCoffLoaderLibRelocateImage (
+ IN EFI_PEI_PE_COFF_LOADER_PROTOCOL *This,
+ IN OUT PE_COFF_LOADER_IMAGE_CONTEXT *ImageContext
+ );
+
+EFI_STATUS
+EFIAPI
+TianoPeCoffLoaderLibUnloadimage (
+ IN EFI_PEI_PE_COFF_LOADER_PROTOCOL *This,
+ IN PE_COFF_LOADER_IMAGE_CONTEXT *ImageContext
+ );
+
+#endif
diff --git a/EdkModulePkg/Library/EdkUefiRuntimeLib/Ipf/RuntimeLib.c b/EdkModulePkg/Library/EdkUefiRuntimeLib/Ipf/RuntimeLib.c
index 9fa1d1610d..530f52fff9 100644
--- a/EdkModulePkg/Library/EdkUefiRuntimeLib/Ipf/RuntimeLib.c
+++ b/EdkModulePkg/Library/EdkUefiRuntimeLib/Ipf/RuntimeLib.c
@@ -52,6 +52,7 @@ Returns:
}
}
+STATIC
VOID
EFIAPI
RuntimeLibVirtualNotifyEvent (
diff --git a/EdkModulePkg/Universal/Console/ConSplitter/Dxe/ConSplitter.c b/EdkModulePkg/Universal/Console/ConSplitter/Dxe/ConSplitter.c
index 973f13d0f3..34d6f266e9 100644
--- a/EdkModulePkg/Universal/Console/ConSplitter/Dxe/ConSplitter.c
+++ b/EdkModulePkg/Universal/Console/ConSplitter/Dxe/ConSplitter.c
@@ -531,6 +531,7 @@ ConSplitterTextOutConstructor (
return Status;
}
+STATIC
EFI_STATUS
ConSplitterSupported (
IN EFI_DRIVER_BINDING_PROTOCOL *This,
@@ -717,6 +718,7 @@ Returns:
);
}
+STATIC
EFI_STATUS
EFIAPI
ConSplitterStart (
@@ -1026,6 +1028,7 @@ Returns:
return Status;
}
+STATIC
EFI_STATUS
EFIAPI
ConSplitterStop (
@@ -1499,6 +1502,7 @@ Returns:
return EFI_NOT_FOUND;
}
+STATIC
EFI_STATUS
ConSplitterGrowMapTable (
IN TEXT_OUT_SPLITTER_PRIVATE_DATA *Private
@@ -1575,6 +1579,7 @@ Returns:
return EFI_SUCCESS;
}
+STATIC
EFI_STATUS
ConSplitterAddOutputMode (
IN TEXT_OUT_SPLITTER_PRIVATE_DATA *Private,
@@ -1642,6 +1647,7 @@ Returns:
return EFI_SUCCESS;
}
+STATIC
VOID
ConSplitterGetIntersection (
IN INT32 *TextOutModeMap,
@@ -1694,6 +1700,7 @@ ConSplitterGetIntersection (
return ;
}
+STATIC
VOID
ConSplitterSyncOutputMode (
IN TEXT_OUT_SPLITTER_PRIVATE_DATA *Private,
@@ -1712,7 +1719,6 @@ Returns:
--*/
{
- INT32 CurrentMode;
INT32 CurrentMaxMode;
INT32 Mode;
INT32 Index;
@@ -1726,7 +1732,6 @@ Returns:
//
// Must make sure that current mode won't change even if mode number changes
//
- CurrentMode = Private->TextOutMode.Mode;
CurrentMaxMode = Private->TextOutMode.MaxMode;
TextOutModeMap = Private->TextOutModeMap;
StepSize = Private->TextOutListCount;
@@ -1771,6 +1776,7 @@ Returns:
return ;
}
+STATIC
EFI_STATUS
ConSplitterGetIntersectionBetweenConOutAndStrErr (
VOID
@@ -1796,8 +1802,6 @@ Returns:
UINTN Indexj;
UINTN Rows;
UINTN Columns;
- INT32 ConOutCurrentMode;
- INT32 StdErrCurrentMode;
INT32 ConOutMaxMode;
INT32 StdErrMaxMode;
INT32 Mode;
@@ -1808,8 +1812,6 @@ Returns:
INT32 *StdErrMapTable;
TEXT_OUT_SPLITTER_QUERY_DATA *ConOutQueryData;
TEXT_OUT_SPLITTER_QUERY_DATA *StdErrQueryData;
- UINTN ConOutStepSize;
- UINTN StdErrStepSize;
BOOLEAN FoundTheSameTextOut;
UINTN ConOutMapTableSize;
UINTN StdErrMapTableSize;
@@ -1843,16 +1845,12 @@ Returns:
//
// Must make sure that current mode won't change even if mode number changes
//
- ConOutCurrentMode = mConOut.TextOutMode.Mode;
ConOutMaxMode = mConOut.TextOutMode.MaxMode;
ConOutModeMap = mConOut.TextOutModeMap;
- ConOutStepSize = mConOut.TextOutListCount;
ConOutQueryData = mConOut.TextOutQueryData;
- StdErrCurrentMode = mStdErr.TextOutMode.Mode;
StdErrMaxMode = mStdErr.TextOutMode.MaxMode;
StdErrModeMap = mStdErr.TextOutModeMap;
- StdErrStepSize = mStdErr.TextOutListCount;
StdErrQueryData = mStdErr.TextOutQueryData;
//
@@ -1933,6 +1931,7 @@ Returns:
}
#if (EFI_SPECIFICATION_VERSION >= 0x00020000)
+STATIC
EFI_STATUS
ConSplitterAddGraphicsOutputMode (
IN TEXT_OUT_SPLITTER_PRIVATE_DATA *Private,
@@ -2726,6 +2725,7 @@ ConSplitterSimplePointerReset (
return ReturnStatus;
}
+STATIC
EFI_STATUS
EFIAPI
ConSplitterSimplePointerPrivateGetState (
diff --git a/EdkModulePkg/Universal/Console/ConSplitter/Dxe/ConSplitter.h b/EdkModulePkg/Universal/Console/ConSplitter/Dxe/ConSplitter.h
index 8ca743cbe5..4509390e83 100644
--- a/EdkModulePkg/Universal/Console/ConSplitter/Dxe/ConSplitter.h
+++ b/EdkModulePkg/Universal/Console/ConSplitter/Dxe/ConSplitter.h
@@ -578,7 +578,7 @@ DevNullGopSync (
)
;
-#if (EFI_SPECIFICATION < 0x00020000)
+#if (EFI_SPECIFICATION_VERSION < 0x00020000)
EFI_STATUS
EFIAPI
ConSpliterUgaDrawGetMode (
diff --git a/EdkModulePkg/Universal/Console/ConSplitter/Dxe/ConSplitterGraphics.c b/EdkModulePkg/Universal/Console/ConSplitter/Dxe/ConSplitterGraphics.c
index 4bc15e6681..cec8adb2fb 100644
--- a/EdkModulePkg/Universal/Console/ConSplitter/Dxe/ConSplitterGraphics.c
+++ b/EdkModulePkg/Universal/Console/ConSplitter/Dxe/ConSplitterGraphics.c
@@ -355,6 +355,7 @@ Routine Description:
return ReturnStatus;
}
+STATIC
EFI_STATUS
DevNullGraphicsOutputBlt (
IN TEXT_OUT_SPLITTER_PRIVATE_DATA *Private,
diff --git a/EdkModulePkg/Universal/Console/GraphicsConsole/Dxe/GraphicsConsole.c b/EdkModulePkg/Universal/Console/GraphicsConsole/Dxe/GraphicsConsole.c
index 25b0429b1b..866aaad444 100644
--- a/EdkModulePkg/Universal/Console/GraphicsConsole/Dxe/GraphicsConsole.c
+++ b/EdkModulePkg/Universal/Console/GraphicsConsole/Dxe/GraphicsConsole.c
@@ -1032,10 +1032,8 @@ GraphicsConsoleConOutTestString (
UINT16 GlyphWidth;
UINT32 GlyphStatus;
UINT16 Count;
- GRAPHICS_CONSOLE_DEV *Private;
GLYPH_UNION *Glyph;
- Private = GRAPHICS_CONSOLE_CON_OUT_DEV_FROM_THIS (This);
GlyphStatus = 0;
Count = 0;
diff --git a/EdkModulePkg/Universal/Console/Terminal/Dxe/Terminal.c b/EdkModulePkg/Universal/Console/Terminal/Dxe/Terminal.c
index 6621b64ace..45eb632e26 100644
--- a/EdkModulePkg/Universal/Console/Terminal/Dxe/Terminal.c
+++ b/EdkModulePkg/Universal/Console/Terminal/Dxe/Terminal.c
@@ -402,9 +402,9 @@ TerminalDriverBindingStart (
Mode->BaudRate,
Mode->ReceiveFifoDepth,
(UINT32) SerialInTimeOut,
- Mode->Parity,
+ (EFI_PARITY_TYPE) (Mode->Parity),
(UINT8) Mode->DataBits,
- Mode->StopBits
+ (EFI_STOP_BITS_TYPE) (Mode->StopBits)
);
if (EFI_ERROR (Status)) {
//
@@ -897,6 +897,7 @@ TerminalUpdateConsoleDevVariable (
VariableSize,
Variable
);
+ ASSERT_EFI_ERROR (Status);
gBS->FreePool (Variable);
return ;
@@ -1015,6 +1016,7 @@ TerminalRemoveConsoleDevVariable (
VariableSize,
NewVariable
);
+ ASSERT_EFI_ERROR (Status);
}
if (NewVariable != NULL) {
diff --git a/EdkModulePkg/Universal/Console/Terminal/Dxe/TerminalConIn.c b/EdkModulePkg/Universal/Console/Terminal/Dxe/TerminalConIn.c
index 3c621384f8..4dbb17eaf7 100644
--- a/EdkModulePkg/Universal/Console/Terminal/Dxe/TerminalConIn.c
+++ b/EdkModulePkg/Universal/Console/Terminal/Dxe/TerminalConIn.c
@@ -268,9 +268,9 @@ TerminalConInCheckForKey (
Mode->BaudRate,
Mode->ReceiveFifoDepth,
(UINT32) SerialInTimeOut,
- Mode->Parity,
+ (EFI_PARITY_TYPE) (Mode->Parity),
(UINT8) Mode->DataBits,
- Mode->StopBits
+ (EFI_STOP_BITS_TYPE) (Mode->StopBits)
);
if (EFI_ERROR (Status)) {
@@ -681,6 +681,7 @@ UnicodeFiFoGetKeyCount (
}
}
+STATIC
VOID
UnicodeToEfiKeyFlushState (
IN TERMINAL_DEV *TerminalDevice
@@ -1162,6 +1163,7 @@ ESC R ESC r ESC R = Reset System
TimerRelative,
(UINT64)20000000
);
+ ASSERT_EFI_ERROR (Status);
continue;
}
diff --git a/EdkModulePkg/Universal/DataHub/DataHub/Dxe/DataHub.c b/EdkModulePkg/Universal/DataHub/DataHub/Dxe/DataHub.c
index 01e7a6ed69..0ff5b4fd87 100644
--- a/EdkModulePkg/Universal/DataHub/DataHub/Dxe/DataHub.c
+++ b/EdkModulePkg/Universal/DataHub/DataHub/Dxe/DataHub.c
@@ -50,6 +50,7 @@ GetNextDataRecord (
IN OUT UINT64 *PtrCurrentMTC
);
+STATIC
EFI_STATUS
EFIAPI
DataHubLogData (
@@ -177,6 +178,7 @@ Returns:
return EFI_SUCCESS;
}
+STATIC
EFI_STATUS
EFIAPI
DataHubGetNextRecord (
@@ -306,6 +308,7 @@ Returns:
return EFI_SUCCESS;
}
+STATIC
EFI_STATUS
EFIAPI
DataHubRegisterFilterDriver (
@@ -404,6 +407,7 @@ Returns:
return EFI_SUCCESS;
}
+STATIC
EFI_STATUS
EFIAPI
DataHubUnregisterFilterDriver (
diff --git a/EdkModulePkg/Universal/DebugSupport/Dxe/ipf/plDebugSupport.h b/EdkModulePkg/Universal/DebugSupport/Dxe/ipf/plDebugSupport.h
index 10563ec8d1..71c9578e1e 100644
--- a/EdkModulePkg/Universal/DebugSupport/Dxe/ipf/plDebugSupport.h
+++ b/EdkModulePkg/Universal/DebugSupport/Dxe/ipf/plDebugSupport.h
@@ -294,4 +294,26 @@ Returns:
--*/
;
+VOID
+CommonHandler (
+ IN EFI_EXCEPTION_TYPE ExceptionType,
+ IN EFI_SYSTEM_CONTEXT Context
+ )
+/*++
+
+Routine Description:
+ C routine that is called for all registered exceptions. This is the main
+ exception dispatcher. Must be public because it's referenced from AsmFuncs.s.
+
+Arguments:
+ ExceptionType - Exception Type
+ Context - System Context
+
+Returns:
+
+ Nothing
+
+--*/
+;
+
#endif
diff --git a/EdkModulePkg/Universal/Debugger/Debugport/Dxe/DebugPort.c b/EdkModulePkg/Universal/Debugger/Debugport/Dxe/DebugPort.c
index 2152f75cf4..88d19d4ad0 100644
--- a/EdkModulePkg/Universal/Debugger/Debugport/Dxe/DebugPort.c
+++ b/EdkModulePkg/Universal/Debugger/Debugport/Dxe/DebugPort.c
@@ -29,19 +29,91 @@ Revision History
#include "DebugPort.h"
//
-// Misc. functions local to this module
+// Misc. functions local to this module..
//
STATIC
VOID
GetDebugPortVariable (
- DEBUGPORT_DEVICE *DebugPortDevice
- );
+ DEBUGPORT_DEVICE *DebugPortDevice
+ )
+/*++
-EFI_STATUS
-EFIAPI
-ImageUnloadHandler (
- EFI_HANDLE ImageHandle
- );
+Routine Description:
+ Local worker function to obtain device path information from DebugPort variable.
+ Records requested settings in DebugPort device structure.
+
+Arguments:
+ DEBUGPORT_DEVICE *DebugPortDevice,
+
+Returns:
+
+ Nothing
+
+--*/
+{
+ UINTN DataSize;
+ EFI_DEVICE_PATH_PROTOCOL *DevicePath;
+ EFI_STATUS Status;
+
+ DataSize = 0;
+
+ Status = gRT->GetVariable (
+ (CHAR16 *) EFI_DEBUGPORT_VARIABLE_NAME,
+ &gEfiDebugPortVariableGuid,
+ NULL,
+ &DataSize,
+ DebugPortDevice->DebugPortVariable
+ );
+
+ if (Status == EFI_BUFFER_TOO_SMALL) {
+ if (gDebugPortDevice->DebugPortVariable != NULL) {
+ gBS->FreePool (gDebugPortDevice->DebugPortVariable);
+ }
+
+ DebugPortDevice->DebugPortVariable = AllocatePool (DataSize);
+ if (DebugPortDevice->DebugPortVariable != NULL) {
+ gRT->GetVariable (
+ (CHAR16 *) EFI_DEBUGPORT_VARIABLE_NAME,
+ &gEfiDebugPortVariableGuid,
+ NULL,
+ &DataSize,
+ DebugPortDevice->DebugPortVariable
+ );
+ DevicePath = (EFI_DEVICE_PATH_PROTOCOL *) DebugPortDevice->DebugPortVariable;
+ while (!EfiIsDevicePathEnd (DevicePath) && !EfiIsUartDevicePath (DevicePath)) {
+ DevicePath = EfiNextDevicePathNode (DevicePath);
+ }
+
+ if (EfiIsDevicePathEnd (DevicePath)) {
+ gBS->FreePool (gDebugPortDevice->DebugPortVariable);
+ DebugPortDevice->DebugPortVariable = NULL;
+ } else {
+ gBS->CopyMem (
+ &DebugPortDevice->BaudRate,
+ &((UART_DEVICE_PATH *) DevicePath)->BaudRate,
+ sizeof (((UART_DEVICE_PATH *) DevicePath)->BaudRate)
+ );
+ DebugPortDevice->ReceiveFifoDepth = DEBUGPORT_UART_DEFAULT_FIFO_DEPTH;
+ DebugPortDevice->Timeout = DEBUGPORT_UART_DEFAULT_TIMEOUT;
+ gBS->CopyMem (
+ &DebugPortDevice->Parity,
+ &((UART_DEVICE_PATH *) DevicePath)->Parity,
+ sizeof (((UART_DEVICE_PATH *) DevicePath)->Parity)
+ );
+ gBS->CopyMem (
+ &DebugPortDevice->DataBits,
+ &((UART_DEVICE_PATH *) DevicePath)->DataBits,
+ sizeof (((UART_DEVICE_PATH *) DevicePath)->DataBits)
+ );
+ gBS->CopyMem (
+ &DebugPortDevice->StopBits,
+ &((UART_DEVICE_PATH *) DevicePath)->StopBits,
+ sizeof (((UART_DEVICE_PATH *) DevicePath)->StopBits)
+ );
+ }
+ }
+ }
+}
//
// Globals
@@ -57,8 +129,6 @@ EFI_DRIVER_BINDING_PROTOCOL gDebugPortDriverBinding = {
};
DEBUGPORT_DEVICE *gDebugPortDevice;
-static UINT32 mHid16550;
-static UINT32 mHidStdPcComPort;
//
// implementation code
@@ -90,9 +160,6 @@ Returns:
--*/
{
- mHid16550 = EFI_ACPI_16550UART_HID;
- mHidStdPcComPort = EFI_ACPI_PC_COMPORT_HID;
-
//
// Allocate and Initialize dev structure
//
@@ -113,9 +180,9 @@ Returns:
gDebugPortDevice->BaudRate = DEBUGPORT_UART_DEFAULT_BAUDRATE;
gDebugPortDevice->ReceiveFifoDepth = DEBUGPORT_UART_DEFAULT_FIFO_DEPTH;
gDebugPortDevice->Timeout = DEBUGPORT_UART_DEFAULT_TIMEOUT;
- gDebugPortDevice->Parity = DEBUGPORT_UART_DEFAULT_PARITY;
+ gDebugPortDevice->Parity = (EFI_PARITY_TYPE) DEBUGPORT_UART_DEFAULT_PARITY;
gDebugPortDevice->DataBits = DEBUGPORT_UART_DEFAULT_DATA_BITS;
- gDebugPortDevice->StopBits = DEBUGPORT_UART_DEFAULT_STOP_BITS;
+ gDebugPortDevice->StopBits = (EFI_STOP_BITS_TYPE) DEBUGPORT_UART_DEFAULT_STOP_BITS;
return EFI_SUCCESS;
}
@@ -521,11 +588,9 @@ Returns:
--*/
{
- DEBUGPORT_DEVICE *DebugPortDevice;
UINTN BufferSize;
UINTN BitBucket;
- DebugPortDevice = DEBUGPORT_DEVICE_FROM_THIS (This);
while (This->Poll (This) == EFI_SUCCESS) {
BufferSize = 1;
This->Read (This, 0, &BufferSize, &BitBucket);
@@ -694,92 +759,6 @@ Returns:
return Status;
}
-//
-// Misc. functions local to this module..
-//
-STATIC
-VOID
-GetDebugPortVariable (
- DEBUGPORT_DEVICE *DebugPortDevice
- )
-/*++
-
-Routine Description:
- Local worker function to obtain device path information from DebugPort variable.
- Records requested settings in DebugPort device structure.
-
-Arguments:
- DEBUGPORT_DEVICE *DebugPortDevice,
-
-Returns:
-
- Nothing
-
---*/
-{
- UINTN DataSize;
- EFI_DEVICE_PATH_PROTOCOL *DevicePath;
- EFI_STATUS Status;
-
- DataSize = 0;
-
- Status = gRT->GetVariable (
- (CHAR16 *) EFI_DEBUGPORT_VARIABLE_NAME,
- &gEfiDebugPortVariableGuid,
- NULL,
- &DataSize,
- DebugPortDevice->DebugPortVariable
- );
-
- if (Status == EFI_BUFFER_TOO_SMALL) {
- if (gDebugPortDevice->DebugPortVariable != NULL) {
- gBS->FreePool (gDebugPortDevice->DebugPortVariable);
- }
-
- DebugPortDevice->DebugPortVariable = AllocatePool (DataSize);
- if (DebugPortDevice->DebugPortVariable != NULL) {
- gRT->GetVariable (
- (CHAR16 *) EFI_DEBUGPORT_VARIABLE_NAME,
- &gEfiDebugPortVariableGuid,
- NULL,
- &DataSize,
- DebugPortDevice->DebugPortVariable
- );
- DevicePath = (EFI_DEVICE_PATH_PROTOCOL *) DebugPortDevice->DebugPortVariable;
- while (!EfiIsDevicePathEnd (DevicePath) && !EfiIsUartDevicePath (DevicePath)) {
- DevicePath = EfiNextDevicePathNode (DevicePath);
- }
-
- if (EfiIsDevicePathEnd (DevicePath)) {
- gBS->FreePool (gDebugPortDevice->DebugPortVariable);
- DebugPortDevice->DebugPortVariable = NULL;
- } else {
- gBS->CopyMem (
- &DebugPortDevice->BaudRate,
- &((UART_DEVICE_PATH *) DevicePath)->BaudRate,
- sizeof (((UART_DEVICE_PATH *) DevicePath)->BaudRate)
- );
- DebugPortDevice->ReceiveFifoDepth = DEBUGPORT_UART_DEFAULT_FIFO_DEPTH;
- DebugPortDevice->Timeout = DEBUGPORT_UART_DEFAULT_TIMEOUT;
- gBS->CopyMem (
- &DebugPortDevice->Parity,
- &((UART_DEVICE_PATH *) DevicePath)->Parity,
- sizeof (((UART_DEVICE_PATH *) DevicePath)->Parity)
- );
- gBS->CopyMem (
- &DebugPortDevice->DataBits,
- &((UART_DEVICE_PATH *) DevicePath)->DataBits,
- sizeof (((UART_DEVICE_PATH *) DevicePath)->DataBits)
- );
- gBS->CopyMem (
- &DebugPortDevice->StopBits,
- &((UART_DEVICE_PATH *) DevicePath)->StopBits,
- sizeof (((UART_DEVICE_PATH *) DevicePath)->StopBits)
- );
- }
- }
- }
-}
EFI_STATUS
EFIAPI
diff --git a/EdkModulePkg/Universal/DevicePath/Dxe/DevicePathFromText.c b/EdkModulePkg/Universal/DevicePath/Dxe/DevicePathFromText.c
index aff628b54a..cce223fe03 100644
--- a/EdkModulePkg/Universal/DevicePath/Dxe/DevicePathFromText.c
+++ b/EdkModulePkg/Universal/DevicePath/Dxe/DevicePathFromText.c
@@ -21,6 +21,7 @@ Abstract:
#include "DevicePath.h"
+STATIC
CHAR16 *
StrDuplicate (
IN CONST CHAR16 *Src
@@ -48,6 +49,7 @@ StrDuplicate (
return ReturnStr;
}
+STATIC
CHAR16 *
GetParamByNodeName (
IN CHAR16 *Str,
@@ -118,6 +120,7 @@ GetParamByNodeName (
return ParamStr;
}
+STATIC
CHAR16 *
SplitStr (
IN OUT CHAR16 **List,
@@ -176,6 +179,7 @@ SplitStr (
return ReturnStr;
}
+STATIC
CHAR16 *
GetNextParamStr (
IN OUT CHAR16 **List
@@ -187,6 +191,7 @@ GetNextParamStr (
return SplitStr (List, L',');
}
+STATIC
CHAR16 *
GetNextDeviceNodeStr (
IN OUT CHAR16 **DevicePath,
@@ -273,6 +278,7 @@ GetNextDeviceNodeStr (
return ReturnStr;
}
+STATIC
BOOLEAN
IsHexDigit (
OUT UINT8 *Digit,
@@ -312,6 +318,7 @@ IsHexDigit (
return FALSE;
}
+STATIC
CHAR16
NibbleToHexChar (
IN UINT8 Nibble
@@ -337,6 +344,7 @@ NibbleToHexChar (
return (CHAR16)(Nibble - 0xA + L'A');
}
+STATIC
EFI_STATUS
HexStringToBuf (
IN OUT UINT8 *Buf,
@@ -410,7 +418,7 @@ HexStringToBuf (
} else {
Byte = Buf[Idx / 2];
Byte &= 0x0F;
- Byte |= Digit << 4;
+ Byte = (UINT8) (Byte | Digit << 4);
}
Buf[Idx / 2] = Byte;
@@ -423,6 +431,7 @@ HexStringToBuf (
return EFI_SUCCESS;
}
+STATIC
EFI_STATUS
BufToHexString (
IN OUT CHAR16 *Str,
@@ -481,6 +490,7 @@ BufToHexString (
return EFI_SUCCESS;
}
+STATIC
CHAR16 *
TrimHexStr (
IN CHAR16 *Str
@@ -519,6 +529,7 @@ TrimHexStr (
return Str;
}
+STATIC
UINTN
Xtoi (
IN CHAR16 *Str
@@ -552,6 +563,7 @@ Returns:
return Rvalue;
}
+STATIC
VOID
Xtoi64 (
IN CHAR16 *Str,
@@ -578,6 +590,7 @@ Returns:
HexStringToBuf ((UINT8 *) Data, &Length, TrimHexStr (Str), NULL);
}
+STATIC
UINTN
Atoi (
IN CHAR16 *str
@@ -633,6 +646,7 @@ Returns:
return Rvalue;
}
+STATIC
EFI_STATUS
StrToBuf (
OUT UINT8 *Buf,
@@ -659,11 +673,11 @@ StrToBuf (
// and for even characters, the lower nibble.
//
if ((Index & 1) == 0) {
- Byte = Digit << 4;
+ Byte = (UINT8) (Digit << 4);
} else {
Byte = Buf[Index / 2];
Byte &= 0xF0;
- Byte |= Digit;
+ Byte = (UINT8) (Byte | Digit);
}
Buf[Index / 2] = Byte;
@@ -672,6 +686,7 @@ StrToBuf (
return EFI_SUCCESS;
}
+STATIC
EFI_STATUS
StrToGuid (
IN CHAR16 *Str,
@@ -734,6 +749,7 @@ StrToGuid (
return EFI_SUCCESS;
}
+STATIC
VOID
StrToIPv4Addr (
IN OUT CHAR16 **Str,
@@ -747,6 +763,7 @@ StrToIPv4Addr (
}
}
+STATIC
VOID
StrToIPv6Addr (
IN OUT CHAR16 **Str,
@@ -763,6 +780,7 @@ StrToIPv6Addr (
}
}
+STATIC
VOID
StrToAscii (
IN CHAR16 *Str,
@@ -783,6 +801,7 @@ StrToAscii (
*AsciiStr = Dest + 1;
}
+STATIC
EFI_DEVICE_PATH_PROTOCOL *
DevPathFromTextPci (
IN CHAR16 *TextDeviceNode
@@ -806,6 +825,7 @@ DevPathFromTextPci (
return (EFI_DEVICE_PATH_PROTOCOL *) Pci;
}
+STATIC
EFI_DEVICE_PATH_PROTOCOL *
DevPathFromTextPcCard (
IN CHAR16 *TextDeviceNode
@@ -826,6 +846,7 @@ DevPathFromTextPcCard (
return (EFI_DEVICE_PATH_PROTOCOL *) Pccard;
}
+STATIC
EFI_DEVICE_PATH_PROTOCOL *
DevPathFromTextMemoryMapped (
IN CHAR16 *TextDeviceNode
@@ -851,6 +872,7 @@ DevPathFromTextMemoryMapped (
return (EFI_DEVICE_PATH_PROTOCOL *) MemMap;
}
+STATIC
EFI_DEVICE_PATH_PROTOCOL *
ConvertFromTextVendor (
IN CHAR16 *TextDeviceNode,
@@ -884,6 +906,7 @@ ConvertFromTextVendor (
return (EFI_DEVICE_PATH_PROTOCOL *) Vendor;
}
+STATIC
EFI_DEVICE_PATH_PROTOCOL *
DevPathFromTextVenHw (
IN CHAR16 *TextDeviceNode
@@ -896,6 +919,7 @@ DevPathFromTextVenHw (
);
}
+STATIC
EFI_DEVICE_PATH_PROTOCOL *
DevPathFromTextCtrl (
IN CHAR16 *TextDeviceNode
@@ -915,6 +939,7 @@ DevPathFromTextCtrl (
return (EFI_DEVICE_PATH_PROTOCOL *) Controller;
}
+STATIC
EFI_DEVICE_PATH_PROTOCOL *
DevPathFromTextAcpi (
IN CHAR16 *TextDeviceNode
@@ -942,6 +967,7 @@ DevPathFromTextAcpi (
return (EFI_DEVICE_PATH_PROTOCOL *) Acpi;
}
+STATIC
EFI_DEVICE_PATH_PROTOCOL *
ConvertFromTextAcpi (
IN CHAR16 *TextDeviceNode,
@@ -964,6 +990,7 @@ ConvertFromTextAcpi (
return (EFI_DEVICE_PATH_PROTOCOL *) Acpi;
}
+STATIC
EFI_DEVICE_PATH_PROTOCOL *
DevPathFromTextPciRoot (
IN CHAR16 *TextDeviceNode
@@ -972,6 +999,7 @@ DevPathFromTextPciRoot (
return ConvertFromTextAcpi (TextDeviceNode, 0x0a0341d0);
}
+STATIC
EFI_DEVICE_PATH_PROTOCOL *
DevPathFromTextFloppy (
IN CHAR16 *TextDeviceNode
@@ -980,6 +1008,7 @@ DevPathFromTextFloppy (
return ConvertFromTextAcpi (TextDeviceNode, 0x060441d0);
}
+STATIC
EFI_DEVICE_PATH_PROTOCOL *
DevPathFromTextKeyboard (
IN CHAR16 *TextDeviceNode
@@ -988,6 +1017,7 @@ DevPathFromTextKeyboard (
return ConvertFromTextAcpi (TextDeviceNode, 0x030141d0);
}
+STATIC
EFI_DEVICE_PATH_PROTOCOL *
DevPathFromTextSerial (
IN CHAR16 *TextDeviceNode
@@ -996,6 +1026,7 @@ DevPathFromTextSerial (
return ConvertFromTextAcpi (TextDeviceNode, 0x050141d0);
}
+STATIC
EFI_DEVICE_PATH_PROTOCOL *
DevPathFromTextParallelPort (
IN CHAR16 *TextDeviceNode
@@ -1004,6 +1035,7 @@ DevPathFromTextParallelPort (
return ConvertFromTextAcpi (TextDeviceNode, 0x040141d0);
}
+STATIC
EFI_DEVICE_PATH_PROTOCOL *
DevPathFromTextAcpiEx (
IN CHAR16 *TextDeviceNode
@@ -1025,10 +1057,10 @@ DevPathFromTextAcpiEx (
HIDSTRStr = GetNextParamStr (&TextDeviceNode);
CIDSTRStr = GetNextParamStr (&TextDeviceNode);
UIDSTRStr = GetNextParamStr (&TextDeviceNode);
- Length = sizeof (ACPI_EXTENDED_HID_DEVICE_PATH) +
- (UINT16) StrLen (HIDSTRStr) + 1 +
- (UINT16) StrLen (UIDSTRStr) + 1 +
- (UINT16) StrLen (CIDSTRStr) + 1;
+
+ Length = (UINT16) (sizeof (ACPI_EXTENDED_HID_DEVICE_PATH) + StrLen (HIDSTRStr) + 1);
+ Length = (UINT16) (Length + StrLen (UIDSTRStr) + 1);
+ Length = (UINT16) (Length + StrLen (CIDSTRStr) + 1);
AcpiExt = (ACPI_EXTENDED_HID_DEVICE_PATH_WITH_STR *) CreateDeviceNode (
ACPI_DEVICE_PATH,
ACPI_EXTENDED_DP,
@@ -1053,6 +1085,7 @@ DevPathFromTextAcpiEx (
return (EFI_DEVICE_PATH_PROTOCOL *) AcpiExt;
}
+STATIC
EFI_DEVICE_PATH_PROTOCOL *
DevPathFromTextAcpiExp (
IN CHAR16 *TextDeviceNode
@@ -1103,6 +1136,7 @@ DevPathFromTextAcpiExp (
return (EFI_DEVICE_PATH_PROTOCOL *) AcpiExt;
}
+STATIC
EFI_DEVICE_PATH_PROTOCOL *
DevPathFromTextAta (
IN CHAR16 *TextDeviceNode
@@ -1123,13 +1157,14 @@ DevPathFromTextAta (
SlaveMasterStr = GetNextParamStr (&TextDeviceNode);
LunStr = GetNextParamStr (&TextDeviceNode);
- Atapi->PrimarySecondary = (StrCmp (PrimarySecondaryStr, L"Primary") == 0) ? (UINT8) 0 : (UINT8) 1;
- Atapi->SlaveMaster = (StrCmp (SlaveMasterStr, L"Master") == 0) ? (UINT8) 0 : (UINT8) 1;
+ Atapi->PrimarySecondary = (UINT8) ((StrCmp (PrimarySecondaryStr, L"Primary") == 0) ? 0 : 1);
+ Atapi->SlaveMaster = (UINT8) ((StrCmp (SlaveMasterStr, L"Master") == 0) ? 0 : 1);
Atapi->Lun = (UINT16) Xtoi (LunStr);
return (EFI_DEVICE_PATH_PROTOCOL *) Atapi;
}
+STATIC
EFI_DEVICE_PATH_PROTOCOL *
DevPathFromTextScsi (
IN CHAR16 *TextDeviceNode
@@ -1153,6 +1188,7 @@ DevPathFromTextScsi (
return (EFI_DEVICE_PATH_PROTOCOL *) Scsi;
}
+STATIC
EFI_DEVICE_PATH_PROTOCOL *
DevPathFromTextFibre (
IN CHAR16 *TextDeviceNode
@@ -1177,6 +1213,7 @@ DevPathFromTextFibre (
return (EFI_DEVICE_PATH_PROTOCOL *) Fibre;
}
+STATIC
EFI_DEVICE_PATH_PROTOCOL *
DevPathFromText1394 (
IN CHAR16 *TextDeviceNode
@@ -1198,6 +1235,7 @@ DevPathFromText1394 (
return (EFI_DEVICE_PATH_PROTOCOL *) F1394;
}
+STATIC
EFI_DEVICE_PATH_PROTOCOL *
DevPathFromTextUsb (
IN CHAR16 *TextDeviceNode
@@ -1221,6 +1259,7 @@ DevPathFromTextUsb (
return (EFI_DEVICE_PATH_PROTOCOL *) Usb;
}
+STATIC
EFI_DEVICE_PATH_PROTOCOL *
DevPathFromTextI2O (
IN CHAR16 *TextDeviceNode
@@ -1241,6 +1280,7 @@ DevPathFromTextI2O (
return (EFI_DEVICE_PATH_PROTOCOL *) I2O;
}
+STATIC
EFI_DEVICE_PATH_PROTOCOL *
DevPathFromTextInfiniband (
IN CHAR16 *TextDeviceNode
@@ -1275,6 +1315,7 @@ DevPathFromTextInfiniband (
return (EFI_DEVICE_PATH_PROTOCOL *) InfiniBand;
}
+STATIC
EFI_DEVICE_PATH_PROTOCOL *
DevPathFromTextVenMsg (
IN CHAR16 *TextDeviceNode
@@ -1287,6 +1328,7 @@ DevPathFromTextVenMsg (
);
}
+STATIC
EFI_DEVICE_PATH_PROTOCOL *
DevPathFromTextVenPcAnsi (
IN CHAR16 *TextDeviceNode
@@ -1303,6 +1345,7 @@ DevPathFromTextVenPcAnsi (
return (EFI_DEVICE_PATH_PROTOCOL *) Vendor;
}
+STATIC
EFI_DEVICE_PATH_PROTOCOL *
DevPathFromTextVenVt100 (
IN CHAR16 *TextDeviceNode
@@ -1319,6 +1362,7 @@ DevPathFromTextVenVt100 (
return (EFI_DEVICE_PATH_PROTOCOL *) Vendor;
}
+STATIC
EFI_DEVICE_PATH_PROTOCOL *
DevPathFromTextVenVt100Plus (
IN CHAR16 *TextDeviceNode
@@ -1335,6 +1379,7 @@ DevPathFromTextVenVt100Plus (
return (EFI_DEVICE_PATH_PROTOCOL *) Vendor;
}
+STATIC
EFI_DEVICE_PATH_PROTOCOL *
DevPathFromTextVenUtf8 (
IN CHAR16 *TextDeviceNode
@@ -1351,6 +1396,7 @@ DevPathFromTextVenUtf8 (
return (EFI_DEVICE_PATH_PROTOCOL *) Vendor;
}
+STATIC
EFI_DEVICE_PATH_PROTOCOL *
DevPathFromTextUartFlowCtrl (
IN CHAR16 *TextDeviceNode
@@ -1378,6 +1424,7 @@ DevPathFromTextUartFlowCtrl (
return (EFI_DEVICE_PATH_PROTOCOL *) UartFlowControl;
}
+STATIC
EFI_DEVICE_PATH_PROTOCOL *
DevPathFromTextSAS (
IN CHAR16 *TextDeviceNode
@@ -1442,6 +1489,7 @@ DevPathFromTextSAS (
return (EFI_DEVICE_PATH_PROTOCOL *) Sas;
}
+STATIC
EFI_DEVICE_PATH_PROTOCOL *
DevPathFromTextDebugPort (
IN CHAR16 *TextDeviceNode
@@ -1460,6 +1508,7 @@ DevPathFromTextDebugPort (
return (EFI_DEVICE_PATH_PROTOCOL *) Vend;
}
+STATIC
EFI_DEVICE_PATH_PROTOCOL *
DevPathFromTextMAC (
IN CHAR16 *TextDeviceNode
@@ -1486,6 +1535,7 @@ DevPathFromTextMAC (
return (EFI_DEVICE_PATH_PROTOCOL *) MAC;
}
+STATIC
EFI_DEVICE_PATH_PROTOCOL *
DevPathFromTextIPv4 (
IN CHAR16 *TextDeviceNode
@@ -1508,7 +1558,7 @@ DevPathFromTextIPv4 (
);
StrToIPv4Addr (&RemoteIPStr, &IPv4->RemoteIpAddress);
- IPv4->Protocol = (StrCmp (ProtocolStr, L"UDP") == 0) ? (UINT16) 0 : (UINT16) 1;
+ IPv4->Protocol = (UINT16) ((StrCmp (ProtocolStr, L"UDP") == 0) ? 0 : 1);
if (StrCmp (TypeStr, L"Static") == 0) {
IPv4->StaticIpAddress = TRUE;
} else {
@@ -1523,6 +1573,7 @@ DevPathFromTextIPv4 (
return (EFI_DEVICE_PATH_PROTOCOL *) IPv4;
}
+STATIC
EFI_DEVICE_PATH_PROTOCOL *
DevPathFromTextIPv6 (
IN CHAR16 *TextDeviceNode
@@ -1545,7 +1596,7 @@ DevPathFromTextIPv6 (
);
StrToIPv6Addr (&RemoteIPStr, &IPv6->RemoteIpAddress);
- IPv6->Protocol = (StrCmp (ProtocolStr, L"UDP") == 0) ? (UINT16) 0 : (UINT16) 1;
+ IPv6->Protocol = (UINT16) ((StrCmp (ProtocolStr, L"UDP") == 0) ? 0 : 1);
if (StrCmp (TypeStr, L"Static") == 0) {
IPv6->StaticIpAddress = TRUE;
} else {
@@ -1560,6 +1611,7 @@ DevPathFromTextIPv6 (
return (EFI_DEVICE_PATH_PROTOCOL *) IPv6;
}
+STATIC
EFI_DEVICE_PATH_PROTOCOL *
DevPathFromTextUart (
IN CHAR16 *TextDeviceNode
@@ -1582,7 +1634,7 @@ DevPathFromTextUart (
);
Uart->BaudRate = (StrCmp (BaudStr, L"DEFAULT") == 0) ? 115200 : Atoi (BaudStr);
- Uart->DataBits = (StrCmp (DataBitsStr, L"DEFAULT") == 0) ? (UINT8) 8 : (UINT8) Atoi (DataBitsStr);
+ Uart->DataBits = (UINT8) ((StrCmp (DataBitsStr, L"DEFAULT") == 0) ? 8 : Atoi (DataBitsStr));
switch (*ParityStr) {
case L'D':
Uart->Parity = 0;
@@ -1626,6 +1678,7 @@ DevPathFromTextUart (
return (EFI_DEVICE_PATH_PROTOCOL *) Uart;
}
+STATIC
EFI_DEVICE_PATH_PROTOCOL *
ConvertFromTextUsbClass (
IN CHAR16 *TextDeviceNode,
@@ -1670,6 +1723,7 @@ ConvertFromTextUsbClass (
}
+STATIC
EFI_DEVICE_PATH_PROTOCOL *
DevPathFromTextUsbClass (
IN CHAR16 *TextDeviceNode
@@ -1683,6 +1737,7 @@ DevPathFromTextUsbClass (
return ConvertFromTextUsbClass (TextDeviceNode, &UsbClassText);
}
+STATIC
EFI_DEVICE_PATH_PROTOCOL *
DevPathFromTextUsbAudio (
IN CHAR16 *TextDeviceNode
@@ -1697,6 +1752,7 @@ DevPathFromTextUsbAudio (
return ConvertFromTextUsbClass (TextDeviceNode, &UsbClassText);
}
+STATIC
EFI_DEVICE_PATH_PROTOCOL *
DevPathFromTextUsbCDCControl (
IN CHAR16 *TextDeviceNode
@@ -1711,6 +1767,7 @@ DevPathFromTextUsbCDCControl (
return ConvertFromTextUsbClass (TextDeviceNode, &UsbClassText);
}
+STATIC
EFI_DEVICE_PATH_PROTOCOL *
DevPathFromTextUsbHID (
IN CHAR16 *TextDeviceNode
@@ -1725,6 +1782,7 @@ DevPathFromTextUsbHID (
return ConvertFromTextUsbClass (TextDeviceNode, &UsbClassText);
}
+STATIC
EFI_DEVICE_PATH_PROTOCOL *
DevPathFromTextUsbImage (
IN CHAR16 *TextDeviceNode
@@ -1739,6 +1797,7 @@ DevPathFromTextUsbImage (
return ConvertFromTextUsbClass (TextDeviceNode, &UsbClassText);
}
+STATIC
EFI_DEVICE_PATH_PROTOCOL *
DevPathFromTextUsbPrinter (
IN CHAR16 *TextDeviceNode
@@ -1753,6 +1812,7 @@ DevPathFromTextUsbPrinter (
return ConvertFromTextUsbClass (TextDeviceNode, &UsbClassText);
}
+STATIC
EFI_DEVICE_PATH_PROTOCOL *
DevPathFromTextUsbMassStorage (
IN CHAR16 *TextDeviceNode
@@ -1767,6 +1827,7 @@ DevPathFromTextUsbMassStorage (
return ConvertFromTextUsbClass (TextDeviceNode, &UsbClassText);
}
+STATIC
EFI_DEVICE_PATH_PROTOCOL *
DevPathFromTextUsbHub (
IN CHAR16 *TextDeviceNode
@@ -1781,6 +1842,7 @@ DevPathFromTextUsbHub (
return ConvertFromTextUsbClass (TextDeviceNode, &UsbClassText);
}
+STATIC
EFI_DEVICE_PATH_PROTOCOL *
DevPathFromTextUsbCDCData (
IN CHAR16 *TextDeviceNode
@@ -1795,6 +1857,7 @@ DevPathFromTextUsbCDCData (
return ConvertFromTextUsbClass (TextDeviceNode, &UsbClassText);
}
+STATIC
EFI_DEVICE_PATH_PROTOCOL *
DevPathFromTextUsbSmartCard (
IN CHAR16 *TextDeviceNode
@@ -1809,6 +1872,7 @@ DevPathFromTextUsbSmartCard (
return ConvertFromTextUsbClass (TextDeviceNode, &UsbClassText);
}
+STATIC
EFI_DEVICE_PATH_PROTOCOL *
DevPathFromTextUsbVideo (
IN CHAR16 *TextDeviceNode
@@ -1823,6 +1887,7 @@ DevPathFromTextUsbVideo (
return ConvertFromTextUsbClass (TextDeviceNode, &UsbClassText);
}
+STATIC
EFI_DEVICE_PATH_PROTOCOL *
DevPathFromTextUsbDiagnostic (
IN CHAR16 *TextDeviceNode
@@ -1837,6 +1902,7 @@ DevPathFromTextUsbDiagnostic (
return ConvertFromTextUsbClass (TextDeviceNode, &UsbClassText);
}
+STATIC
EFI_DEVICE_PATH_PROTOCOL *
DevPathFromTextUsbWireless (
IN CHAR16 *TextDeviceNode
@@ -1851,6 +1917,7 @@ DevPathFromTextUsbWireless (
return ConvertFromTextUsbClass (TextDeviceNode, &UsbClassText);
}
+STATIC
EFI_DEVICE_PATH_PROTOCOL *
DevPathFromTextUsbDeviceFirmwareUpdate (
IN CHAR16 *TextDeviceNode
@@ -1866,6 +1933,7 @@ DevPathFromTextUsbDeviceFirmwareUpdate (
return ConvertFromTextUsbClass (TextDeviceNode, &UsbClassText);
}
+STATIC
EFI_DEVICE_PATH_PROTOCOL *
DevPathFromTextUsbIrdaBridge (
IN CHAR16 *TextDeviceNode
@@ -1881,6 +1949,7 @@ DevPathFromTextUsbIrdaBridge (
return ConvertFromTextUsbClass (TextDeviceNode, &UsbClassText);
}
+STATIC
EFI_DEVICE_PATH_PROTOCOL *
DevPathFromTextUsbTestAndMeasurement (
IN CHAR16 *TextDeviceNode
@@ -1896,6 +1965,7 @@ DevPathFromTextUsbTestAndMeasurement (
return ConvertFromTextUsbClass (TextDeviceNode, &UsbClassText);
}
+STATIC
EFI_DEVICE_PATH_PROTOCOL *
DevPathFromTextUsbWwid (
IN CHAR16 *TextDeviceNode
@@ -1922,6 +1992,7 @@ DevPathFromTextUsbWwid (
return (EFI_DEVICE_PATH_PROTOCOL *) UsbWwid;
}
+STATIC
EFI_DEVICE_PATH_PROTOCOL *
DevPathFromTextUnit (
IN CHAR16 *TextDeviceNode
@@ -1942,6 +2013,7 @@ DevPathFromTextUnit (
return (EFI_DEVICE_PATH_PROTOCOL *) LogicalUnit;
}
+STATIC
EFI_DEVICE_PATH_PROTOCOL *
DevPathFromTextiSCSI (
IN CHAR16 *TextDeviceNode
@@ -1999,6 +2071,7 @@ DevPathFromTextiSCSI (
return (EFI_DEVICE_PATH_PROTOCOL *) iSCSI;
}
+STATIC
EFI_DEVICE_PATH_PROTOCOL *
DevPathFromTextHD (
IN CHAR16 *TextDeviceNode
@@ -2054,6 +2127,7 @@ DevPathFromTextHD (
return (EFI_DEVICE_PATH_PROTOCOL *) Hd;
}
+STATIC
EFI_DEVICE_PATH_PROTOCOL *
DevPathFromTextCDROM (
IN CHAR16 *TextDeviceNode
@@ -2080,6 +2154,7 @@ DevPathFromTextCDROM (
return (EFI_DEVICE_PATH_PROTOCOL *) CDROM;
}
+STATIC
EFI_DEVICE_PATH_PROTOCOL *
DevPathFromTextVenMEDIA (
IN CHAR16 *TextDeviceNode
@@ -2092,6 +2167,7 @@ DevPathFromTextVenMEDIA (
);
}
+STATIC
EFI_DEVICE_PATH_PROTOCOL *
DevPathFromTextFilePath (
IN CHAR16 *TextDeviceNode
@@ -2110,6 +2186,7 @@ DevPathFromTextFilePath (
return (EFI_DEVICE_PATH_PROTOCOL *) File;
}
+STATIC
EFI_DEVICE_PATH_PROTOCOL *
DevPathFromTextMedia (
IN CHAR16 *TextDeviceNode
@@ -2130,6 +2207,7 @@ DevPathFromTextMedia (
return (EFI_DEVICE_PATH_PROTOCOL *) Media;
}
+STATIC
EFI_DEVICE_PATH_PROTOCOL *
DevPathFromTextBBS (
IN CHAR16 *TextDeviceNode
diff --git a/EdkModulePkg/Universal/DevicePath/Dxe/DevicePathToText.c b/EdkModulePkg/Universal/DevicePath/Dxe/DevicePathToText.c
index 25c88e07d6..03150706c7 100644
--- a/EdkModulePkg/Universal/DevicePath/Dxe/DevicePathToText.c
+++ b/EdkModulePkg/Universal/DevicePath/Dxe/DevicePathToText.c
@@ -21,6 +21,7 @@ Abstract:
#include "DevicePath.h"
+STATIC
EFI_DEVICE_PATH_PROTOCOL *
UnpackDevicePath (
IN EFI_DEVICE_PATH_PROTOCOL *DevPath
@@ -95,6 +96,7 @@ UnpackDevicePath (
return NewPath;
}
+STATIC
VOID *
ReallocatePool (
IN VOID *OldPool,
@@ -136,6 +138,7 @@ ReallocatePool (
return NewPool;
}
+STATIC
CHAR16 *
CatPrint (
IN OUT POOL_PRINT *Str,
@@ -177,7 +180,8 @@ CatPrint (
Str->Str = AllocateZeroPool (Size);
ASSERT (Str->Str != NULL);
} else {
- Size = StrSize (AppendStr) + StrSize (Str->Str) - sizeof (UINT16);
+ Size = StrSize (AppendStr) - sizeof (UINT16);
+ Size = Size + StrSize (Str->Str);
Str->Str = ReallocatePool (
Str->Str,
StrSize (Str->Str),
@@ -196,6 +200,7 @@ CatPrint (
return Str->Str;
}
+STATIC
VOID
DevPathToTextPci (
IN OUT POOL_PRINT *Str,
@@ -210,6 +215,7 @@ DevPathToTextPci (
CatPrint (Str, L"Pci(%x,%x)", Pci->Function, Pci->Device);
}
+STATIC
VOID
DevPathToTextPccard (
IN OUT POOL_PRINT *Str,
@@ -224,6 +230,7 @@ DevPathToTextPccard (
CatPrint (Str, L"PcCard(%x)", Pccard->FunctionNumber);
}
+STATIC
VOID
DevPathToTextMemMap (
IN OUT POOL_PRINT *Str,
@@ -243,6 +250,7 @@ DevPathToTextMemMap (
);
}
+STATIC
VOID
DevPathToTextVendor (
IN OUT POOL_PRINT *Str,
@@ -357,6 +365,7 @@ DevPathToTextVendor (
CatPrint (Str, L")");
}
+STATIC
VOID
DevPathToTextController (
IN OUT POOL_PRINT *Str,
@@ -375,6 +384,7 @@ DevPathToTextController (
);
}
+STATIC
VOID
DevPathToTextAcpi (
IN OUT POOL_PRINT *Str,
@@ -424,6 +434,7 @@ DevPathToTextAcpi (
#define NextStrA(a) ((UINT8 *) (((UINT8 *) (a)) + AsciiStrLen ((CHAR8 *) (a)) + 1))
+STATIC
VOID
DevPathToTextExtAcpi (
IN OUT POOL_PRINT *Str,
@@ -433,12 +444,14 @@ DevPathToTextExtAcpi (
)
{
ACPI_EXTENDED_HID_DEVICE_PATH_WITH_STR *AcpiExt;
+ UINT8 *NextString;
AcpiExt = DevPath;
if (AllowShortcuts) {
+ NextString = NextStrA (AcpiExt->HidUidCidStr);
if ((*(AcpiExt->HidUidCidStr) == '\0') &&
- (*(NextStrA (NextStrA (AcpiExt->HidUidCidStr))) == '\0') &&
+ (*(NextStrA (NextString)) == '\0') &&
(AcpiExt->UID == 0)
) {
if ((AcpiExt->HID & PNP_EISA_ID_MASK) == PNP_EISA_ID_CONST) {
@@ -462,6 +475,8 @@ DevPathToTextExtAcpi (
return ;
}
+ NextString = NextStrA (AcpiExt->HidUidCidStr);
+ NextString = NextStrA (NextString);
if ((AcpiExt->HID & PNP_EISA_ID_MASK) == PNP_EISA_ID_CONST) {
CatPrint (
Str,
@@ -470,7 +485,7 @@ DevPathToTextExtAcpi (
AcpiExt->CID,
AcpiExt->UID,
AcpiExt->HidUidCidStr,
- NextStrA (NextStrA (AcpiExt->HidUidCidStr)),
+ NextString,
NextStrA (AcpiExt->HidUidCidStr)
);
} else {
@@ -481,12 +496,13 @@ DevPathToTextExtAcpi (
AcpiExt->CID,
AcpiExt->UID,
AcpiExt->HidUidCidStr,
- NextStrA (NextStrA (AcpiExt->HidUidCidStr)),
+ NextString,
NextStrA (AcpiExt->HidUidCidStr)
);
}
}
+STATIC
VOID
DevPathToTextAtapi (
IN OUT POOL_PRINT *Str,
@@ -512,6 +528,7 @@ DevPathToTextAtapi (
}
}
+STATIC
VOID
DevPathToTextScsi (
IN OUT POOL_PRINT *Str,
@@ -526,6 +543,7 @@ DevPathToTextScsi (
CatPrint (Str, L"Scsi(%x,%x)", Scsi->Pun, Scsi->Lun);
}
+STATIC
VOID
DevPathToTextFibre (
IN OUT POOL_PRINT *Str,
@@ -540,6 +558,7 @@ DevPathToTextFibre (
CatPrint (Str, L"Fibre(%lx,%lx)", Fibre->WWN, Fibre->Lun);
}
+STATIC
VOID
DevPathToText1394 (
IN OUT POOL_PRINT *Str,
@@ -554,6 +573,7 @@ DevPathToText1394 (
CatPrint (Str, L"I1394(%lx)", F1394->Guid);
}
+STATIC
VOID
DevPathToTextUsb (
IN OUT POOL_PRINT *Str,
@@ -568,6 +588,7 @@ DevPathToTextUsb (
CatPrint (Str, L"USB(%x,%x)", Usb->ParentPortNumber, Usb->InterfaceNumber);
}
+STATIC
VOID
DevPathToTextUsbWWID (
IN OUT POOL_PRINT *Str,
@@ -588,6 +609,7 @@ DevPathToTextUsbWWID (
);
}
+STATIC
VOID
DevPathToTextLogicalUnit (
IN OUT POOL_PRINT *Str,
@@ -602,6 +624,7 @@ DevPathToTextLogicalUnit (
CatPrint (Str, L"Unit(%x)", LogicalUnit->Lun);
}
+STATIC
VOID
DevPathToTextUsbClass (
IN OUT POOL_PRINT *Str,
@@ -794,6 +817,7 @@ DevPathToTextUsbClass (
);
}
+STATIC
VOID
DevPathToTextI2O (
IN OUT POOL_PRINT *Str,
@@ -808,6 +832,7 @@ DevPathToTextI2O (
CatPrint (Str, L"I2O(%x)", I2O->Tid);
}
+STATIC
VOID
DevPathToTextMacAddr (
IN OUT POOL_PRINT *Str,
@@ -836,6 +861,7 @@ DevPathToTextMacAddr (
CatPrint (Str, L",%x)", MAC->IfType);
}
+STATIC
VOID
DevPathToTextIPv4 (
IN OUT POOL_PRINT *Str,
@@ -875,6 +901,7 @@ DevPathToTextIPv4 (
);
}
+STATIC
VOID
DevPathToTextIPv6 (
IN OUT POOL_PRINT *Str,
@@ -950,6 +977,7 @@ DevPathToTextIPv6 (
);
}
+STATIC
VOID
DevPathToTextInfiniBand (
IN OUT POOL_PRINT *Str,
@@ -972,6 +1000,7 @@ DevPathToTextInfiniBand (
);
}
+STATIC
VOID
DevPathToTextUart (
IN OUT POOL_PRINT *Str,
@@ -1051,6 +1080,7 @@ DevPathToTextUart (
}
}
+STATIC
VOID
DevPathToTextiSCSI (
IN OUT POOL_PRINT *Str,
@@ -1086,6 +1116,7 @@ DevPathToTextiSCSI (
CatPrint (Str, L"%s)", (iSCSI->NetworkProtocol == 0) ? L"TCP" : L"reserved");
}
+STATIC
VOID
DevPathToTextHardDrive (
IN OUT POOL_PRINT *Str,
@@ -1134,6 +1165,7 @@ DevPathToTextHardDrive (
CatPrint (Str, L"%lx,%lx)", Hd->PartitionStart, Hd->PartitionSize);
}
+STATIC
VOID
DevPathToTextCDROM (
IN OUT POOL_PRINT *Str,
@@ -1153,6 +1185,7 @@ DevPathToTextCDROM (
CatPrint (Str, L"CDROM(%x,%lx,%lx)", Cd->BootEntry, Cd->PartitionStart, Cd->PartitionSize);
}
+STATIC
VOID
DevPathToTextFilePath (
IN OUT POOL_PRINT *Str,
@@ -1167,6 +1200,7 @@ DevPathToTextFilePath (
CatPrint (Str, L"%s", Fp->PathName);
}
+STATIC
VOID
DevPathToTextMediaProtocol (
IN OUT POOL_PRINT *Str,
@@ -1181,6 +1215,7 @@ DevPathToTextMediaProtocol (
CatPrint (Str, L"Media(%g)", &MediaProt->Protocol);
}
+STATIC
VOID
DevPathToTextBBS (
IN OUT POOL_PRINT *Str,
@@ -1233,6 +1268,7 @@ DevPathToTextBBS (
CatPrint (Str, L",%x)", Bbs->StatusFlag);
}
+STATIC
VOID
DevPathToTextEndInstance (
IN OUT POOL_PRINT *Str,
@@ -1244,6 +1280,7 @@ DevPathToTextEndInstance (
CatPrint (Str, L",");
}
+STATIC
VOID
DevPathToTextNodeUnknown (
IN OUT POOL_PRINT *Str,
diff --git a/EdkModulePkg/Universal/Disk/Partition/Dxe/Mbr.c b/EdkModulePkg/Universal/Disk/Partition/Dxe/Mbr.c
index ce6b0d5353..8dd0b4b497 100644
--- a/EdkModulePkg/Universal/Disk/Partition/Dxe/Mbr.c
+++ b/EdkModulePkg/Universal/Disk/Partition/Dxe/Mbr.c
@@ -31,6 +31,7 @@ Abstract:
#include "Partition.h"
+STATIC
BOOLEAN
PartitionValidMbr (
IN MASTER_BOOT_RECORD *Mbr,
diff --git a/EdkModulePkg/Universal/Disk/Partition/Dxe/Partition.c b/EdkModulePkg/Universal/Disk/Partition/Dxe/Partition.c
index 77cee2442b..6a896e4e72 100644
--- a/EdkModulePkg/Universal/Disk/Partition/Dxe/Partition.c
+++ b/EdkModulePkg/Universal/Disk/Partition/Dxe/Partition.c
@@ -437,6 +437,7 @@ PartitionDriverBindingStop (
return EFI_SUCCESS;
}
+STATIC
EFI_STATUS
EFIAPI
PartitionReset (
@@ -469,6 +470,7 @@ PartitionReset (
);
}
+STATIC
EFI_STATUS
EFIAPI
PartitionReadBlocks (
@@ -524,6 +526,7 @@ PartitionReadBlocks (
return Private->DiskIo->ReadDisk (Private->DiskIo, MediaId, Offset, BufferSize, Buffer);
}
+STATIC
EFI_STATUS
EFIAPI
PartitionWriteBlocks (
@@ -580,6 +583,7 @@ PartitionWriteBlocks (
return Private->DiskIo->WriteDisk (Private->DiskIo, MediaId, Offset, BufferSize, Buffer);
}
+STATIC
EFI_STATUS
EFIAPI
PartitionFlushBlocks (
diff --git a/EdkModulePkg/Universal/Ebc/Dxe/EbcExecute.c b/EdkModulePkg/Universal/Ebc/Dxe/EbcExecute.c
index 70db1574bf..ce9b3aa547 100644
--- a/EdkModulePkg/Universal/Ebc/Dxe/EbcExecute.c
+++ b/EdkModulePkg/Universal/Ebc/Dxe/EbcExecute.c
@@ -1098,7 +1098,6 @@ Returns:
UINT8 Operands;
VOID *EbcEntryPoint;
VOID *Thunk;
- EFI_STATUS Status;
UINT64 U64EbcEntryPoint;
INT32 Offset;
@@ -1162,7 +1161,7 @@ Returns:
//
// Now create a new thunk
//
- Status = EbcCreateThunks (VmPtr->ImageHandle, EbcEntryPoint, &Thunk, 0);
+ EbcCreateThunks (VmPtr->ImageHandle, EbcEntryPoint, &Thunk, 0);
//
// Finally replace the EBC entry point memory with the thunk address
diff --git a/EdkModulePkg/Universal/Ebc/Dxe/Ipf/EbcSupport.c b/EdkModulePkg/Universal/Ebc/Dxe/Ipf/EbcSupport.c
index eceb59185b..283cdaa038 100644
--- a/EdkModulePkg/Universal/Ebc/Dxe/Ipf/EbcSupport.c
+++ b/EdkModulePkg/Universal/Ebc/Dxe/Ipf/EbcSupport.c
@@ -76,6 +76,7 @@ PushU64 (
*(UINT64 *) VmPtr->R[0] = Arg;
}
+STATIC
UINT64
EbcInterpret (
UINT64 Arg1,
@@ -468,14 +469,14 @@ Returns:
//
// Next is jumbled data, including opcode and rest of address
//
- Code[2] = LShiftU64 (Imm7b, 13)
- | LShiftU64 (0x00, 20) // vc
- | LShiftU64 (Ic, 21)
- | LShiftU64 (Imm5c, 22)
- | LShiftU64 (Imm9d, 27)
- | LShiftU64 (I, 36)
- | LShiftU64 ((UINT64)MOVL_OPCODE, 37)
- | LShiftU64 ((RegNum & 0x7F), 6);
+ Code[2] = LShiftU64 (Imm7b, 13);
+ Code[2] = Code[2] | LShiftU64 (0x00, 20); // vc
+ Code[2] = Code[2] | LShiftU64 (Ic, 21);
+ Code[2] = Code[2] | LShiftU64 (Imm5c, 22);
+ Code[2] = Code[2] | LShiftU64 (Imm9d, 27);
+ Code[2] = Code[2] | LShiftU64 (I, 36);
+ Code[2] = Code[2] | LShiftU64 ((UINT64)MOVL_OPCODE, 37);
+ Code[2] = Code[2] | LShiftU64 ((RegNum & 0x7F), 6);
WriteBundle ((VOID *) Ptr, 0x05, Code[0], Code[1], Code[2]);
@@ -533,14 +534,14 @@ Returns:
//
// Next is jumbled data, including opcode and rest of address
//
- Code[2] = LShiftU64 (Imm7b, 13)
- | LShiftU64 (0x00, 20) // vc
- | LShiftU64 (Ic, 21)
- | LShiftU64 (Imm5c, 22)
- | LShiftU64 (Imm9d, 27)
- | LShiftU64 (I, 36)
- | LShiftU64 ((UINT64)MOVL_OPCODE, 37)
- | LShiftU64 ((RegNum & 0x7F), 6);
+ Code[2] = LShiftU64 (Imm7b, 13);
+ Code[2] = Code[2] | LShiftU64 (0x00, 20); // vc
+ Code[2] = Code[2] | LShiftU64 (Ic, 21);
+ Code[2] = Code[2] | LShiftU64 (Imm5c, 22);
+ Code[2] = Code[2] | LShiftU64 (Imm9d, 27);
+ Code[2] = Code[2] | LShiftU64 (I, 36);
+ Code[2] = Code[2] | LShiftU64 ((UINT64)MOVL_OPCODE, 37);
+ Code[2] = Code[2] | LShiftU64 ((RegNum & 0x7F), 6);
WriteBundle ((VOID *) Ptr, 0x05, Code[0], Code[1], Code[2]);
@@ -604,14 +605,14 @@ Returns:
//
// Next is jumbled data, including opcode and rest of address
//
- Code[2] = LShiftU64(Imm7b, 13)
- | LShiftU64 (0x00, 20) // vc
- | LShiftU64 (Ic, 21)
- | LShiftU64 (Imm5c, 22)
- | LShiftU64 (Imm9d, 27)
- | LShiftU64 (I, 36)
- | LShiftU64 ((UINT64)MOVL_OPCODE, 37)
- | LShiftU64 ((RegNum & 0x7F), 6);
+ Code[2] = LShiftU64(Imm7b, 13);
+ Code[2] = Code[2] | LShiftU64 (0x00, 20); // vc
+ Code[2] = Code[2] | LShiftU64 (Ic, 21);
+ Code[2] = Code[2] | LShiftU64 (Imm5c, 22);
+ Code[2] = Code[2] | LShiftU64 (Imm9d, 27);
+ Code[2] = Code[2] | LShiftU64 (I, 36);
+ Code[2] = Code[2] | LShiftU64 ((UINT64)MOVL_OPCODE, 37);
+ Code[2] = Code[2] | LShiftU64 ((RegNum & 0x7F), 6);
WriteBundle ((VOID *) Ptr, 0x05, Code[0], Code[1], Code[2]);
@@ -722,8 +723,11 @@ Returns:
return EFI_INVALID_PARAMETER;
}
- Low64 = LShiftU64 (Slot1, 46) | LShiftU64 (Slot0, 5) | Template;
- High64 = RShiftU64 (Slot1, 18) | LShiftU64 (Slot2, 23);
+ Low64 = LShiftU64 (Slot1, 46);
+ Low64 = Low64 | LShiftU64 (Slot0, 5) | Template;
+
+ High64 = RShiftU64 (Slot1, 18);
+ High64 = High64 | LShiftU64 (Slot2, 23);
//
// Now write it all out
@@ -816,14 +820,13 @@ Returns:
CodeTwo5c = RShiftU64 (*((UINT64 *)CalleeAddr + 3), 45) & 0x1F;
CodeTwo9d = RShiftU64 (*((UINT64 *)CalleeAddr + 3), 50) & 0x1FF;
- TargetEbcAddr = CodeTwo7b
- | LShiftU64 (CodeTwo9d, 7)
- | LShiftU64 (CodeTwo5c, 16)
- | LShiftU64 (CodeTwoIc, 21)
- | LShiftU64 (CodeOne18, 22)
- | LShiftU64 (CodeOne23, 40)
- | LShiftU64 (CodeTwoI, 63)
- ;
+ TargetEbcAddr = CodeTwo7b;
+ TargetEbcAddr = TargetEbcAddr | LShiftU64 (CodeTwo9d, 7);
+ TargetEbcAddr = TargetEbcAddr | LShiftU64 (CodeTwo5c, 16);
+ TargetEbcAddr = TargetEbcAddr | LShiftU64 (CodeTwoIc, 21);
+ TargetEbcAddr = TargetEbcAddr | LShiftU64 (CodeOne18, 22);
+ TargetEbcAddr = TargetEbcAddr | LShiftU64 (CodeOne23, 40);
+ TargetEbcAddr = TargetEbcAddr | LShiftU64 (CodeTwoI, 63);
Action:
if (IsThunk == 1){
diff --git a/EdkModulePkg/Universal/EmuVariable/RuntimeDxe/EmuVariable.c b/EdkModulePkg/Universal/EmuVariable/RuntimeDxe/EmuVariable.c
index 0eef1acfc4..b9563f131b 100644
--- a/EdkModulePkg/Universal/EmuVariable/RuntimeDxe/EmuVariable.c
+++ b/EdkModulePkg/Universal/EmuVariable/RuntimeDxe/EmuVariable.c
@@ -26,6 +26,7 @@ Revision History
//
ESAL_VARIABLE_GLOBAL *mVariableModuleGlobal;
+STATIC
UINT32
EFIAPI
ArrayLength (
@@ -62,6 +63,7 @@ Returns:
return (Count * 2) + 2;
}
+STATIC
VARIABLE_STORE_STATUS
EFIAPI
GetVariableStoreStatus (
@@ -103,6 +105,7 @@ Returns:
}
}
+STATIC
UINT8 *
EFIAPI
GetVariableDataPtr (
@@ -133,6 +136,7 @@ Returns:
return (UINT8 *) ((UINTN) GET_VARIABLE_NAME_PTR (Variable) + Variable->NameSize + GET_PAD_SIZE (Variable->NameSize));
}
+STATIC
VARIABLE_HEADER *
EFIAPI
GetNextVariablePtr (
@@ -173,6 +177,7 @@ Returns:
return VarHeader;
}
+STATIC
VARIABLE_HEADER *
EFIAPI
GetEndPointer (
@@ -200,6 +205,7 @@ Returns:
return (VARIABLE_HEADER *) ((UINTN) VolHeader + VolHeader->Size);
}
+STATIC
EFI_STATUS
EFIAPI
FindVariable (
@@ -413,7 +419,7 @@ Returns:
Variable.StartPtr = (VARIABLE_HEADER *) ((UINTN) (Global->VolatileVariableBase + sizeof (VARIABLE_STORE_HEADER)));
Variable.EndPtr = (VARIABLE_HEADER *) GetEndPointer ((VARIABLE_STORE_HEADER *) ((UINTN) Global->VolatileVariableBase));
} else {
- return EFI_NOT_FOUND;
+ goto Error;
}
Variable.CurrPtr = Variable.StartPtr;
@@ -449,6 +455,7 @@ Returns:
}
}
+Error:
return EFI_NOT_FOUND;
}
@@ -755,6 +762,7 @@ Returns:
}
#endif
+STATIC
EFI_STATUS
EFIAPI
InitializeVariableStore (
diff --git a/EdkModulePkg/Universal/EmuVariable/RuntimeDxe/Ipf/InitVariable.c b/EdkModulePkg/Universal/EmuVariable/RuntimeDxe/Ipf/InitVariable.c
index ee2a4852a0..da71705dae 100644
--- a/EdkModulePkg/Universal/EmuVariable/RuntimeDxe/Ipf/InitVariable.c
+++ b/EdkModulePkg/Universal/EmuVariable/RuntimeDxe/Ipf/InitVariable.c
@@ -26,6 +26,7 @@ Revision History
//
extern ESAL_VARIABLE_GLOBAL *mVariableModuleGlobal;
+STATIC
SAL_RETURN_REGS
EsalVariableCommonEntry (
IN UINT64 FunctionId,
diff --git a/EdkModulePkg/Universal/FirmwareVolume/FaultTolerantWriteLite/Dxe/FtwWorkSpace.c b/EdkModulePkg/Universal/FirmwareVolume/FaultTolerantWriteLite/Dxe/FtwWorkSpace.c
index 820655c76b..40e56ad1fb 100644
--- a/EdkModulePkg/Universal/FirmwareVolume/FaultTolerantWriteLite/Dxe/FtwWorkSpace.c
+++ b/EdkModulePkg/Universal/FirmwareVolume/FaultTolerantWriteLite/Dxe/FtwWorkSpace.c
@@ -193,7 +193,7 @@ Notes:
}
State ^= FTW_POLARITY_REVERT;
- State |= NewBit;
+ State = (UINT8) (State | NewBit);
State ^= FTW_POLARITY_REVERT;
//
diff --git a/EdkModulePkg/Universal/GenericMemoryTest/Pei/BaseMemoryTest.c b/EdkModulePkg/Universal/GenericMemoryTest/Pei/BaseMemoryTest.c
index e091ae18fb..48ed607961 100644
--- a/EdkModulePkg/Universal/GenericMemoryTest/Pei/BaseMemoryTest.c
+++ b/EdkModulePkg/Universal/GenericMemoryTest/Pei/BaseMemoryTest.c
@@ -91,7 +91,6 @@ Returns:
--*/
{
UINT32 TestPattern;
- UINT32 TestMask;
EFI_PHYSICAL_ADDRESS TempAddress;
UINT32 SpanSize;
@@ -101,7 +100,6 @@ Returns:
);
TestPattern = TEST_PATTERN;
- TestMask = 0;
SpanSize = 0;
//
diff --git a/EdkModulePkg/Universal/MonotonicCounter/RuntimeDxe/MonotonicCounter.c b/EdkModulePkg/Universal/MonotonicCounter/RuntimeDxe/MonotonicCounter.c
index f79038657a..478729ea82 100644
--- a/EdkModulePkg/Universal/MonotonicCounter/RuntimeDxe/MonotonicCounter.c
+++ b/EdkModulePkg/Universal/MonotonicCounter/RuntimeDxe/MonotonicCounter.c
@@ -51,6 +51,7 @@ EFI_GUID mEfiMtcGuid = { 0xeb704011, 0x1402, 0x11d3, { 0x8e, 0x77, 0x0, 0xa0,
//
// Worker functions
//
+STATIC
EFI_STATUS
EFIAPI
MonotonicCounterDriverGetNextMonotonicCount (
@@ -132,6 +133,7 @@ Returns:
@retval EFI_DEVICE_ERROR The variable could not be saved due to a hardware failure.
**/
+STATIC
EFI_STATUS
EFIAPI
MonotonicCounterDriverGetNextHighMonotonicCount (
@@ -181,6 +183,7 @@ Returns:
}
+STATIC
VOID
EFIAPI
EfiMtcEventHandler (
diff --git a/EdkModulePkg/Universal/Network/PxeBc/Dxe/Bc.h b/EdkModulePkg/Universal/Network/PxeBc/Dxe/Bc.h
index a391709c9e..6d5a616af4 100644
--- a/EdkModulePkg/Universal/Network/PxeBc/Dxe/Bc.h
+++ b/EdkModulePkg/Universal/Network/PxeBc/Dxe/Bc.h
@@ -494,6 +494,23 @@ typedef union {
#include "dhcp.h"
#include "tftp.h"
+VOID
+InitArpHeader (
+ VOID
+ )
+/*++
+Routine description:
+ Initialize ARP packet header.
+
+Parameters:
+ none
+
+Returns:
+ none
+
+--*/
+;
+
#endif /* _BC_H */
/* EOF - bc.h */
diff --git a/EdkModulePkg/Universal/Network/PxeBc/Dxe/bc.c b/EdkModulePkg/Universal/Network/PxeBc/Dxe/bc.c
index 303f3547ae..f3969b90e8 100644
--- a/EdkModulePkg/Universal/Network/PxeBc/Dxe/bc.c
+++ b/EdkModulePkg/Universal/Network/PxeBc/Dxe/bc.c
@@ -45,17 +45,6 @@ PxeBcDriverStop (
IN EFI_HANDLE *ChildHandleBuffer
);
-extern
-VOID
-InitArpHeader (
- VOID
- );
-extern
-VOID
-OptionsStrucInit (
- VOID
- );
-
//
// helper routines
//
@@ -310,8 +299,8 @@ IpChecksum2 (
{
UINT32 Sum;
- Sum = (UINT16)~IpChecksum (Header, HeaderLen) + (UINT16)~IpChecksum (Message, MessageLen);
-
+ Sum = (UINT16)~IpChecksum (Header, HeaderLen);
+ Sum = Sum + (UINT16)~IpChecksum (Message, MessageLen);
//
// in case above carried
//
@@ -1597,7 +1586,6 @@ BcStop (
//
// Lock the instance data
//
- EFI_PXE_BASE_CODE_MODE *PxebcMode;
EFI_SIMPLE_NETWORK_PROTOCOL *SnpPtr;
EFI_SIMPLE_NETWORK_MODE *SnpModePtr;
EFI_STATUS StatCode;
@@ -1619,7 +1607,6 @@ BcStop (
EfiAcquireLock (&Private->Lock);
- PxebcMode = Private->EfiBc.Mode;
SnpPtr = Private->SimpleNetwork;
SnpModePtr = SnpPtr->Mode;
@@ -2069,13 +2056,11 @@ BcSetStationIP (
--*/
{
EFI_PXE_BASE_CODE_MODE *PxebcMode;
- EFI_STATUS StatCode;
PXE_BASECODE_DEVICE *Private;
//
// Lock the instance data and make sure started
//
- StatCode = EFI_SUCCESS;
if (This == NULL) {
DEBUG ((EFI_D_ERROR, "BC *This pointer == NULL"));
diff --git a/EdkModulePkg/Universal/Network/PxeBc/Dxe/dhcp.h b/EdkModulePkg/Universal/Network/PxeBc/Dxe/dhcp.h
index cd448b37a5..102d30b8c0 100644
--- a/EdkModulePkg/Universal/Network/PxeBc/Dxe/dhcp.h
+++ b/EdkModulePkg/Universal/Network/PxeBc/Dxe/dhcp.h
@@ -622,6 +622,11 @@ typedef struct DhcpReceiveBufferStruct {
#define CREDENTIALS_TYPE (1 << 3)
#define USE_THREE_BYTE (1 << 4)
+VOID
+OptionsStrucInit (
+ VOID
+ );
+
#endif // _DHCP_H
/* EOF - dhcp.h */
diff --git a/EdkModulePkg/Universal/Network/PxeBc/Dxe/pxe_bc_dhcp.c b/EdkModulePkg/Universal/Network/PxeBc/Dxe/pxe_bc_dhcp.c
index 57664d81e2..bb7022ba74 100644
--- a/EdkModulePkg/Universal/Network/PxeBc/Dxe/pxe_bc_dhcp.c
+++ b/EdkModulePkg/Universal/Network/PxeBc/Dxe/pxe_bc_dhcp.c
@@ -211,7 +211,7 @@ OptionsStrucInit (
CopyMem (DHCPOpStart.DhcpClassIdentifier.Data.UndiMajor, "yyy", sizeof ("yyy"));
CopyMem (DHCPOpStart.DhcpClassIdentifier.Data.UndiMinor, "xxx", sizeof ("xxx"));
DHCPOpStart.End[0] = OP_END;
-};
+}
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
@@ -399,6 +399,7 @@ STATIC UINT8 OurDhcpOptions[MAX_OUR_OPT] = {
#pragma pack()
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
+STATIC
CHAR8 *
PxeBcLibGetSmbiosString (
IN SMBIOS_STRUCTURE_POINTER *Smbios,
@@ -855,6 +856,7 @@ DecodeOptions (
}
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
+STATIC
VOID
Parse (
DHCP_RECEIVE_BUFFER *RxBufPtr,
@@ -958,6 +960,7 @@ CopyParse (
}
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
+STATIC
BOOLEAN
AckEdit (
DHCP_RECEIVE_BUFFER *DhcpRxBuf
@@ -984,6 +987,7 @@ AckEdit (
//
// if a discover type packet, make sure all required fields are present
//
+STATIC
BOOLEAN
DHCPOfferAckEdit (
DHCP_RECEIVE_BUFFER *DhcpRxBuf
@@ -1126,6 +1130,7 @@ DHCPOfferAckEdit (
}
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
+STATIC
BOOLEAN
DHCPAckEdit (
DHCP_RECEIVE_BUFFER *RxBufPtr
@@ -1139,6 +1144,7 @@ DHCPAckEdit (
//
// get an offer/ack
//
+STATIC
EFI_STATUS
GetOfferAck (
PXE_BASECODE_DEVICE *Private,
@@ -1249,6 +1255,7 @@ Returns:
//
// get DHCPOFFER's
//
+STATIC
EFI_STATUS
GetOffers (
PXE_BASECODE_DEVICE *Private
@@ -2146,6 +2153,7 @@ DoDhcpDora (
//
// determine if the server ip is in the ip list
//
+STATIC
BOOLEAN
InServerList (
EFI_IP_ADDRESS *ServerIpPtr,
@@ -2172,6 +2180,7 @@ InServerList (
}
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
+STATIC
BOOLEAN
ExtractBootServerList (
UINT16 Type,
@@ -2209,6 +2218,7 @@ ExtractBootServerList (
}
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
+STATIC
VOID
FreeMem (
PXE_BASECODE_DEVICE *Private
@@ -2226,6 +2236,7 @@ FreeMem (
}
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
+STATIC
BOOLEAN
GetMem (
PXE_BASECODE_DEVICE *Private
@@ -2443,6 +2454,7 @@ VerifyCredentialOption (
}
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
+STATIC
EFI_STATUS
DoDiscover (
PXE_BASECODE_DEVICE *Private,
@@ -3210,13 +3222,11 @@ Returns:
{
EFI_PXE_BASE_CODE_MODE *PxebcMode;
EFI_STATUS Status;
- EFI_STATUS StatCode;
PXE_BASECODE_DEVICE *Private;
//
// Lock the instance data and make sure started
//
- StatCode = EFI_SUCCESS;
if (This == NULL) {
DEBUG ((EFI_D_ERROR, "BC *This pointer == NULL"));
diff --git a/EdkModulePkg/Universal/Network/PxeBc/Dxe/pxe_bc_mtftp.c b/EdkModulePkg/Universal/Network/PxeBc/Dxe/pxe_bc_mtftp.c
index e6e91c3c10..b99f2d303d 100644
--- a/EdkModulePkg/Universal/Network/PxeBc/Dxe/pxe_bc_mtftp.c
+++ b/EdkModulePkg/Universal/Network/PxeBc/Dxe/pxe_bc_mtftp.c
@@ -36,6 +36,7 @@ Revision History
#include "Bc.h"
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
+STATIC
UINT64
Swap64 (
UINT64 n
@@ -1182,6 +1183,7 @@ Returns:
}
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
+STATIC
EFI_STATUS
MtftpDownload (
PXE_BASECODE_DEVICE *Private,
@@ -1930,6 +1932,7 @@ Returns:
}
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
+STATIC
EFI_STATUS
PxeBcMtftp (
PXE_BASECODE_DEVICE *Private,
diff --git a/EdkModulePkg/Universal/Network/PxeBc/Dxe/pxe_loadfile.c b/EdkModulePkg/Universal/Network/PxeBc/Dxe/pxe_loadfile.c
index 182462c02f..6659bc4022 100644
--- a/EdkModulePkg/Universal/Network/PxeBc/Dxe/pxe_loadfile.c
+++ b/EdkModulePkg/Universal/Network/PxeBc/Dxe/pxe_loadfile.c
@@ -393,24 +393,23 @@ Returns:
if (gST->ConIn->ReadKeyStroke (gST->ConIn, &Key) == EFI_NOT_READY) {
UINT8 Buffer[512];
UINTN BufferSize;
- EFI_STATUS Status;
BufferSize = sizeof Buffer;
- Status = Private->EfiBc.UdpRead (
- &Private->EfiBc,
- EFI_PXE_BASE_CODE_UDP_OPFLAGS_ANY_SRC_IP |
- EFI_PXE_BASE_CODE_UDP_OPFLAGS_ANY_SRC_PORT |
- EFI_PXE_BASE_CODE_UDP_OPFLAGS_ANY_DEST_PORT,
- NULL, /* dest ip */
- NULL, /* dest port */
- NULL, /* src ip */
- NULL, /* src port */
- NULL, /* hdr size */
- NULL, /* hdr ptr */
- &BufferSize,
- Buffer
- );
+ Private->EfiBc.UdpRead (
+ &Private->EfiBc,
+ EFI_PXE_BASE_CODE_UDP_OPFLAGS_ANY_SRC_IP |
+ EFI_PXE_BASE_CODE_UDP_OPFLAGS_ANY_SRC_PORT |
+ EFI_PXE_BASE_CODE_UDP_OPFLAGS_ANY_DEST_PORT,
+ NULL, /* dest ip */
+ NULL, /* dest port */
+ NULL, /* src ip */
+ NULL, /* src port */
+ NULL, /* hdr size */
+ NULL, /* hdr ptr */
+ &BufferSize,
+ Buffer
+ );
continue;
}
@@ -870,6 +869,7 @@ Returns:
return NULL;
}
+STATIC
UINT8 *
PxeBcFindDhcpOpt (
EFI_PXE_BASE_CODE_PACKET *PacketPtr,
@@ -1088,7 +1088,6 @@ Returns:
if (Private->EfiBc.Mode->BisSupported && Private->EfiBc.Mode->BisDetected && Private->EfiBc.Mode->PxeBisReplyReceived) {
UINT64 CredentialLen;
- UINTN BlockSize;
UINT8 CredentialFilename[256];
UINT8 *op;
VOID *CredentialBuffer;
@@ -1398,11 +1397,6 @@ Returns:
AsciiPrint ("Running LoadFile()\n");
- //
- // Resolve Warning 4 unreferenced parameter problem
- //
- FilePath = NULL;
-
//
// If either if these parameters are NULL, we cannot continue.
//
diff --git a/EdkModulePkg/Universal/Network/Snp32_64/Dxe/Snp.h b/EdkModulePkg/Universal/Network/Snp32_64/Dxe/Snp.h
index 05c5a8bb92..3055b8683a 100644
--- a/EdkModulePkg/Universal/Network/Snp32_64/Dxe/Snp.h
+++ b/EdkModulePkg/Universal/Network/Snp32_64/Dxe/Snp.h
@@ -385,11 +385,45 @@ snp_undi32_receive (
)
;
+VOID
+EFIAPI
+SnpWaitForPacketNotify (
+ IN EFI_EVENT Event,
+ IN VOID *SnpPtr
+ );
+
+EFI_STATUS
+pxe_start (
+ SNP_DRIVER *snp
+ );
+
+EFI_STATUS
+pxe_stop (
+ SNP_DRIVER *snp
+ );
+
+EFI_STATUS
+pxe_init (
+ SNP_DRIVER *snp,
+ UINT16 OpFlags
+ );
+
+EFI_STATUS
+pxe_shutdown (
+ SNP_DRIVER *snp
+ );
+
+EFI_STATUS
+pxe_get_stn_addr (
+ SNP_DRIVER *snp
+ );
+
typedef
EFI_STATUS
(*issue_undi32_command) (
UINT64 cdb
);
+
typedef
VOID
(*ptr) (
diff --git a/EdkModulePkg/Universal/Network/Snp32_64/Dxe/callback.c b/EdkModulePkg/Universal/Network/Snp32_64/Dxe/callback.c
index 65a4d580d4..54574cb4ab 100644
--- a/EdkModulePkg/Universal/Network/Snp32_64/Dxe/callback.c
+++ b/EdkModulePkg/Universal/Network/Snp32_64/Dxe/callback.c
@@ -182,19 +182,19 @@ Returns:
switch (NumBytes) {
case 2:
- Width = 1;
+ Width = (EFI_PCI_IO_PROTOCOL_WIDTH) 1;
break;
case 4:
- Width = 2;
+ Width = (EFI_PCI_IO_PROTOCOL_WIDTH) 2;
break;
case 8:
- Width = 3;
+ Width = (EFI_PCI_IO_PROTOCOL_WIDTH) 3;
break;
default:
- Width = 0;
+ Width = (EFI_PCI_IO_PROTOCOL_WIDTH) 0;
}
switch (ReadOrWrite) {
@@ -344,18 +344,18 @@ Returns:
snp = (SNP_DRIVER *) (UINTN) UniqueId;
- Width = 0;
+ Width = (EFI_PCI_IO_PROTOCOL_WIDTH) 0;
switch (NumBytes) {
case 2:
- Width = 1;
+ Width = (EFI_PCI_IO_PROTOCOL_WIDTH) 1;
break;
case 4:
- Width = 2;
+ Width = (EFI_PCI_IO_PROTOCOL_WIDTH) 2;
break;
case 8:
- Width = 3;
+ Width = (EFI_PCI_IO_PROTOCOL_WIDTH) 3;
break;
}
diff --git a/EdkModulePkg/Universal/Network/Snp32_64/Dxe/get_status.c b/EdkModulePkg/Universal/Network/Snp32_64/Dxe/get_status.c
index 6d89d4c9c6..c301b92aaf 100644
--- a/EdkModulePkg/Universal/Network/Snp32_64/Dxe/get_status.c
+++ b/EdkModulePkg/Universal/Network/Snp32_64/Dxe/get_status.c
@@ -20,6 +20,7 @@ Revision history:
#include "Snp.h"
+STATIC
EFI_STATUS
pxe_getstatus (
SNP_DRIVER *snp,
diff --git a/EdkModulePkg/Universal/Network/Snp32_64/Dxe/initialize.c b/EdkModulePkg/Universal/Network/Snp32_64/Dxe/initialize.c
index cb80171b24..80e6033ff7 100644
--- a/EdkModulePkg/Universal/Network/Snp32_64/Dxe/initialize.c
+++ b/EdkModulePkg/Universal/Network/Snp32_64/Dxe/initialize.c
@@ -20,13 +20,6 @@ Revision history:
#include "Snp.h"
-VOID
-EFIAPI
-SnpWaitForPacketNotify (
- IN EFI_EVENT Event,
- IN VOID *SnpPtr
- );
-
EFI_STATUS
pxe_init (
SNP_DRIVER *snp,
diff --git a/EdkModulePkg/Universal/Network/Snp32_64/Dxe/mcast_ip_to_mac.c b/EdkModulePkg/Universal/Network/Snp32_64/Dxe/mcast_ip_to_mac.c
index 11b29f4fd7..e768b85dce 100644
--- a/EdkModulePkg/Universal/Network/Snp32_64/Dxe/mcast_ip_to_mac.c
+++ b/EdkModulePkg/Universal/Network/Snp32_64/Dxe/mcast_ip_to_mac.c
@@ -20,6 +20,7 @@ Revision history:
#include "Snp.h"
+STATIC
EFI_STATUS
pxe_ip2mac (
IN SNP_DRIVER *snp,
diff --git a/EdkModulePkg/Universal/Network/Snp32_64/Dxe/nvdata.c b/EdkModulePkg/Universal/Network/Snp32_64/Dxe/nvdata.c
index e9302da607..ada3069239 100644
--- a/EdkModulePkg/Universal/Network/Snp32_64/Dxe/nvdata.c
+++ b/EdkModulePkg/Universal/Network/Snp32_64/Dxe/nvdata.c
@@ -20,6 +20,7 @@ Revision history:
#include "Snp.h"
+STATIC
EFI_STATUS
pxe_nvdata_read (
IN SNP_DRIVER *snp,
diff --git a/EdkModulePkg/Universal/Network/Snp32_64/Dxe/receive.c b/EdkModulePkg/Universal/Network/Snp32_64/Dxe/receive.c
index 2d92ddeeed..7c9cf5e084 100644
--- a/EdkModulePkg/Universal/Network/Snp32_64/Dxe/receive.c
+++ b/EdkModulePkg/Universal/Network/Snp32_64/Dxe/receive.c
@@ -20,6 +20,7 @@ Revision history:
#include "Snp.h"
+STATIC
EFI_STATUS
pxe_receive (
SNP_DRIVER *snp,
diff --git a/EdkModulePkg/Universal/Network/Snp32_64/Dxe/receive_filters.c b/EdkModulePkg/Universal/Network/Snp32_64/Dxe/receive_filters.c
index 6e234de96c..258c4a9b36 100644
--- a/EdkModulePkg/Universal/Network/Snp32_64/Dxe/receive_filters.c
+++ b/EdkModulePkg/Universal/Network/Snp32_64/Dxe/receive_filters.c
@@ -20,6 +20,7 @@ Revision history:
#include "Snp.h"
+STATIC
EFI_STATUS
pxe_rcvfilter_enable (
SNP_DRIVER *snp,
@@ -112,6 +113,7 @@ Returns:
return EFI_SUCCESS;
}
+STATIC
EFI_STATUS
pxe_rcvfilter_disable (
SNP_DRIVER *snp,
@@ -191,6 +193,7 @@ Returns:
return EFI_SUCCESS;
}
+STATIC
EFI_STATUS
pxe_rcvfilter_read (
SNP_DRIVER *snp
diff --git a/EdkModulePkg/Universal/Network/Snp32_64/Dxe/reset.c b/EdkModulePkg/Universal/Network/Snp32_64/Dxe/reset.c
index a8dace6e10..757e8e0e94 100644
--- a/EdkModulePkg/Universal/Network/Snp32_64/Dxe/reset.c
+++ b/EdkModulePkg/Universal/Network/Snp32_64/Dxe/reset.c
@@ -20,6 +20,7 @@ Revision history:
#include "Snp.h"
+STATIC
EFI_STATUS
pxe_reset (
SNP_DRIVER *snp
@@ -96,11 +97,6 @@ Returns:
{
SNP_DRIVER *snp;
- //
- // Resolve Warning 4 unreferenced parameter problem
- //
- ExtendedVerification = 0;
-
if (this == NULL) {
return EFI_INVALID_PARAMETER;
}
diff --git a/EdkModulePkg/Universal/Network/Snp32_64/Dxe/snp.c b/EdkModulePkg/Universal/Network/Snp32_64/Dxe/snp.c
index c83ca377ab..7146e462c7 100644
--- a/EdkModulePkg/Universal/Network/Snp32_64/Dxe/snp.c
+++ b/EdkModulePkg/Universal/Network/Snp32_64/Dxe/snp.c
@@ -18,72 +18,6 @@ Abstract:
#include "Snp.h"
-EFI_STATUS
-pxe_start (
- SNP_DRIVER *snp
- );
-EFI_STATUS
-pxe_stop (
- SNP_DRIVER *snp
- );
-EFI_STATUS
-pxe_init (
- SNP_DRIVER *snp,
- UINT16 OpFlags
- );
-EFI_STATUS
-pxe_shutdown (
- SNP_DRIVER *snp
- );
-EFI_STATUS
-pxe_get_stn_addr (
- SNP_DRIVER *snp
- );
-
-EFI_STATUS
-EFIAPI
-InitializeSnpNiiDriver (
- IN EFI_HANDLE image_handle,
- IN EFI_SYSTEM_TABLE *system_table
- );
-
-EFI_STATUS
-EFIAPI
-SimpleNetworkDriverSupported (
- IN EFI_DRIVER_BINDING_PROTOCOL *This,
- IN EFI_HANDLE Controller,
- IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
- );
-
-EFI_STATUS
-EFIAPI
-SimpleNetworkDriverStart (
- IN EFI_DRIVER_BINDING_PROTOCOL *This,
- IN EFI_HANDLE Controller,
- IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
- );
-
-EFI_STATUS
-EFIAPI
-SimpleNetworkDriverStop (
- IN EFI_DRIVER_BINDING_PROTOCOL *This,
- IN EFI_HANDLE Controller,
- IN UINTN NumberOfChildren,
- IN EFI_HANDLE *ChildHandleBuffer
- );
-
-//
-// Simple Network Protocol Driver Global Variables
-//
-EFI_DRIVER_BINDING_PROTOCOL mSimpleNetworkDriverBinding = {
- SimpleNetworkDriverSupported,
- SimpleNetworkDriverStart,
- SimpleNetworkDriverStop,
- 0xa,
- NULL,
- NULL
-};
-
//
// Module global variables needed to support undi 3.0 interface
//
@@ -91,202 +25,6 @@ EFI_PCI_IO_PROTOCOL *mPciIoFncs;
struct s_v2p *_v2p = NULL; // undi3.0 map_list head
// End Global variables
//
-EFI_STATUS
-add_v2p (
- IN OUT struct s_v2p **v2p,
- EFI_PCI_IO_PROTOCOL_OPERATION type,
- VOID *vaddr,
- UINTN bsize
- )
-/*++
-
-Routine Description:
- This routine maps the given CPU address to a Device address. It creates a
- an entry in the map list with the virtual and physical addresses and the
- un map cookie.
-
-Arguments:
- v2p - pointer to return a map list node pointer.
- type - the direction in which the data flows from the given virtual address
- device->cpu or cpu->device or both ways.
- vaddr - virtual address (or CPU address) to be mapped
- bsize - size of the buffer to be mapped.
-
-Returns:
-
- EFI_SUCEESS - routine has completed the mapping
- other - error as indicated.
-
---*/
-{
- EFI_STATUS Status;
-
- if ((v2p == NULL) || (vaddr == NULL) || (bsize == 0)) {
- return EFI_INVALID_PARAMETER;
- }
-
- Status = gBS->AllocatePool (
- EfiBootServicesData,
- sizeof (struct s_v2p),
- (VOID **) v2p
- );
-
- if (Status != EFI_SUCCESS) {
- return Status;
- }
-
- Status = mPciIoFncs->Map (
- mPciIoFncs,
- type,
- vaddr,
- &bsize,
- &(*v2p)->paddr,
- &(*v2p)->unmap
- );
- if (Status != EFI_SUCCESS) {
- gBS->FreePool (*v2p);
- return Status;
- }
- (*v2p)->vaddr = vaddr;
- (*v2p)->bsize = bsize;
- (*v2p)->next = _v2p;
- _v2p = *v2p;
-
- return EFI_SUCCESS;
-}
-
-EFI_STATUS
-find_v2p (
- struct s_v2p **v2p,
- VOID *vaddr
- )
-/*++
-
-Routine Description:
- This routine searches the linked list of mapped address nodes (for undi3.0
- interface) to find the node that corresponds to the given virtual address and
- returns a pointer to that node.
-
-Arguments:
- v2p - pointer to return a map list node pointer.
- vaddr - virtual address (or CPU address) to be searched in the map list
-
-Returns:
-
- EFI_SUCEESS - if a match found!
- Other - match not found
-
---*/
-{
- struct s_v2p *v;
-
- if (v2p == NULL || vaddr == NULL) {
- return EFI_INVALID_PARAMETER;
- }
-
- for (v = _v2p; v != NULL; v = v->next) {
- if (v->vaddr == vaddr) {
- *v2p = v;
- return EFI_SUCCESS;
- }
- }
-
- return EFI_NOT_FOUND;
-}
-
-EFI_STATUS
-del_v2p (
- VOID *vaddr
- )
-/*++
-
-Routine Description:
- This routine unmaps the given virtual address and frees the memory allocated
- for the map list node corresponding to that address.
-
-Arguments:
- vaddr - virtual address (or CPU address) to be unmapped
-
-Returns:
- EFI_SUCEESS - if successfully unmapped
- Other - as indicated by the error
-
-
---*/
-{
- struct s_v2p *v;
- struct s_v2p *t;
- EFI_STATUS Status;
-
- if (vaddr == NULL) {
- return EFI_INVALID_PARAMETER;
- }
-
- if (_v2p == NULL) {
- return EFI_NOT_FOUND;
- }
- //
- // Is our node at the head of the list??
- //
- if ((v = _v2p)->vaddr == vaddr) {
- _v2p = _v2p->next;
-
- Status = mPciIoFncs->Unmap (mPciIoFncs, v->unmap);
-
- gBS->FreePool (v);
-
-#if SNP_DEBUG
- if (Status) {
- Print (L"Unmap failed with status = %x\n", Status);
- }
-#endif
- return Status;
- }
-
- for (; v->next != NULL; v = t) {
- if ((t = v->next)->vaddr == vaddr) {
- v->next = t->next;
- Status = mPciIoFncs->Unmap (mPciIoFncs, t->unmap);
- gBS->FreePool (t);
-#if SNP_DEBUG
- if (Status) {
- Print (L"Unmap failed with status = %x\n", Status);
- }
-#endif
- return Status;
- }
- }
-
- return EFI_NOT_FOUND;
-}
-
-#if SNP_DEBUG
-VOID
-snp_wait_for_key (
- VOID
- )
-/*++
-
-Routine Description:
- Wait for a key stroke, used for debugging purposes
-
-Arguments:
- none
-
-Returns:
- none
-
---*/
-{
- EFI_INPUT_KEY key;
-
- Aprint ("\nPress any key to continue\n");
-
- while (gST->ConIn->ReadKeyStroke (gST->ConIn, &key) == EFI_NOT_READY) {
- ;
- }
-}
-#endif
STATIC
EFI_STATUS
@@ -355,6 +93,7 @@ Returns:
return cksum;
}
+STATIC
EFI_STATUS
EFIAPI
SimpleNetworkDriverSupported (
@@ -531,6 +270,7 @@ Done:
return Status;
}
+STATIC
EFI_STATUS
EFIAPI
SimpleNetworkDriverStart (
@@ -1190,6 +930,7 @@ NiiError:
return Status;
}
+STATIC
EFI_STATUS
EFIAPI
SimpleNetworkDriverStop (
@@ -1313,3 +1054,211 @@ Returns:
return Status;
}
+//
+// Simple Network Protocol Driver Global Variables
+//
+EFI_DRIVER_BINDING_PROTOCOL mSimpleNetworkDriverBinding = {
+ SimpleNetworkDriverSupported,
+ SimpleNetworkDriverStart,
+ SimpleNetworkDriverStop,
+ 0xa,
+ NULL,
+ NULL
+};
+
+EFI_STATUS
+add_v2p (
+ IN OUT struct s_v2p **v2p,
+ EFI_PCI_IO_PROTOCOL_OPERATION type,
+ VOID *vaddr,
+ UINTN bsize
+ )
+/*++
+
+Routine Description:
+ This routine maps the given CPU address to a Device address. It creates a
+ an entry in the map list with the virtual and physical addresses and the
+ un map cookie.
+
+Arguments:
+ v2p - pointer to return a map list node pointer.
+ type - the direction in which the data flows from the given virtual address
+ device->cpu or cpu->device or both ways.
+ vaddr - virtual address (or CPU address) to be mapped
+ bsize - size of the buffer to be mapped.
+
+Returns:
+
+ EFI_SUCEESS - routine has completed the mapping
+ other - error as indicated.
+
+--*/
+{
+ EFI_STATUS Status;
+
+ if ((v2p == NULL) || (vaddr == NULL) || (bsize == 0)) {
+ return EFI_INVALID_PARAMETER;
+ }
+
+ Status = gBS->AllocatePool (
+ EfiBootServicesData,
+ sizeof (struct s_v2p),
+ (VOID **) v2p
+ );
+
+ if (Status != EFI_SUCCESS) {
+ return Status;
+ }
+
+ Status = mPciIoFncs->Map (
+ mPciIoFncs,
+ type,
+ vaddr,
+ &bsize,
+ &(*v2p)->paddr,
+ &(*v2p)->unmap
+ );
+ if (Status != EFI_SUCCESS) {
+ gBS->FreePool (*v2p);
+ return Status;
+ }
+ (*v2p)->vaddr = vaddr;
+ (*v2p)->bsize = bsize;
+ (*v2p)->next = _v2p;
+ _v2p = *v2p;
+
+ return EFI_SUCCESS;
+}
+
+EFI_STATUS
+find_v2p (
+ struct s_v2p **v2p,
+ VOID *vaddr
+ )
+/*++
+
+Routine Description:
+ This routine searches the linked list of mapped address nodes (for undi3.0
+ interface) to find the node that corresponds to the given virtual address and
+ returns a pointer to that node.
+
+Arguments:
+ v2p - pointer to return a map list node pointer.
+ vaddr - virtual address (or CPU address) to be searched in the map list
+
+Returns:
+
+ EFI_SUCEESS - if a match found!
+ Other - match not found
+
+--*/
+{
+ struct s_v2p *v;
+
+ if (v2p == NULL || vaddr == NULL) {
+ return EFI_INVALID_PARAMETER;
+ }
+
+ for (v = _v2p; v != NULL; v = v->next) {
+ if (v->vaddr == vaddr) {
+ *v2p = v;
+ return EFI_SUCCESS;
+ }
+ }
+
+ return EFI_NOT_FOUND;
+}
+
+EFI_STATUS
+del_v2p (
+ VOID *vaddr
+ )
+/*++
+
+Routine Description:
+ This routine unmaps the given virtual address and frees the memory allocated
+ for the map list node corresponding to that address.
+
+Arguments:
+ vaddr - virtual address (or CPU address) to be unmapped
+
+Returns:
+ EFI_SUCEESS - if successfully unmapped
+ Other - as indicated by the error
+
+
+--*/
+{
+ struct s_v2p *v;
+ struct s_v2p *t;
+ EFI_STATUS Status;
+
+ if (vaddr == NULL) {
+ return EFI_INVALID_PARAMETER;
+ }
+
+ if (_v2p == NULL) {
+ return EFI_NOT_FOUND;
+ }
+ //
+ // Is our node at the head of the list??
+ //
+ if ((v = _v2p)->vaddr == vaddr) {
+ _v2p = _v2p->next;
+
+ Status = mPciIoFncs->Unmap (mPciIoFncs, v->unmap);
+
+ gBS->FreePool (v);
+
+#if SNP_DEBUG
+ if (Status) {
+ Print (L"Unmap failed with status = %x\n", Status);
+ }
+#endif
+ return Status;
+ }
+
+ for (; v->next != NULL; v = t) {
+ if ((t = v->next)->vaddr == vaddr) {
+ v->next = t->next;
+ Status = mPciIoFncs->Unmap (mPciIoFncs, t->unmap);
+ gBS->FreePool (t);
+#if SNP_DEBUG
+ if (Status) {
+ Print (L"Unmap failed with status = %x\n", Status);
+ }
+#endif
+ return Status;
+ }
+ }
+
+ return EFI_NOT_FOUND;
+}
+
+#if SNP_DEBUG
+VOID
+snp_wait_for_key (
+ VOID
+ )
+/*++
+
+Routine Description:
+ Wait for a key stroke, used for debugging purposes
+
+Arguments:
+ none
+
+Returns:
+ none
+
+--*/
+{
+ EFI_INPUT_KEY key;
+
+ Aprint ("\nPress any key to continue\n");
+
+ while (gST->ConIn->ReadKeyStroke (gST->ConIn, &key) == EFI_NOT_READY) {
+ ;
+ }
+}
+#endif
diff --git a/EdkModulePkg/Universal/Network/Snp32_64/Dxe/station_address.c b/EdkModulePkg/Universal/Network/Snp32_64/Dxe/station_address.c
index b5d2c40220..a55a644f6e 100644
--- a/EdkModulePkg/Universal/Network/Snp32_64/Dxe/station_address.c
+++ b/EdkModulePkg/Universal/Network/Snp32_64/Dxe/station_address.c
@@ -95,6 +95,7 @@ Returns:
return EFI_SUCCESS;
}
+STATIC
EFI_STATUS
pxe_set_stn_addr (
SNP_DRIVER *snp,
diff --git a/EdkModulePkg/Universal/Network/Snp32_64/Dxe/transmit.c b/EdkModulePkg/Universal/Network/Snp32_64/Dxe/transmit.c
index 404c75d5ae..3c722c9a50 100644
--- a/EdkModulePkg/Universal/Network/Snp32_64/Dxe/transmit.c
+++ b/EdkModulePkg/Universal/Network/Snp32_64/Dxe/transmit.c
@@ -21,6 +21,7 @@ Revision history:
#include "Snp.h"
+STATIC
EFI_STATUS
pxe_fillheader (
SNP_DRIVER *snp,
@@ -191,6 +192,7 @@ Returns:
}
}
+STATIC
EFI_STATUS
pxe_transmit (
SNP_DRIVER *snp,
diff --git a/EdkModulePkg/Universal/PCD/Dxe/Pcd.c b/EdkModulePkg/Universal/PCD/Dxe/Pcd.c
index 641cb706ee..2fd9cab523 100644
--- a/EdkModulePkg/Universal/PCD/Dxe/Pcd.c
+++ b/EdkModulePkg/Universal/PCD/Dxe/Pcd.c
@@ -525,12 +525,17 @@ DxePcdGetNextToken (
)
{
EFI_STATUS Status;
+ BOOLEAN PeiExMapTableEmpty;
+ BOOLEAN DxeExMapTableEmpty;
if (!FeaturePcdGet (PcdDxePcdDatabaseTraverseEnabled)) {
return EFI_UNSUPPORTED;
}
Status = EFI_NOT_FOUND;
+ PeiExMapTableEmpty = PEI_EXMAP_TABLE_EMPTY;
+ DxeExMapTableEmpty = DXE_EXMAP_TABLE_EMPTY;
+
//
// Scan the local token space
//
@@ -557,12 +562,12 @@ DxePcdGetNextToken (
return EFI_SUCCESS;
}
- if (PEI_EXMAP_TABLE_EMPTY && DXE_EXMAP_TABLE_EMPTY) {
+ if (PeiExMapTableEmpty && DxeExMapTableEmpty) {
*TokenNumber = PCD_INVALID_TOKEN_NUMBER;
return EFI_NOT_FOUND;
}
- if (!PEI_EXMAP_TABLE_EMPTY) {
+ if (!PeiExMapTableEmpty) {
Status = ExGetNextTokeNumber (
Guid,
TokenNumber,
@@ -577,7 +582,7 @@ DxePcdGetNextToken (
return Status;
}
- if (!DXE_EXMAP_TABLE_EMPTY) {
+ if (!DxeExMapTableEmpty) {
Status = ExGetNextTokeNumber (
Guid,
TokenNumber,
@@ -591,7 +596,7 @@ DxePcdGetNextToken (
return Status;
}
-
+STATIC
EFI_GUID **
GetDistinctTokenSpace (
IN OUT UINTN *ExMapTableSize,
@@ -649,6 +654,8 @@ DxePcdGetNextTokenSpace (
EFI_GUID **PeiTokenSpaceTable;
EFI_GUID **DxeTokenSpaceTable;
BOOLEAN Match;
+ BOOLEAN PeiExMapTableEmpty;
+ BOOLEAN DxeExMapTableEmpty;
if (!FeaturePcdGet (PcdDxePcdDatabaseTraverseEnabled)) {
return EFI_UNSUPPORTED;
@@ -656,7 +663,10 @@ DxePcdGetNextTokenSpace (
ASSERT (Guid != NULL);
- if (PEI_EXMAP_TABLE_EMPTY && DXE_EXMAP_TABLE_EMPTY) {
+ PeiExMapTableEmpty = PEI_EXMAP_TABLE_EMPTY;
+ DxeExMapTableEmpty = DXE_EXMAP_TABLE_EMPTY;
+
+ if (PeiExMapTableEmpty && DxeExMapTableEmpty) {
if (*Guid != NULL) {
return EFI_NOT_FOUND;
} else {
@@ -668,7 +678,7 @@ DxePcdGetNextTokenSpace (
if (TmpTokenSpaceBuffer[0] == NULL) {
PeiTokenSpaceTableSize = 0;
- if (!PEI_EXMAP_TABLE_EMPTY) {
+ if (!PeiExMapTableEmpty) {
PeiTokenSpaceTableSize = PEI_EXMAPPING_TABLE_SIZE;
PeiTokenSpaceTable = GetDistinctTokenSpace (&PeiTokenSpaceTableSize,
mPcdDatabase->PeiDb.Init.ExMapTable,
@@ -677,7 +687,7 @@ DxePcdGetNextTokenSpace (
CopyMem (TmpTokenSpaceBuffer, PeiTokenSpaceTable, sizeof (EFI_GUID*) * PeiTokenSpaceTableSize);
}
- if (!DXE_EXMAP_TABLE_EMPTY) {
+ if (!DxeExMapTableEmpty) {
DxeTokenSpaceTableSize = DXE_EXMAPPING_TABLE_SIZE;
DxeTokenSpaceTable = GetDistinctTokenSpace (&DxeTokenSpaceTableSize,
mPcdDatabase->DxeDb.Init.ExMapTable,
diff --git a/EdkModulePkg/Universal/PCD/Dxe/Service.c b/EdkModulePkg/Universal/PCD/Dxe/Service.c
index 51e16624ef..8ff45d38da 100644
--- a/EdkModulePkg/Universal/PCD/Dxe/Service.c
+++ b/EdkModulePkg/Universal/PCD/Dxe/Service.c
@@ -28,7 +28,6 @@ GetWorker (
)
{
UINT32 *LocalTokenNumberTable;
- UINT16 *SizeTable;
EFI_GUID *GuidTable;
UINT16 *StringTable;
EFI_GUID *Guid;
@@ -76,14 +75,11 @@ GetWorker (
// EBC compiler is very choosy. It may report warning about comparison
// between UINTN and 0 . So we add 1 in each size of the
// comparison.
- IsPeiDb = (TokenNumber + 1 < PEI_LOCAL_TOKEN_NUMBER + 1) ? TRUE : FALSE;
+ IsPeiDb = (BOOLEAN) ((TokenNumber + 1 < PEI_LOCAL_TOKEN_NUMBER + 1) ? TRUE : FALSE);
LocalTokenNumberTable = IsPeiDb ? mPcdDatabase->PeiDb.Init.LocalTokenNumberTable :
mPcdDatabase->DxeDb.Init.LocalTokenNumberTable;
- SizeTable = IsPeiDb ? mPcdDatabase->PeiDb.Init.SizeTable:
- mPcdDatabase->DxeDb.Init.SizeTable;
-
TokenNumber = IsPeiDb ? TokenNumber :
TokenNumber - PEI_LOCAL_TOKEN_NUMBER;
@@ -496,7 +492,7 @@ GetSkuEnabledTokenNumber (
-
+STATIC
VOID
InvokeCallbackOnSet (
UINT32 ExTokenNumber,
@@ -597,7 +593,7 @@ SetWorker (
// EBC compiler is very choosy. It may report warning about comparison
// between UINTN and 0 . So we add 1 in each size of the
// comparison.
- IsPeiDb = (TokenNumber + 1 < PEI_LOCAL_TOKEN_NUMBER + 1) ? TRUE : FALSE;
+ IsPeiDb = (BOOLEAN) ((TokenNumber + 1 < PEI_LOCAL_TOKEN_NUMBER + 1) ? TRUE : FALSE);
LocalTokenNumberTable = IsPeiDb ? mPcdDatabase->PeiDb.Init.LocalTokenNumberTable :
mPcdDatabase->DxeDb.Init.LocalTokenNumberTable;
@@ -895,7 +891,7 @@ GetExPcdTokenNumber (
}
-
+STATIC
SKU_ID *
GetSkuIdArray (
IN UINTN LocalTokenNumberTableIdx,
@@ -923,7 +919,7 @@ GetSkuIdArray (
}
-
+STATIC
UINTN
GetSizeTableIndexA (
IN UINTN LocalTokenNumberTableIdx,
@@ -980,7 +976,7 @@ GetSizeTableIndexA (
-
+STATIC
UINTN
GetSizeTableIndex (
IN UINTN LocalTokenNumberTableIdx,
diff --git a/EdkModulePkg/Universal/PCD/Pei/Pcd.c b/EdkModulePkg/Universal/PCD/Pei/Pcd.c
index 33bc4e1069..b8ed5b2119 100644
--- a/EdkModulePkg/Universal/PCD/Pei/Pcd.c
+++ b/EdkModulePkg/Universal/PCD/Pei/Pcd.c
@@ -502,11 +502,14 @@ PeiPcdGetNextToken (
DYNAMICEX_MAPPING *ExMapTable;
UINTN i;
BOOLEAN Found;
-
+ BOOLEAN PeiExMapTableEmpty;
+
if (!FeaturePcdGet (PcdPeiPcdDatabaseTraverseEnabled)) {
return EFI_UNSUPPORTED;
}
-
+
+ PeiExMapTableEmpty = PEI_EXMAP_TABLE_EMPTY;
+
if (Guid == NULL) {
if (*TokenNumber > PEI_NEX_TOKEN_NUMBER) {
return EFI_NOT_FOUND;
@@ -517,7 +520,7 @@ PeiPcdGetNextToken (
}
return EFI_SUCCESS;
} else {
- if (PEI_EXMAP_TABLE_EMPTY) {
+ if (PeiExMapTableEmpty) {
*TokenNumber = PCD_INVALID_TOKEN_NUMBER;
return EFI_SUCCESS;
}
@@ -597,6 +600,7 @@ PeiPcdGetNextTokenSpace (
DYNAMICEX_MAPPING *ExMapTable;
UINTN i;
BOOLEAN Found;
+ BOOLEAN PeiExMapTableEmpty;
if (!FeaturePcdGet (PcdPeiPcdDatabaseTraverseEnabled)) {
return EFI_UNSUPPORTED;
@@ -604,7 +608,9 @@ PeiPcdGetNextTokenSpace (
ASSERT (Guid != NULL);
- if (PEI_EXMAP_TABLE_EMPTY) {
+ PeiExMapTableEmpty = PEI_EXMAP_TABLE_EMPTY;
+
+ if (PeiExMapTableEmpty) {
if (*Guid != NULL) {
return EFI_NOT_FOUND;
} else {
diff --git a/EdkModulePkg/Universal/PCD/Pei/Service.c b/EdkModulePkg/Universal/PCD/Pei/Service.c
index 521c88b7fc..c228d3b383 100644
--- a/EdkModulePkg/Universal/PCD/Pei/Service.c
+++ b/EdkModulePkg/Universal/PCD/Pei/Service.c
@@ -154,6 +154,7 @@ BuildPcdDatabase (
@retval EFI_SUCCESS Operation successful.
@retval EFI_NOT_FOUND Variablel not found.
--*/
+STATIC
EFI_STATUS
GetHiiVariable (
IN CONST EFI_GUID *VariableGuid,
@@ -205,7 +206,7 @@ GetHiiVariable (
}
-
+STATIC
UINT32
GetSkuEnabledTokenNumber (
UINT32 LocalTokenNumber,
@@ -261,7 +262,7 @@ GetSkuEnabledTokenNumber (
-
+STATIC
VOID
InvokeCallbackOnSet (
UINTN ExTokenNumber,
@@ -651,7 +652,7 @@ GetPcdDatabase (
}
-
+STATIC
SKU_ID *
GetSkuIdArray (
IN UINTN LocalTokenNumberTableIdx,
@@ -672,7 +673,7 @@ GetSkuIdArray (
}
-
+STATIC
UINTN
GetSizeTableIndex (
IN UINTN LocalTokenNumberTableIdx,
diff --git a/EdkModulePkg/Universal/Runtime/RuntimeDxe/Crc32.c b/EdkModulePkg/Universal/Runtime/RuntimeDxe/Crc32.c
index 3692d978f4..dc22fa04fc 100644
--- a/EdkModulePkg/Universal/Runtime/RuntimeDxe/Crc32.c
+++ b/EdkModulePkg/Universal/Runtime/RuntimeDxe/Crc32.c
@@ -74,6 +74,7 @@ Returns:
return EFI_SUCCESS;
}
+STATIC
UINT32
ReverseBits (
UINT32 Value
diff --git a/EdkModulePkg/Universal/Runtime/RuntimeDxe/Runtime.c b/EdkModulePkg/Universal/Runtime/RuntimeDxe/Runtime.c
index 0b6965c8a4..f24d2a5c23 100644
--- a/EdkModulePkg/Universal/Runtime/RuntimeDxe/Runtime.c
+++ b/EdkModulePkg/Universal/Runtime/RuntimeDxe/Runtime.c
@@ -91,6 +91,7 @@ EFI_RUNTIME_ARCH_PROTOCOL mRuntime = {
//
// Worker Functions
//
+STATIC
VOID
RuntimeDriverCalculateEfiHdrCrc (
IN OUT EFI_TABLE_HEADER *Hdr
@@ -224,6 +225,7 @@ Returns:
return EFI_NOT_FOUND;
}
+STATIC
EFI_STATUS
RuntimeDriverConvertInternalPointer (
IN OUT VOID **ConvertAddress
diff --git a/EdkModulePkg/Universal/StatusCode/Dxe/DataHubStatusCodeWorker.c b/EdkModulePkg/Universal/StatusCode/Dxe/DataHubStatusCodeWorker.c
index efd4f5273d..85e552bac0 100644
--- a/EdkModulePkg/Universal/StatusCode/Dxe/DataHubStatusCodeWorker.c
+++ b/EdkModulePkg/Universal/StatusCode/Dxe/DataHubStatusCodeWorker.c
@@ -40,6 +40,7 @@ EFI_DATA_HUB_PROTOCOL *mDataHubProtocol;
@retval !NULL Point to buffer of record.
**/
+STATIC
DATAHUB_STATUSCODE_RECORD *
AcquireRecordBuffer (
VOID
@@ -92,6 +93,7 @@ AcquireRecordBuffer (
@return NULL the FIFO of record is empty.
**/
+STATIC
DATAHUB_STATUSCODE_RECORD *
RetrieveRecord (
VOID
@@ -229,6 +231,7 @@ DataHubStatusCodeReportWorker (
@param Context Context of the event.
**/
+STATIC
VOID
EFIAPI
LogDataHubEventCallBack (
diff --git a/EdkModulePkg/Universal/StatusCode/Dxe/Ipf/DxeStatusCodeIpf.c b/EdkModulePkg/Universal/StatusCode/Dxe/Ipf/DxeStatusCodeIpf.c
index 506a2a1a91..eee0c943f6 100644
--- a/EdkModulePkg/Universal/StatusCode/Dxe/Ipf/DxeStatusCodeIpf.c
+++ b/EdkModulePkg/Universal/StatusCode/Dxe/Ipf/DxeStatusCodeIpf.c
@@ -182,6 +182,7 @@ ReportDispatcher (
@return Value returned in SAL_RETURN_REGS
--*/
+STATIC
SAL_RETURN_REGS
EFIAPI
ReportEsalServiceEntry (
diff --git a/EdkModulePkg/Universal/StatusCode/Dxe/SerialStatusCodeWorker.c b/EdkModulePkg/Universal/StatusCode/Dxe/SerialStatusCodeWorker.c
index 0b16dfeadb..a9dff1defd 100644
--- a/EdkModulePkg/Universal/StatusCode/Dxe/SerialStatusCodeWorker.c
+++ b/EdkModulePkg/Universal/StatusCode/Dxe/SerialStatusCodeWorker.c
@@ -15,6 +15,8 @@
**/
+#include "DxeStatusCode.h"
+
STATIC
EFI_SERIAL_IO_PROTOCOL *mSerialIoProtocol;
diff --git a/EdkModulePkg/Universal/StatusCode/Pei/MemoryStausCodeWorker.c b/EdkModulePkg/Universal/StatusCode/Pei/MemoryStausCodeWorker.c
index 9b703878fd..c49750b2dd 100644
--- a/EdkModulePkg/Universal/StatusCode/Pei/MemoryStausCodeWorker.c
+++ b/EdkModulePkg/Universal/StatusCode/Pei/MemoryStausCodeWorker.c
@@ -14,6 +14,8 @@
**/
+#include "PeiStatusCode.h"
+
/**
Create one memory status code GUID'ed HOB, use PacketIndex
to identify the packet.
@@ -23,6 +25,7 @@
@return Always return pointer of memory status code packet.
**/
+STATIC
MEMORY_STATUSCODE_PACKET_HEADER *
CreateMemoryStatusCodePacket (
UINT16 PacketIndex
diff --git a/EdkModulePkg/Universal/StatusCode/Pei/SerialStatusCodeWorker.c b/EdkModulePkg/Universal/StatusCode/Pei/SerialStatusCodeWorker.c
index 3cd072ca2c..0e3f47e125 100644
--- a/EdkModulePkg/Universal/StatusCode/Pei/SerialStatusCodeWorker.c
+++ b/EdkModulePkg/Universal/StatusCode/Pei/SerialStatusCodeWorker.c
@@ -15,6 +15,8 @@
**/
+#include "PeiStatusCode.h"
+
/**
Convert status code value and extended data to readable ASCII string, send string to serial I/O device.
diff --git a/EdkModulePkg/Universal/UserInterface/DriverSample/DriverSample.c b/EdkModulePkg/Universal/UserInterface/DriverSample/DriverSample.c
index dd316114bf..f78d4226e5 100644
--- a/EdkModulePkg/Universal/UserInterface/DriverSample/DriverSample.c
+++ b/EdkModulePkg/Universal/UserInterface/DriverSample/DriverSample.c
@@ -30,6 +30,7 @@ Abstract:
EFI_GUID mFormSetGuid = FORMSET_GUID;
EFI_GUID mStringPackGuid = STRING_PACK_GUID;
+STATIC
EFI_STATUS
EFIAPI
DriverCallback (
diff --git a/EdkModulePkg/Universal/UserInterface/HiiDataBase/Dxe/Fonts.c b/EdkModulePkg/Universal/UserInterface/HiiDataBase/Dxe/Fonts.c
index d7daa64902..ebab3bc3d0 100644
--- a/EdkModulePkg/Universal/UserInterface/HiiDataBase/Dxe/Fonts.c
+++ b/EdkModulePkg/Universal/UserInterface/HiiDataBase/Dxe/Fonts.c
@@ -210,14 +210,17 @@ Returns:
if (Narrow) {
for (Value = 0; Value != Count; Value++) {
- *GlyphBuffer[Location + Value] |= GlobalData->NarrowGlyphs[Character].GlyphCol1[Value];
+ *GlyphBuffer[Location + Value] = (UINT8) (*GlyphBuffer[Location + Value] |
+ GlobalData->NarrowGlyphs[Character].GlyphCol1[Value]);
}
Attributes = GlobalData->NarrowGlyphs[Character].Attributes & EFI_GLYPH_NON_SPACING;
} else {
for (Value = 0; Value != Count; Value++) {
- *GlyphBuffer[Location + Value] |= GlobalData->WideGlyphs[Character].GlyphCol1[Value];
- *GlyphBuffer[Location + Value + Count] |= GlobalData->WideGlyphs[Character].GlyphCol2[Value];
+ *GlyphBuffer[Location + Value] = (UINT8) (*GlyphBuffer[Location + Value] |
+ GlobalData->WideGlyphs[Character].GlyphCol1[Value]);
+ *GlyphBuffer[Location + Value + Count] = (UINT8) (*GlyphBuffer[Location + Value + Count] |
+ GlobalData->WideGlyphs[Character].GlyphCol2[Value]);
}
Attributes = GlobalData->WideGlyphs[Character].Attributes & EFI_GLYPH_NON_SPACING;
diff --git a/EdkModulePkg/Universal/UserInterface/HiiDataBase/Dxe/Forms.c b/EdkModulePkg/Universal/UserInterface/HiiDataBase/Dxe/Forms.c
index 4178284a49..0c8629c06f 100644
--- a/EdkModulePkg/Universal/UserInterface/HiiDataBase/Dxe/Forms.c
+++ b/EdkModulePkg/Universal/UserInterface/HiiDataBase/Dxe/Forms.c
@@ -22,6 +22,7 @@ Abstract:
#include "HiiDatabase.h"
+STATIC
CHAR16*
Ascii2Unicode (
OUT CHAR16 *UnicodeStr,
@@ -54,6 +55,7 @@ Ascii2Unicode (
}
}
+STATIC
CHAR8*
Unicode2Ascii (
OUT CHAR8 *AsciiStr,
@@ -86,6 +88,7 @@ Unicode2Ascii (
}
}
+STATIC
VOID
ExtractDevicePathData (
IN EFI_HII_DATA_TABLE *DataTable,
@@ -129,6 +132,7 @@ Returns:
*ExportBufferPtr = ExportBuffer;
}
+STATIC
VOID
ExtractVariableData (
IN OUT EFI_HII_DATA_TABLE *DataTable,
@@ -205,6 +209,7 @@ Returns:
&gEfiFormCallbackProtocolGuid,
(VOID *) &FormCallback
);
+ ASSERT_EFI_ERROR (Status);
}
//
// Since we have a "Setup" variable that wasn't specified by a variable op-code
@@ -240,6 +245,7 @@ Returns:
&TempValue,
ExportBuffer
);
+ ASSERT_EFI_ERROR (Status);
} else {
Status = gRT->GetVariable (
(CHAR16 *) SETUP_MAP_NAME,
@@ -248,6 +254,7 @@ Returns:
&TempValue,
ExportBuffer
);
+ ASSERT_EFI_ERROR (Status);
}
ExportBuffer = (UINT8 *) (UINTN) (((UINTN) ExportBuffer) + TempValue);
@@ -306,6 +313,7 @@ Returns:
&TempValue,
ExportBuffer
);
+ ASSERT_EFI_ERROR (Status);
} else {
Status = gRT->GetVariable (
String,
@@ -314,6 +322,7 @@ Returns:
&TempValue,
ExportBuffer
);
+ ASSERT_EFI_ERROR (Status);
}
ExportBuffer = (UINT8 *) (UINTN) (((UINTN) ExportBuffer) + TempValue);
@@ -367,7 +376,6 @@ Returns:
UINT8 *ExportBuffer;
EFI_HII_EXPORT_TABLE *ExportTable;
EFI_HII_DATA_TABLE *DataTable;
- BOOLEAN InsufficientSize;
BOOLEAN VariableExist;
UINT16 NumberOfHiiDataTables;
UINTN SizeNeeded;
@@ -386,7 +394,6 @@ Returns:
FormPack = NULL;
RawData = NULL;
PackageInstance = NULL;
- InsufficientSize = FALSE;
NumberOfHiiDataTables = 0;
VariableSize = 0;
TempValue = 0;
diff --git a/EdkModulePkg/Universal/UserInterface/HiiDataBase/Dxe/HiiDatabase.c b/EdkModulePkg/Universal/UserInterface/HiiDataBase/Dxe/HiiDatabase.c
index ce34eff5bd..bcec42b24e 100644
--- a/EdkModulePkg/Universal/UserInterface/HiiDataBase/Dxe/HiiDatabase.c
+++ b/EdkModulePkg/Universal/UserInterface/HiiDataBase/Dxe/HiiDatabase.c
@@ -154,7 +154,6 @@ Returns:
--*/
{
- EFI_HII_GLOBAL_DATA *GlobalData;
EFI_HII_HANDLE_DATABASE *Database;
EFI_HII_DATA *HiiData;
UINTN HandleCount;
@@ -165,8 +164,6 @@ Returns:
HiiData = EFI_HII_DATA_FROM_THIS (This);
- GlobalData = HiiData->GlobalData;
-
Database = HiiData->DatabaseHead;
if (Database == NULL) {
@@ -333,7 +330,6 @@ Returns:
EFI_HII_DATA *HiiData;
EFI_HII_HANDLE_DATABASE *HandleDatabase;
EFI_HII_STRING_PACK *StringPack;
- EFI_HII_STRING_PACK *Location;
RELOFST Token;
UINT32 Length;
@@ -376,8 +372,6 @@ Returns:
StringPack = (EFI_HII_STRING_PACK *) (&StringPackageInstance->IfrData);
}
- Location = StringPack;
-
//
// Remember that the string packages are formed into contiguous blocks of language data.
//
diff --git a/EdkModulePkg/Universal/UserInterface/HiiDataBase/Dxe/Package.c b/EdkModulePkg/Universal/UserInterface/HiiDataBase/Dxe/Package.c
index 3e9e5364e9..ec3f49c5dc 100644
--- a/EdkModulePkg/Universal/UserInterface/HiiDataBase/Dxe/Package.c
+++ b/EdkModulePkg/Universal/UserInterface/HiiDataBase/Dxe/Package.c
@@ -264,7 +264,6 @@ Returns:
UINT32 TotalTokenNumber;
UINT8 *Local;
EFI_NARROW_GLYPH *NarrowGlyph;
- EFI_WIDE_GLYPH *WideGlyph;
if (Packages->NumberOfPackages == 0 || This == NULL) {
return EFI_INVALID_PARAMETER;
@@ -439,7 +438,7 @@ Returns:
// we go down one level deeper, increment the handle value that will be passed back.
//
if (Database->Handle >= *Handle) {
- *Handle = Database->Handle + 1;
+ *Handle = (EFI_HII_HANDLE) (Database->Handle + 1);
}
}
@@ -518,7 +517,6 @@ Returns:
Local = (UINT8 *) (&FontPack->NumberOfWideGlyphs + sizeof (UINT8)) +
(sizeof (EFI_NARROW_GLYPH)) *
NumNarrowGlyphs;
- WideGlyph = (EFI_WIDE_GLYPH *) Local;
CopyMem (
&Member,
(UINTN *) (Local + sizeof (EFI_WIDE_GLYPH) * Count),
@@ -530,7 +528,6 @@ Returns:
CopyMem (&Unicode, &GlobalData->WideGlyphs[Member].UnicodeWeight, sizeof (UINT16));
if (Unicode == 0) {
Local = (UINT8*)(&FontPack->NumberOfWideGlyphs + sizeof(UINT8)) + (sizeof(EFI_NARROW_GLYPH)) * NumNarrowGlyphs;
- WideGlyph = (EFI_WIDE_GLYPH *) Local;
CopyMem (
&GlobalData->WideGlyphs[Member],
(UINTN *) (Local + sizeof (EFI_WIDE_GLYPH) * Count),
@@ -619,7 +616,6 @@ Returns:
EFI_HII_DATA *HiiData;
EFI_HII_HANDLE_DATABASE *HandleDatabase;
EFI_HII_HANDLE_DATABASE *PreviousHandleDatabase;
- UINTN Count;
if (This == NULL || Handle == 0) {
return EFI_INVALID_PARAMETER;
@@ -635,7 +631,7 @@ Returns:
//
PreviousHandleDatabase = HandleDatabase;
- for (Count = 0; HandleDatabase != NULL; HandleDatabase = HandleDatabase->NextHandleDatabase) {
+ for (; HandleDatabase != NULL; HandleDatabase = HandleDatabase->NextHandleDatabase) {
//
// Match the numeric value with the database entry - if matched,
// free the package instance and apply fix-up to database linked list
diff --git a/EdkModulePkg/Universal/UserInterface/HiiDataBase/Dxe/Strings.c b/EdkModulePkg/Universal/UserInterface/HiiDataBase/Dxe/Strings.c
index 742a01dc43..26f797e63b 100644
--- a/EdkModulePkg/Universal/UserInterface/HiiDataBase/Dxe/Strings.c
+++ b/EdkModulePkg/Universal/UserInterface/HiiDataBase/Dxe/Strings.c
@@ -22,6 +22,7 @@ Abstract:
#include "HiiDatabase.h"
+STATIC
VOID
AsciiToUnicode (
IN UINT8 *Lang,
@@ -138,6 +139,7 @@ Returns:
return EFI_SUCCESS;
}
+STATIC
EFI_STATUS
HiiNewString2 (
IN EFI_HII_PROTOCOL *This,
@@ -766,7 +768,7 @@ Returns:
&NewString,
TRUE
);
-
+ ASSERT_EFI_ERROR (Status);
}
gBS->FreePool (LangCodes);
diff --git a/EdkModulePkg/Universal/UserInterface/SetupBrowser/Dxe/Boolean.c b/EdkModulePkg/Universal/UserInterface/SetupBrowser/Dxe/Boolean.c
index 122da065a9..d3f77e09f5 100644
--- a/EdkModulePkg/Universal/UserInterface/SetupBrowser/Dxe/Boolean.c
+++ b/EdkModulePkg/Universal/UserInterface/SetupBrowser/Dxe/Boolean.c
@@ -83,6 +83,7 @@ Returns:
mBooleanEvaluationStackEnd = NewStack + StackSizeInBoolean;
}
+STATIC
VOID
InitializeBooleanEvaluator (
VOID
@@ -176,6 +177,7 @@ Returns:
return ReturnValue;
}
+STATIC
EFI_STATUS
GrowBooleanExpression (
IN EFI_INCONSISTENCY_DATA *InconsistentTags,
@@ -212,6 +214,7 @@ GrowBooleanExpression (
return EFI_SUCCESS;
}
+STATIC
VOID
CreateBooleanExpression (
IN EFI_FILE_FORM_TAGS *FileFormTags,
@@ -311,6 +314,7 @@ NextEntry:
GrowBooleanExpression (&FakeInconsistentTags, BooleanExpression, BooleanExpressionLength);
}
+STATIC
EFI_STATUS
BooleanVariableWorker (
IN CHAR16 *VariableName,
@@ -369,6 +373,7 @@ Returns:
return Status;
}
+STATIC
UINT8
PredicateIfrType (
IN EFI_INCONSISTENCY_DATA *Iterator
@@ -416,6 +421,7 @@ Returns:
return 0x2;
}
+STATIC
VOID
PostOrderEvaluate (
IN EFI_FILE_FORM_TAGS *FileFormTags,
@@ -616,7 +622,7 @@ Returns:
break;
case EFI_IFR_NOT_OP:
Operator = PopBool (StackPtr);
- PushBool (StackPtr, !Operator);
+ PushBool (StackPtr, (BOOLEAN) (!Operator));
break;
case EFI_IFR_SUPPRESS_IF_OP:
@@ -1350,11 +1356,12 @@ Returns:
return Operator;
}
- return FALSE;
+ goto Done;
}
Iterator++;
}
+Done:
return FALSE;
}
diff --git a/EdkModulePkg/Universal/UserInterface/SetupBrowser/Dxe/InputHandler.c b/EdkModulePkg/Universal/UserInterface/SetupBrowser/Dxe/InputHandler.c
index 466039f8dc..ebf038581f 100644
--- a/EdkModulePkg/Universal/UserInterface/SetupBrowser/Dxe/InputHandler.c
+++ b/EdkModulePkg/Universal/UserInterface/SetupBrowser/Dxe/InputHandler.c
@@ -215,7 +215,6 @@ ReadPassword (
)
{
EFI_STATUS Status;
- UINTN PasswordSize;
UINTN ScreenSize;
CHAR16 NullCharacter;
CHAR16 Space[2];
@@ -234,12 +233,12 @@ ReadPassword (
UINTN DimensionsWidth;
UINTN DimensionsHeight;
EFI_IFR_DATA_ENTRY *DataEntry;
+ UINTN WidthOfString;
DimensionsWidth = gScreenDimensions.RightColumn - gScreenDimensions.LeftColumn;
DimensionsHeight = gScreenDimensions.BottomRow - gScreenDimensions.TopRow;
VariableDefinition = NULL;
- PasswordSize = 0;
NullCharacter = CHAR_NULL;
Space[0] = L' ';
Space[1] = CHAR_NULL;
@@ -309,7 +308,8 @@ Error:
// Upon error, we will likely receive a string to print out
// Display error popup
//
- ScreenSize = EFI_MAX(GetStringWidth (Packet->String), GetStringWidth (gPressEnter)) / 2;
+ WidthOfString = GetStringWidth (Packet->String);
+ ScreenSize = EFI_MAX(WidthOfString, GetStringWidth (gPressEnter)) / 2;
CreatePopUp (ScreenSize, 4, &NullCharacter, Packet->String, gPressEnter, &NullCharacter);
gBS->FreePool (Packet);
@@ -318,9 +318,8 @@ Error:
} while (Key.UnicodeChar != CHAR_CARRIAGE_RETURN);
}
- gBS->FreePool (TempString);
- gBS->FreePool (TempString2);
- return EFI_NOT_READY;
+ Status = EFI_NOT_READY;
+ goto Done;
}
}
@@ -418,10 +417,12 @@ Error:
if (Confirmation) {
if (EFI_ERROR (Status)) {
if (Packet->String == NULL) {
- ScreenSize = EFI_MAX (GetStringWidth (gConfirmError), GetStringWidth (gPressEnter)) / 2;
+ WidthOfString = GetStringWidth (gConfirmError);
+ ScreenSize = EFI_MAX (WidthOfString, GetStringWidth (gPressEnter)) / 2;
CreatePopUp (ScreenSize, 4, &NullCharacter, gConfirmError, gPressEnter, &NullCharacter);
} else {
- ScreenSize = EFI_MAX (GetStringWidth (Packet->String), GetStringWidth (gPressEnter)) / 2;
+ WidthOfString = GetStringWidth (Packet->String);
+ ScreenSize = EFI_MAX (WidthOfString, GetStringWidth (gPressEnter)) / 2;
CreatePopUp (ScreenSize, 4, &NullCharacter, Packet->String, gPressEnter, &NullCharacter);
gBS->FreePool (Packet);
}
@@ -431,15 +432,13 @@ Error:
Status = WaitForKeyStroke (&Key);
if (Key.UnicodeChar == CHAR_CARRIAGE_RETURN) {
- gBS->FreePool (TempString);
- gBS->FreePool (TempString2);
- return EFI_NOT_READY;
+ Status = EFI_NOT_READY;
+ goto Done;
}
} while (1);
} else {
- gBS->FreePool (TempString);
- gBS->FreePool (TempString2);
- return EFI_NOT_READY;
+ Status = EFI_NOT_READY;
+ goto Done;
}
} else {
//
@@ -451,9 +450,8 @@ Error:
}
if (PromptForPassword && EFI_ERROR (Status)) {
- gBS->FreePool (TempString);
- gBS->FreePool (TempString2);
- return EFI_DEVICE_ERROR;
+ Status = EFI_DEVICE_ERROR;
+ goto Done;
}
}
}
@@ -464,19 +462,18 @@ Error:
// Otherwise, kick and error box, and return an error
//
if (StrCmp (TempString, TempString2) == 0) {
- gBS->FreePool (TempString);
- gBS->FreePool (TempString2);
- return EFI_SUCCESS;
+ Status = EFI_SUCCESS;
+ goto Done;
} else {
- ScreenSize = EFI_MAX (GetStringWidth (gConfirmError), GetStringWidth (gPressEnter)) / 2;
+ WidthOfString = GetStringWidth (gConfirmError);
+ ScreenSize = EFI_MAX (WidthOfString, GetStringWidth (gPressEnter)) / 2;
CreatePopUp (ScreenSize, 4, &NullCharacter, gConfirmError, gPressEnter, &NullCharacter);
StringPtr[0] = CHAR_NULL;
do {
Status = WaitForKeyStroke (&Key);
if (Key.UnicodeChar == CHAR_CARRIAGE_RETURN) {
- gBS->FreePool (TempString);
- gBS->FreePool (TempString2);
- return EFI_DEVICE_ERROR;
+ Status = EFI_DEVICE_ERROR;
+ goto Done;
}
} while (1);
}
@@ -486,9 +483,8 @@ Error:
//
// I was asked for a password, return it back in StringPtr
//
- gBS->FreePool (TempString);
- gBS->FreePool (TempString2);
- return EFI_SUCCESS;
+ Status = EFI_SUCCESS;
+ goto Done;
} else {
//
// If the two passwords were not the same kick an error popup
@@ -575,6 +571,8 @@ Error:
} while (!ConfirmationComplete);
} while (1);
+
+Done:
gBS->FreePool (TempString);
gBS->FreePool (TempString2);
return Status;
@@ -655,7 +653,6 @@ Returns:
CHAR16 NullCharacter;
CHAR16 *StringPtr;
EFI_FILE_FORM_TAGS *FileFormTags;
- EFI_STATUS Status;
EFI_VARIABLE_DEFINITION *VariableDefinition;
UINTN Loop;
@@ -689,7 +686,7 @@ Returns:
goto TheKey2;
}
- Status = WaitForKeyStroke (&Key);
+ WaitForKeyStroke (&Key);
TheKey2:
switch (Key.UnicodeChar) {
@@ -879,7 +876,7 @@ EnterCarriageReturn:
CreatePopUp (GetStringWidth (StringPtr) / 2, 3, &NullCharacter, StringPtr, &NullCharacter);
do {
- Status = WaitForKeyStroke (&Key);
+ WaitForKeyStroke (&Key);
switch (Key.UnicodeChar) {
@@ -985,7 +982,6 @@ GetSelectionInputPopUp (
OUT UINT16 *KeyValue
)
{
- EFI_STATUS Status;
EFI_INPUT_KEY Key;
UINTN Index;
UINTN TempIndex;
@@ -1005,7 +1001,6 @@ GetSelectionInputPopUp (
UINTN MenuLinesInView;
UINTN PopUpWidth;
CHAR16 Character;
- UINTN FirstOption;
BOOLEAN FirstOptionFoundFlag;
INT32 SavedAttribute;
EFI_TAG TagBackup;
@@ -1017,10 +1012,8 @@ GetSelectionInputPopUp (
BOOLEAN ShowDownArrow;
BOOLEAN ShowUpArrow;
UINTN DimensionsWidth;
- UINTN DimensionsHeight;
DimensionsWidth = gScreenDimensions.RightColumn - gScreenDimensions.LeftColumn;
- DimensionsHeight = gScreenDimensions.BottomRow - gScreenDimensions.TopRow;
TempValue = 0;
TempIndex = 0;
@@ -1050,7 +1043,6 @@ GetSelectionInputPopUp (
Count = 0;
PopUpWidth = 0;
- FirstOption = MenuOption->TagIndex;
FirstOptionFoundFlag = FALSE;
StringPtr = AllocateZeroPool ((gOptionBlockWidth + 1) * 2);
@@ -1066,7 +1058,6 @@ GetSelectionInputPopUp (
if (MenuOption->Tags[Index].Operand == EFI_IFR_ONE_OF_OPTION_OP &&
!MenuOption->Tags[Index].Suppress) {
if (!FirstOptionFoundFlag) {
- FirstOption = Index;
FirstOptionFoundFlag = TRUE;
}
@@ -1309,7 +1300,7 @@ GetSelectionInputPopUp (
KeyInitialized = TRUE;
}
- Status = WaitForKeyStroke (&Key);
+ WaitForKeyStroke (&Key);
TheKey:
switch (Key.UnicodeChar) {
@@ -1553,14 +1544,14 @@ TheKey:
*Value = TempValue;
}
- gST->ConOut->SetAttribute (gST->ConOut, SavedAttribute);
- return EFI_SUCCESS;
+ goto Done;
default:
break;
}
} while (1);
+Done:
gST->ConOut->SetAttribute (gST->ConOut, SavedAttribute);
return EFI_SUCCESS;
}
diff --git a/EdkModulePkg/Universal/UserInterface/SetupBrowser/Dxe/Presentation.c b/EdkModulePkg/Universal/UserInterface/SetupBrowser/Dxe/Presentation.c
index 7b219c85bb..8c81fd8c54 100644
--- a/EdkModulePkg/Universal/UserInterface/SetupBrowser/Dxe/Presentation.c
+++ b/EdkModulePkg/Universal/UserInterface/SetupBrowser/Dxe/Presentation.c
@@ -348,6 +348,7 @@ DisplayPageFrame (
| ^"=Move Highlight Toggles Checkbox Esc=Discard Changes |
+------------------------------------------------------------------------------+
*/
+STATIC
UI_MENU_OPTION *
DisplayForm (
OUT UI_MENU_OPTION *Selection,
@@ -796,6 +797,7 @@ Returns:
}
+STATIC
VOID
ExtractFormHandle (
IN UI_MENU_OPTION *Selection,
@@ -851,6 +853,7 @@ ExtractFormHandle (
return ;
}
+STATIC
EFI_STATUS
UpdateNewTagData (
IN UINT8 *FormData,
@@ -1092,6 +1095,7 @@ UpdateNewTagData (
return Status;
}
+STATIC
VOID
ExtractDynamicFormHandle (
IN UI_MENU_OPTION *Selection,
diff --git a/EdkModulePkg/Universal/UserInterface/SetupBrowser/Dxe/Print.h b/EdkModulePkg/Universal/UserInterface/SetupBrowser/Dxe/Print.h
index 86feb88bdf..d055513b71 100644
--- a/EdkModulePkg/Universal/UserInterface/SetupBrowser/Dxe/Print.h
+++ b/EdkModulePkg/Universal/UserInterface/SetupBrowser/Dxe/Print.h
@@ -22,6 +22,8 @@ Abstract:
#ifndef _PRINT_H_
#define _PRINT_H_
+#include "Setup.h"
+
#define LEFT_JUSTIFY 0x01
#define PREFIX_SIGN 0x02
#define PREFIX_BLANK 0x04
diff --git a/EdkModulePkg/Universal/UserInterface/SetupBrowser/Dxe/ProcessOptions.c b/EdkModulePkg/Universal/UserInterface/SetupBrowser/Dxe/ProcessOptions.c
index 8a878bcf71..a2aa50fbd5 100644
--- a/EdkModulePkg/Universal/UserInterface/SetupBrowser/Dxe/ProcessOptions.c
+++ b/EdkModulePkg/Universal/UserInterface/SetupBrowser/Dxe/ProcessOptions.c
@@ -77,6 +77,7 @@ ExtractNvValue (
return Status;
}
+STATIC
VOID
AdjustNvMap (
IN EFI_FILE_FORM_TAGS *FileFormTags,
diff --git a/EdkModulePkg/Universal/UserInterface/SetupBrowser/Dxe/Setup.c b/EdkModulePkg/Universal/UserInterface/SetupBrowser/Dxe/Setup.c
index f62bc120f0..407f7694ba 100644
--- a/EdkModulePkg/Universal/UserInterface/SetupBrowser/Dxe/Setup.c
+++ b/EdkModulePkg/Universal/UserInterface/SetupBrowser/Dxe/Setup.c
@@ -144,6 +144,7 @@ InstallPrint (
VOID
);
+STATIC
EFI_STATUS
EFIAPI
SendForm (
@@ -189,7 +190,6 @@ Returns:
--*/
{
- EFI_FORM_CONFIGURATION_DATA *FormData;
EFI_FORM_CALLBACK_PROTOCOL *FormCallback;
EFI_FILE_FORM_TAGS *FileFormTagsHead;
UI_MENU_OPTION *Selection;
@@ -279,7 +279,6 @@ Returns:
ASSERT (gPreviousValue != NULL);
}
- FormData = EFI_FORM_DATA_FROM_THIS (This);
Callback = FALSE;
FormCallback = NULL;
@@ -710,6 +709,7 @@ GetTagCount (
(*NumberOfTags)++;
}
+STATIC
VOID
AddNextInconsistentTag (
IN OUT EFI_INCONSISTENCY_DATA **InconsistentTagsPtr
@@ -1643,6 +1643,7 @@ Returns:
return Buffer;
}
+STATIC
EFI_STATUS
PopulateHomePage (
IN UINTN NumberOfIfrImages,
diff --git a/EdkModulePkg/Universal/UserInterface/SetupBrowser/Dxe/Ui.c b/EdkModulePkg/Universal/UserInterface/SetupBrowser/Dxe/Ui.c
index 369d2b4911..854d023f8e 100644
--- a/EdkModulePkg/Universal/UserInterface/SetupBrowser/Dxe/Ui.c
+++ b/EdkModulePkg/Universal/UserInterface/SetupBrowser/Dxe/Ui.c
@@ -211,6 +211,7 @@ Returns:
}
}
+STATIC
VOID
UpdateDateAndTime (
VOID
@@ -492,7 +493,6 @@ Returns:
UINTN Start;
UINTN Top;
UINTN Index;
- EFI_STATUS Status;
BOOLEAN SelectionComplete;
UINTN InputOffset;
UINTN CurrentAttribute;
@@ -570,12 +570,12 @@ Returns:
// Take the first key typed and report it back?
//
if (HotKey) {
- Status = WaitForKeyStroke (&Key);
+ WaitForKeyStroke (&Key);
CopyMem (KeyValue, &Key, sizeof (EFI_INPUT_KEY));
} else {
do {
- Status = WaitForKeyStroke (&Key);
+ WaitForKeyStroke (&Key);
switch (Key.UnicodeChar) {
case CHAR_NULL:
@@ -1046,6 +1046,7 @@ Returns:
return ;
}
+STATIC
BOOLEAN
SelectionsAreValid (
IN UI_MENU_OPTION *MenuOption,
@@ -1068,7 +1069,6 @@ Returns:
EFI_FILE_FORM_TAGS *FileFormTags;
CHAR16 *StringPtr;
CHAR16 NullCharacter;
- EFI_STATUS Status;
UINTN Index;
UINT16 *NvRamMap;
STRING_REF PopUp;
@@ -1103,7 +1103,7 @@ Returns:
CreatePopUp (GetStringWidth (StringPtr) / 2, 3, &NullCharacter, StringPtr, &NullCharacter);
do {
- Status = WaitForKeyStroke (&Key);
+ WaitForKeyStroke (&Key);
switch (Key.UnicodeChar) {
@@ -1284,6 +1284,7 @@ Returns:
}
}
+STATIC
VOID
UpdateOptionSkipLines (
IN EFI_IFR_DATA_ARRAY *PageData,
diff --git a/EdkModulePkg/Universal/Variable/Pei/Variable.c b/EdkModulePkg/Universal/Variable/Pei/Variable.c
index f10a96ba2d..e2f3c4bddd 100644
--- a/EdkModulePkg/Universal/Variable/Pei/Variable.c
+++ b/EdkModulePkg/Universal/Variable/Pei/Variable.c
@@ -68,6 +68,7 @@ Returns:
}
+STATIC
VARIABLE_HEADER *
GetNextVariablePtr (
IN VARIABLE_HEADER *Variable
@@ -90,6 +91,7 @@ Returns:
return (VARIABLE_HEADER *) ((UINTN) GET_VARIABLE_DATA_PTR (Variable) + Variable->DataSize + GET_PAD_SIZE (Variable->DataSize));
}
+STATIC
BOOLEAN
EFIAPI
IsValidVariableHeader (
@@ -120,6 +122,7 @@ Returns:
return TRUE;
}
+STATIC
VARIABLE_STORE_STATUS
EFIAPI
GetVariableStoreStatus (
@@ -163,6 +166,7 @@ Returns:
}
}
+STATIC
EFI_STATUS
CompareWithValidVariable (
IN VARIABLE_HEADER *Variable,
@@ -215,6 +219,7 @@ Returns:
return EFI_NOT_FOUND;
}
+STATIC
EFI_STATUS
EFIAPI
FindVariable (
diff --git a/EdkModulePkg/Universal/Variable/RuntimeDxe/Ipf/InitVariable.c b/EdkModulePkg/Universal/Variable/RuntimeDxe/Ipf/InitVariable.c
index ee2a4852a0..da71705dae 100644
--- a/EdkModulePkg/Universal/Variable/RuntimeDxe/Ipf/InitVariable.c
+++ b/EdkModulePkg/Universal/Variable/RuntimeDxe/Ipf/InitVariable.c
@@ -26,6 +26,7 @@ Revision History
//
extern ESAL_VARIABLE_GLOBAL *mVariableModuleGlobal;
+STATIC
SAL_RETURN_REGS
EsalVariableCommonEntry (
IN UINT64 FunctionId,
diff --git a/EdkModulePkg/Universal/Variable/RuntimeDxe/Variable.c b/EdkModulePkg/Universal/Variable/RuntimeDxe/Variable.c
index f59d2a3969..aa0742364e 100644
--- a/EdkModulePkg/Universal/Variable/RuntimeDxe/Variable.c
+++ b/EdkModulePkg/Universal/Variable/RuntimeDxe/Variable.c
@@ -27,6 +27,7 @@ Revision History
//
ESAL_VARIABLE_GLOBAL *mVariableModuleGlobal;
+STATIC
UINT32
EFIAPI
ArrayLength (
@@ -63,6 +64,7 @@ Returns:
return (Count * 2) + 2;
}
+STATIC
BOOLEAN
EFIAPI
IsValidVariableHeader (
@@ -93,6 +95,7 @@ Returns:
return TRUE;
}
+STATIC
EFI_STATUS
EFIAPI
UpdateVariableStore (
@@ -242,6 +245,7 @@ Returns:
return EFI_SUCCESS;
}
+STATIC
VARIABLE_STORE_STATUS
EFIAPI
GetVariableStoreStatus (
@@ -283,6 +287,7 @@ Returns:
}
}
+STATIC
UINT8 *
EFIAPI
GetVariableDataPtr (
@@ -310,6 +315,7 @@ Returns:
return (UINT8 *) ((UINTN) GET_VARIABLE_NAME_PTR (Variable) + Variable->NameSize + GET_PAD_SIZE (Variable->NameSize));
}
+STATIC
VARIABLE_HEADER *
EFIAPI
GetNextVariablePtr (
@@ -340,6 +346,7 @@ Returns:
return (VARIABLE_HEADER *) ((UINTN) GetVariableDataPtr (Variable) + Variable->DataSize + GET_PAD_SIZE (Variable->DataSize));
}
+STATIC
VARIABLE_HEADER *
EFIAPI
GetEndPointer (
@@ -367,6 +374,7 @@ Returns:
return (VARIABLE_HEADER *) ((UINTN) VarStoreHeader + VarStoreHeader->Size);
}
+STATIC
EFI_STATUS
EFIAPI
Reclaim (
@@ -487,6 +495,7 @@ Returns:
return Status;
}
+STATIC
EFI_STATUS
EFIAPI
FindVariable (
@@ -707,7 +716,7 @@ Returns:
Variable.StartPtr = (VARIABLE_HEADER *) ((UINTN) (Global->VolatileVariableBase + sizeof (VARIABLE_STORE_HEADER)));
Variable.EndPtr = (VARIABLE_HEADER *) GetEndPointer ((VARIABLE_STORE_HEADER *) ((UINTN) Global->VolatileVariableBase));
} else {
- return EFI_NOT_FOUND;
+ goto Error;
}
Variable.CurrPtr = Variable.StartPtr;
@@ -745,6 +754,7 @@ Returns:
Variable.CurrPtr = GetNextVariablePtr (Variable.CurrPtr);
}
+Error:
return EFI_NOT_FOUND;
}
diff --git a/EdkModulePkg/Universal/Variable/RuntimeDxe/reclaim.c b/EdkModulePkg/Universal/Variable/RuntimeDxe/reclaim.c
index a4bcdd67ce..00ebcf84fd 100644
--- a/EdkModulePkg/Universal/Variable/RuntimeDxe/reclaim.c
+++ b/EdkModulePkg/Universal/Variable/RuntimeDxe/reclaim.c
@@ -86,6 +86,7 @@ GetFvbHandleByAddress (
return Status;
}
+STATIC
EFI_STATUS
GetLbaAndOffsetByAddress (
IN EFI_PHYSICAL_ADDRESS Address,
diff --git a/EdkModulePkg/Universal/WatchdogTimer/Dxe/WatchDogTimer.c b/EdkModulePkg/Universal/WatchdogTimer/Dxe/WatchDogTimer.c
index b54b25ee83..2f8866711d 100644
--- a/EdkModulePkg/Universal/WatchdogTimer/Dxe/WatchDogTimer.c
+++ b/EdkModulePkg/Universal/WatchdogTimer/Dxe/WatchDogTimer.c
@@ -55,6 +55,7 @@ EFI_EVENT mWatchdogTimerEvent;
//
// Worker Functions
//
+STATIC
VOID
EFIAPI
WatchdogTimerDriverExpires (