[`edk2-devel][PATCH v2] UefiPayloadPkg: Fix ECC reported issues


Guo Dong
 

From: Guo Dong <guo.dong@intel.com>

V2: Fix more header files on #ifdef variable

ECC reported some issues on UefiPayloadPkg, this patch fixed
most of them except several files including ElfLib\Elf32.h,
coreboot.h, CbParseLib.c, etc.
It also removed unused functions in ResetSystemLib and Hob.c.

Signed-off-by: Guo Dong <guo.dong@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Maurice Ma <maurice.ma@intel.com>
Cc: Benjamin You <benjamin.you@intel.com>
---
UefiPayloadPkg/Include/Coreboot.h | 1 +
UefiPayloadPkg/Include/Guid/AcpiBoardInfoGuid.h | 4 +=
+--
UefiPayloadPkg/Include/Guid/MemoryMapInfoGuid.h | 4 +=
+--
UefiPayloadPkg/Include/Guid/SerialPortInfoGuid.h | 4 +=
+--
UefiPayloadPkg/Include/Guid/SystemTableInfoGuid.h | 4 +=
+--
UefiPayloadPkg/Include/Library/BlParseLib.h | 8 +=
+++----
UefiPayloadPkg/Include/Library/DxeHobListLib.h | 4 +=
+--
UefiPayloadPkg/Include/Library/PlatformSupportLib.h | 4 +=
+--
UefiPayloadPkg/Library/CbParseLib/CbParseLib.c | 22 +=
++++++++++-----------
UefiPayloadPkg/Library/DxeHobListLibNull/DxeHobListLibNull.c | 6 +=
+++++
UefiPayloadPkg/Library/PayloadEntryHobLib/Hob.c | 28 +=
+--------------------------
UefiPayloadPkg/Library/PciHostBridgeLib/PciHostBridge.h | 4 +=
+--
UefiPayloadPkg/Library/PciHostBridgeLib/PciHostBridgeLib.c | 4 +=
+--
UefiPayloadPkg/Library/PciHostBridgeLib/PciHostBridgeSupport.c | 15 +=
+++++++++-----
UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.c | 4 +=
+++
UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.h | 6 +=
++---
UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformConsole.h | 4 +=
+--
UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformData.c | 2 +-
UefiPayloadPkg/Library/ResetSystemLib/ResetSystemLib.c | 16 -=
---------------
UefiPayloadPkg/Library/SblParseLib/SblParseLib.c | 2 +-
UefiPayloadPkg/UefiPayloadEntry/LoadDxeCore.c | 2 +-
UefiPayloadPkg/UefiPayloadEntry/PrintHob.c | 17 +=
+++++++++++++++-
UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.c | 2 ++
UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.h | 10 +=
++++-----
UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry.c | 20 +=
++++++++++++-------
25 files changed, 98 insertions(+), 99 deletions(-)

diff --git a/UefiPayloadPkg/Include/Coreboot.h b/UefiPayloadPkg/Include/Cor=
eboot.h
index 8a6c300cde..86e14a1a4d 100644
--- a/UefiPayloadPkg/Include/Coreboot.h
+++ b/UefiPayloadPkg/Include/Coreboot.h
@@ -245,5 +245,6 @@ struct cb_cbmem_tab {
(void *)(((UINT8 *) (_rec)) + sizeof(*(_rec)) \=0D
+ (sizeof((_rec)->map[0]) * (_idx)))=0D
=0D
+typedef struct cb_memory CB_MEMORY;=0D
=0D
#endif // _COREBOOT_PEI_H_INCLUDED_=0D
diff --git a/UefiPayloadPkg/Include/Guid/AcpiBoardInfoGuid.h b/UefiPayloadP=
kg/Include/Guid/AcpiBoardInfoGuid.h
index 043b748ae4..2ff0677165 100644
--- a/UefiPayloadPkg/Include/Guid/AcpiBoardInfoGuid.h
+++ b/UefiPayloadPkg/Include/Guid/AcpiBoardInfoGuid.h
@@ -6,8 +6,8 @@
=0D
**/=0D
=0D
-#ifndef __ACPI_BOARD_INFO_GUID_H__=0D
-#define __ACPI_BOARD_INFO_GUID_H__=0D
+#ifndef ACPI_BOARD_INFO_GUID_H_=0D
+#define ACPI_BOARD_INFO_GUID_H_=0D
=0D
///=0D
/// Board information GUID=0D
diff --git a/UefiPayloadPkg/Include/Guid/MemoryMapInfoGuid.h b/UefiPayloadP=
kg/Include/Guid/MemoryMapInfoGuid.h
index 99187e8037..a62002ebbe 100644
--- a/UefiPayloadPkg/Include/Guid/MemoryMapInfoGuid.h
+++ b/UefiPayloadPkg/Include/Guid/MemoryMapInfoGuid.h
@@ -6,8 +6,8 @@
=0D
**/=0D
=0D
-#ifndef __MEMORY_MAP_INFO_GUID_H__=0D
-#define __MEMORY_MAP_INFO_GUID_H__=0D
+#ifndef MEMORY_MAP_INFO_GUID_H_=0D
+#define MEMORY_MAP_INFO_GUID_H_=0D
=0D
#include <Library/PcdLib.h>=0D
=0D
diff --git a/UefiPayloadPkg/Include/Guid/SerialPortInfoGuid.h b/UefiPayload=
Pkg/Include/Guid/SerialPortInfoGuid.h
index a15d5b8671..10197134a3 100644
--- a/UefiPayloadPkg/Include/Guid/SerialPortInfoGuid.h
+++ b/UefiPayloadPkg/Include/Guid/SerialPortInfoGuid.h
@@ -6,8 +6,8 @@
=0D
**/=0D
=0D
-#ifndef __SERIAL_PORT_INFO_GUID_H__=0D
-#define __SERIAL_PORT_INFO_GUID_H__=0D
+#ifndef SERIAL_PORT_INFO_GUID_H_=0D
+#define SERIAL_PORT_INFO_GUID_H_=0D
=0D
///=0D
/// Serial Port Information GUID=0D
diff --git a/UefiPayloadPkg/Include/Guid/SystemTableInfoGuid.h b/UefiPayloa=
dPkg/Include/Guid/SystemTableInfoGuid.h
index 2446820285..e742dd0ca5 100644
--- a/UefiPayloadPkg/Include/Guid/SystemTableInfoGuid.h
+++ b/UefiPayloadPkg/Include/Guid/SystemTableInfoGuid.h
@@ -6,8 +6,8 @@
=0D
**/=0D
=0D
-#ifndef __SYSTEM_TABLE_INFO_GUID_H__=0D
-#define __SYSTEM_TABLE_INFO_GUID_H__=0D
+#ifndef SYSTEM_TABLE_INFO_GUID_H_=0D
+#define SYSTEM_TABLE_INFO_GUID_H_=0D
=0D
///=0D
/// System Table Information GUID=0D
diff --git a/UefiPayloadPkg/Include/Library/BlParseLib.h b/UefiPayloadPkg/I=
nclude/Library/BlParseLib.h
index 49eac31248..ac61faf980 100644
--- a/UefiPayloadPkg/Include/Library/BlParseLib.h
+++ b/UefiPayloadPkg/Include/Library/BlParseLib.h
@@ -6,6 +6,9 @@
SPDX-License-Identifier: BSD-2-Clause-Patent=0D
=0D
**/=0D
+#ifndef BOOTLOADER_PARSE_LIB_=0D
+#define BOOTLOADER_PARSE_LIB_=0D
+=0D
#include <PiPei.h>=0D
#include <Guid/GraphicsInfoHob.h>=0D
#include <Guid/MemoryMapInfoGuid.h>=0D
@@ -13,9 +16,6 @@
#include <Guid/SystemTableInfoGuid.h>=0D
#include <Guid/AcpiBoardInfoGuid.h>=0D
=0D
-#ifndef __BOOTLOADER_PARSE_LIB__=0D
-#define __BOOTLOADER_PARSE_LIB__=0D
-=0D
#define GET_BOOTLOADER_PARAMETER() PcdGet64 (PcdBootloaderParameter)=
=0D
=0D
typedef RETURN_STATUS \=0D
@@ -73,7 +73,7 @@ ParseSystemTable (
/**=0D
Find the serial port information=0D
=0D
- @param SERIAL_PORT_INFO Pointer to serial port info structure=0D
+ @param SerialPortInfo Pointer to serial port info structure=0D
=0D
@retval RETURN_SUCCESS Successfully find the serial port information=
.=0D
@retval RETURN_NOT_FOUND Failed to find the serial port information .=
=0D
diff --git a/UefiPayloadPkg/Include/Library/DxeHobListLib.h b/UefiPayloadPk=
g/Include/Library/DxeHobListLib.h
index 7e9b23f6d7..139b11e329 100644
--- a/UefiPayloadPkg/Include/Library/DxeHobListLib.h
+++ b/UefiPayloadPkg/Include/Library/DxeHobListLib.h
@@ -15,8 +15,8 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
=0D
**/=0D
=0D
-#ifndef __DXE_HOB_LIST_LIB_H__=0D
-#define __DXE_HOB_LIST_LIB_H__=0D
+#ifndef DXE_HOB_LIST_LIB_H_=0D
+#define DXE_HOB_LIST_LIB_H_=0D
=0D
///=0D
/// Cache copy of the start of HOB list=0D
diff --git a/UefiPayloadPkg/Include/Library/PlatformSupportLib.h b/UefiPayl=
oadPkg/Include/Library/PlatformSupportLib.h
index d9f0b83075..73263722eb 100644
--- a/UefiPayloadPkg/Include/Library/PlatformSupportLib.h
+++ b/UefiPayloadPkg/Include/Library/PlatformSupportLib.h
@@ -8,8 +8,8 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
=0D
**/=0D
=0D
-#ifndef __BOOTLOADER_PLATFORM_SUPPORT_LIB__=0D
-#define __BOOTLOADER_PLATFORM_SUPPORT_LIB__=0D
+#ifndef BOOTLOADER_PLATFORM_SUPPORT_LIB_=0D
+#define BOOTLOADER_PLATFORM_SUPPORT_LIB_=0D
=0D
/**=0D
Parse platform specific information from bootloader=0D
diff --git a/UefiPayloadPkg/Library/CbParseLib/CbParseLib.c b/UefiPayloadPk=
g/Library/CbParseLib/CbParseLib.c
index 4be5d66ba5..990508496f 100644
--- a/UefiPayloadPkg/Library/CbParseLib/CbParseLib.c
+++ b/UefiPayloadPkg/Library/CbParseLib/CbParseLib.c
@@ -322,7 +322,7 @@ ParseCbMemTable (
)=0D
{=0D
EFI_STATUS Status;=0D
- struct cb_memory *rec;=0D
+ CB_MEMORY *Rec;=0D
struct cb_memory_range *Range;=0D
UINT64 Start;=0D
UINT64 Size;=0D
@@ -339,13 +339,13 @@ ParseCbMemTable (
//=0D
// Get the coreboot memory table=0D
//=0D
- rec =3D (struct cb_memory *)FindCbTag (CB_TAG_MEMORY);=0D
- if (rec =3D=3D NULL) {=0D
+ Rec =3D (CB_MEMORY *)FindCbTag (CB_TAG_MEMORY);=0D
+ if (Rec =3D=3D NULL) {=0D
return Status;=0D
}=0D
=0D
- for (Index =3D 0; Index < MEM_RANGE_COUNT(rec); Index++) {=0D
- Range =3D MEM_RANGE_PTR(rec, Index);=0D
+ for (Index =3D 0; Index < MEM_RANGE_COUNT(Rec); Index++) {=0D
+ Range =3D MEM_RANGE_PTR(Rec, Index);=0D
Start =3D cb_unpack64(Range->start);=0D
Size =3D cb_unpack64(Range->size);=0D
=0D
@@ -380,7 +380,7 @@ ParseMemoryInfo (
IN VOID *Params=0D
)=0D
{=0D
- struct cb_memory *rec;=0D
+ CB_MEMORY *Rec;=0D
struct cb_memory_range *Range;=0D
UINTN Index;=0D
MEMROY_MAP_ENTRY MemoryMap;=0D
@@ -388,13 +388,13 @@ ParseMemoryInfo (
//=0D
// Get the coreboot memory table=0D
//=0D
- rec =3D (struct cb_memory *)FindCbTag (CB_TAG_MEMORY);=0D
- if (rec =3D=3D NULL) {=0D
+ Rec =3D (CB_MEMORY *)FindCbTag (CB_TAG_MEMORY);=0D
+ if (Rec =3D=3D NULL) {=0D
return RETURN_NOT_FOUND;=0D
}=0D
=0D
- for (Index =3D 0; Index < MEM_RANGE_COUNT(rec); Index++) {=0D
- Range =3D MEM_RANGE_PTR(rec, Index);=0D
+ for (Index =3D 0; Index < MEM_RANGE_COUNT(Rec); Index++) {=0D
+ Range =3D MEM_RANGE_PTR(Rec, Index);=0D
MemoryMap.Base =3D cb_unpack64(Range->start);=0D
MemoryMap.Size =3D cb_unpack64(Range->size);=0D
MemoryMap.Type =3D (UINT8)Range->type;=0D
@@ -449,7 +449,7 @@ ParseSystemTable (
/**=0D
Find the serial port information=0D
=0D
- @param SERIAL_PORT_INFO Pointer to serial port info structure=0D
+ @param SerialPortInfo Pointer to serial port info structure=0D
=0D
@retval RETURN_SUCCESS Successfully find the serial port information=
.=0D
@retval RETURN_NOT_FOUND Failed to find the serial port information .=
=0D
diff --git a/UefiPayloadPkg/Library/DxeHobListLibNull/DxeHobListLibNull.c b=
/UefiPayloadPkg/Library/DxeHobListLibNull/DxeHobListLibNull.c
index 92d3e17ef0..6c69f9879e 100644
--- a/UefiPayloadPkg/Library/DxeHobListLibNull/DxeHobListLibNull.c
+++ b/UefiPayloadPkg/Library/DxeHobListLibNull/DxeHobListLibNull.c
@@ -10,6 +10,12 @@
=0D
#include <Uefi.h>=0D
=0D
+/**=0D
+ The dummy constructor for DxeHobListLib.=0D
+=0D
+ @retval EFI_SUCCESS=0D
+=0D
+**/=0D
EFI_STATUS=0D
EFIAPI=0D
DxeHobListLibNullConstructor (=0D
diff --git a/UefiPayloadPkg/Library/PayloadEntryHobLib/Hob.c b/UefiPayloadP=
kg/Library/PayloadEntryHobLib/Hob.c
index dd25ac2682..61cd11ba03 100644
--- a/UefiPayloadPkg/Library/PayloadEntryHobLib/Hob.c
+++ b/UefiPayloadPkg/Library/PayloadEntryHobLib/Hob.c
@@ -168,31 +168,6 @@ BuildResourceDescriptorHob (
Hob->ResourceLength =3D NumberOfBytes;=0D
}=0D
=0D
-VOID=0D
-EFIAPI=0D
-BuildFvHobs (=0D
- IN EFI_PHYSICAL_ADDRESS PhysicalStart,=0D
- IN UINT64 NumberOfBytes,=0D
- IN EFI_RESOURCE_ATTRIBUTE_TYPE *ResourceAttribute=0D
- )=0D
-{=0D
-=0D
- EFI_RESOURCE_ATTRIBUTE_TYPE Resource;=0D
-=0D
- BuildFvHob (PhysicalStart, NumberOfBytes);=0D
-=0D
- if (ResourceAttribute =3D=3D NULL) {=0D
- Resource =3D (EFI_RESOURCE_ATTRIBUTE_PRESENT |=0D
- EFI_RESOURCE_ATTRIBUTE_INITIALIZED |=0D
- EFI_RESOURCE_ATTRIBUTE_TESTED |=0D
- EFI_RESOURCE_ATTRIBUTE_WRITE_BACK_CACHEABLE);=0D
- } else {=0D
- Resource =3D *ResourceAttribute;=0D
- }=0D
-=0D
- BuildResourceDescriptorHob (EFI_RESOURCE_FIRMWARE_DEVICE, Resource, Phys=
icalStart, NumberOfBytes);=0D
-}=0D
-=0D
/**=0D
Returns the next instance of a HOB type from the starting HOB.=0D
=0D
@@ -283,7 +258,8 @@ EFIAPI
GetNextGuidHob (=0D
IN CONST EFI_GUID *Guid,=0D
IN CONST VOID *HobStart=0D
- ){=0D
+ )=0D
+{=0D
EFI_PEI_HOB_POINTERS GuidHob;=0D
=0D
GuidHob.Raw =3D (UINT8 *) HobStart;=0D
diff --git a/UefiPayloadPkg/Library/PciHostBridgeLib/PciHostBridge.h b/Uefi=
PayloadPkg/Library/PciHostBridgeLib/PciHostBridge.h
index 3eee1fbeac..2848da5ce6 100644
--- a/UefiPayloadPkg/Library/PciHostBridgeLib/PciHostBridge.h
+++ b/UefiPayloadPkg/Library/PciHostBridgeLib/PciHostBridge.h
@@ -8,8 +8,8 @@
=0D
**/=0D
=0D
-#ifndef _PCI_HOST_BRIDGE_H=0D
-#define _PCI_HOST_BRIDGE_H=0D
+#ifndef PCI_HOST_BRIDGE_H_=0D
+#define PCI_HOST_BRIDGE_H_=0D
=0D
#include <UniversalPayload/PciRootBridges.h>=0D
=0D
diff --git a/UefiPayloadPkg/Library/PciHostBridgeLib/PciHostBridgeLib.c b/U=
efiPayloadPkg/Library/PciHostBridgeLib/PciHostBridgeLib.c
index a0d7cdc306..0eddebe229 100644
--- a/UefiPayloadPkg/Library/PciHostBridgeLib/PciHostBridgeLib.c
+++ b/UefiPayloadPkg/Library/PciHostBridgeLib/PciHostBridgeLib.c
@@ -210,8 +210,8 @@ PciHostBridgeGetRootBridges (
Free the root bridge instances array returned from=0D
PciHostBridgeGetRootBridges().=0D
=0D
- @param The root bridge instances array.=0D
- @param The count of the array.=0D
+ @param Bridges The root bridge instances array.=0D
+ @param Count The count of the array.=0D
**/=0D
VOID=0D
EFIAPI=0D
diff --git a/UefiPayloadPkg/Library/PciHostBridgeLib/PciHostBridgeSupport.c=
b/UefiPayloadPkg/Library/PciHostBridgeLib/PciHostBridgeSupport.c
index b0268f0506..eb28d48b3b 100644
--- a/UefiPayloadPkg/Library/PciHostBridgeLib/PciHostBridgeSupport.c
+++ b/UefiPayloadPkg/Library/PciHostBridgeLib/PciHostBridgeSupport.c
@@ -205,7 +205,7 @@ PcatPciRootBridgeParseBars (
//=0D
// IO Bar=0D
//=0D
- if (Command & EFI_PCI_COMMAND_IO_SPACE) {=0D
+ if ((Command & EFI_PCI_COMMAND_IO_SPACE) !=3D 0) {=0D
Mask =3D 0xfffffffc;=0D
Base =3D OriginalValue & Mask;=0D
Length =3D ((~(Value & Mask)) & Mask) + 0x04;=0D
@@ -227,7 +227,7 @@ PcatPciRootBridgeParseBars (
//=0D
// Mem Bar=0D
//=0D
- if (Command & EFI_PCI_COMMAND_MEMORY_SPACE) {=0D
+ if ((Command & EFI_PCI_COMMAND_MEMORY_SPACE) !=3D 0) {=0D
=0D
Mask =3D 0xfffffff0;=0D
Base =3D OriginalValue & Mask;=0D
@@ -306,9 +306,14 @@ ScanForRootBridges (
UINT64 Base;=0D
UINT64 Limit;=0D
UINT64 Value;=0D
- PCI_ROOT_BRIDGE_APERTURE Io, Mem, MemAbove4G, PMem, PMemAbove4G, *MemApe=
rture;=0D
- PCI_ROOT_BRIDGE *RootBridges;=0D
- UINTN BarOffsetEnd;=0D
+ PCI_ROOT_BRIDGE_APERTURE Io;=0D
+ PCI_ROOT_BRIDGE_APERTURE Mem;=0D
+ PCI_ROOT_BRIDGE_APERTURE MemAbove4G;=0D
+ PCI_ROOT_BRIDGE_APERTURE PMem;=0D
+ PCI_ROOT_BRIDGE_APERTURE PMemAbove4G;=0D
+ PCI_ROOT_BRIDGE_APERTURE *MemAperture;=0D
+ PCI_ROOT_BRIDGE *RootBridges;=0D
+ UINTN BarOffsetEnd;=0D
=0D
=0D
*NumberOfRootBridges =3D 0;=0D
diff --git a/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootMana=
ger.c b/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.c
index c4d317fa9e..dd91fcb29d 100644
--- a/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.c
+++ b/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.c
@@ -15,6 +15,10 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
=0D
UNIVERSAL_PAYLOAD_PLATFORM_BOOT_MANAGER_OVERRIDE_PROTOCOL *mUniversalPayl=
oadPlatformBootManagerOverrideInstance =3D NULL;=0D
=0D
+/**=0D
+ Signal EndOfDxe event and install SMM Ready to lock protocol.=0D
+=0D
+**/=0D
VOID=0D
InstallReadyToLock (=0D
VOID=0D
diff --git a/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootMana=
ger.h b/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.h
index 2f600c796f..c781610c6c 100644
--- a/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.h
+++ b/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.h
@@ -1,12 +1,12 @@
-/**@file=0D
+/** @file=0D
Head file for BDS Platform specific code=0D
=0D
Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.<BR>=0D
SPDX-License-Identifier: BSD-2-Clause-Patent=0D
**/=0D
=0D
-#ifndef _PLATFORM_BOOT_MANAGER_H=0D
-#define _PLATFORM_BOOT_MANAGER_H=0D
+#ifndef PLATFORM_BOOT_MANAGER_H_=0D
+#define PLATFORM_BOOT_MANAGER_H_=0D
=0D
#include <PiDxe.h>=0D
#include <Protocol/LoadedImage.h>=0D
diff --git a/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformConsole.=
h b/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformConsole.h
index 68bdf5e555..e9d0eb00ee 100644
--- a/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformConsole.h
+++ b/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformConsole.h
@@ -5,8 +5,8 @@ Copyright (c) 2016, Intel Corporation. All rights reserved.=
<BR>
SPDX-License-Identifier: BSD-2-Clause-Patent=0D
**/=0D
=0D
-#ifndef _PLATFORM_CONSOLE_H=0D
-#define _PLATFORM_CONSOLE_H=0D
+#ifndef PLATFORM_CONSOLE_H_=0D
+#define PLATFORM_CONSOLE_H_=0D
=0D
#include <PiDxe.h>=0D
#include <IndustryStandard/Pci.h>=0D
diff --git a/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformData.c b=
/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformData.c
index d17e660e0f..892a7f01be 100644
--- a/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformData.c
+++ b/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformData.c
@@ -1,4 +1,4 @@
-/**@file=0D
+/** @file=0D
Defined the platform specific device path which will be filled to=0D
ConIn/ConOut variables.=0D
=0D
diff --git a/UefiPayloadPkg/Library/ResetSystemLib/ResetSystemLib.c b/UefiP=
ayloadPkg/Library/ResetSystemLib/ResetSystemLib.c
index 2e4b7fe592..b35a4cc1d9 100644
--- a/UefiPayloadPkg/Library/ResetSystemLib/ResetSystemLib.c
+++ b/UefiPayloadPkg/Library/ResetSystemLib/ResetSystemLib.c
@@ -43,22 +43,6 @@ ResetSystemLibConstructor (
return EFI_SUCCESS;=0D
}=0D
=0D
-=0D
-VOID=0D
-AcpiPmControl (=0D
- UINTN SuspendType=0D
- )=0D
-{=0D
- UINTN PmCtrlReg;=0D
-=0D
- ASSERT (SuspendType <=3D 7);=0D
-=0D
- PmCtrlReg =3D (UINTN)mAcpiBoardInfo.PmCtrlRegBase;=0D
- IoAndThenOr16 (PmCtrlReg, (UINT16) ~0x3c00, (UINT16) (SuspendType << 10)=
);=0D
- IoOr16 (PmCtrlReg, BIT13);=0D
- CpuDeadLoop ();=0D
-}=0D
-=0D
/**=0D
Calling this function causes a system-wide reset. This sets=0D
all circuitry within the system to its initial state. This type of reset=
=0D
diff --git a/UefiPayloadPkg/Library/SblParseLib/SblParseLib.c b/UefiPayload=
Pkg/Library/SblParseLib/SblParseLib.c
index ccdcbfc07d..fc6b1b9a16 100644
--- a/UefiPayloadPkg/Library/SblParseLib/SblParseLib.c
+++ b/UefiPayloadPkg/Library/SblParseLib/SblParseLib.c
@@ -141,7 +141,7 @@ ParseSystemTable (
/**=0D
Find the serial port information=0D
=0D
- @param SERIAL_PORT_INFO Pointer to serial port info structure=0D
+ @param[out] SerialPortInfo Pointer to serial port info structure=0D
=0D
@retval RETURN_SUCCESS Successfully find the serial port information=
.=0D
@retval RETURN_NOT_FOUND Failed to find the serial port information .=
=0D
diff --git a/UefiPayloadPkg/UefiPayloadEntry/LoadDxeCore.c b/UefiPayloadPkg=
/UefiPayloadEntry/LoadDxeCore.c
index 0b6cb47cd0..67eed179f0 100644
--- a/UefiPayloadPkg/UefiPayloadEntry/LoadDxeCore.c
+++ b/UefiPayloadPkg/UefiPayloadEntry/LoadDxeCore.c
@@ -190,7 +190,7 @@ FvFindFileByTypeGuid (
=0D
@param FileHeader A pointer to the file header that contains=
the set of sections to=0D
be searched.=0D
- @param SearchType The value of the section type to search.=0D
+ @param SectionType The value of the section type to search.=
=0D
@param SectionData A pointer to the discovered section, if su=
ccessful.=0D
=0D
@retval EFI_SUCCESS The section was found.=0D
diff --git a/UefiPayloadPkg/UefiPayloadEntry/PrintHob.c b/UefiPayloadPkg/Ue=
fiPayloadEntry/PrintHob.c
index 265d47ca9d..d7f3af1304 100644
--- a/UefiPayloadPkg/UefiPayloadEntry/PrintHob.c
+++ b/UefiPayloadPkg/UefiPayloadEntry/PrintHob.c
@@ -196,7 +196,10 @@ PrintResourceDiscriptorHob (
=0D
/**=0D
Print the information in Acpi Guid Hob.=0D
+=0D
@param[in] HobRaw A pointer to the start of gUniversalPayloadAc=
piTableGuid HOB.=0D
+ @param[in] HobLength The size of the HOB data buffer.=0D
+=0D
@retval EFI_SUCCESS If it completed successfully.=0D
**/=0D
EFI_STATUS=0D
@@ -217,6 +220,8 @@ PrintAcpiGuidHob (
/**=0D
Print the information in Serial Guid Hob.=0D
@param[in] HobRaw A pointer to the start of gUniversalPayloadSe=
rialPortInfoGuid HOB.=0D
+ @param[in] HobLength The size of the HOB data buffer.=0D
+=0D
@retval EFI_SUCCESS If it completed successfully.=0D
**/=0D
EFI_STATUS=0D
@@ -240,6 +245,7 @@ PrintSerialGuidHob (
/**=0D
Print the information in Smbios Guid Hob.=0D
@param[in] HobRaw A pointer to the start of gUniversalPayloadSm=
bios3TableGuid HOB.=0D
+ @param[in] HobLength The size of the HOB data buffer.=0D
@retval EFI_SUCCESS If it completed successfully.=0D
**/=0D
EFI_STATUS=0D
@@ -260,6 +266,8 @@ PrintSmbios3GuidHob (
/**=0D
Print the information in Smbios Guid Hob.=0D
@param[in] HobRaw A pointer to the start of gUniversalPayloadSm=
biosTableGuid HOB.=0D
+ @param[in] HobLength The size of the HOB data buffer.=0D
+=0D
@retval EFI_SUCCESS If it completed successfully.=0D
**/=0D
EFI_STATUS=0D
@@ -280,6 +288,8 @@ PrintSmbiosTablGuidHob (
/**=0D
Print the information in Acpi BoardInfo Guid Hob.=0D
@param[in] HobRaw A pointer to the start of gUefiAcpiBoardInfoG=
uid HOB.=0D
+ @param[in] HobLength The size of the HOB data buffer.=0D
+=0D
@retval EFI_SUCCESS If it completed successfully.=0D
**/=0D
EFI_STATUS=0D
@@ -307,6 +317,7 @@ PrintAcpiBoardInfoGuidHob (
/**=0D
Print the information in Pci RootBridge Info Guid Hob.=0D
@param[in] HobRaw A pointer to the start of gUniversalPayloadPc=
iRootBridgeInfoGuid HOB.=0D
+ @param[in] HobLength The size of the HOB data buffer.=0D
=0D
@retval EFI_SUCCESS If it completed successfully.=0D
**/=0D
@@ -362,6 +373,8 @@ PrintPciRootBridgeInfoGuidHob (
/**=0D
Print the information in Extra Data Guid Hob.=0D
@param[in] HobRaw A pointer to the start of gUniversalPayloadEx=
traDataGuid HOB.=0D
+ @param[in] HobLength The size of the HOB data buffer.=0D
+=0D
@retval EFI_SUCCESS If it completed successfully.=0D
**/=0D
EFI_STATUS=0D
@@ -394,6 +407,8 @@ PrintExtraDataGuidHob (
/**=0D
Print the information in MemoryTypeInfoGuidHob.=0D
@param[in] HobRaw A pointer to the start of gEfiMemoryTypeInfor=
mationGuid HOB.=0D
+ @param[in] HobLength The size of the HOB data buffer.=0D
+=0D
@retval EFI_SUCCESS If it completed successfully.=0D
**/=0D
EFI_STATUS=0D
@@ -414,7 +429,7 @@ PrintMemoryTypeInfoGuidHob (
/**=0D
Print the information in EdkiiBootManagerMenuFileGuid.=0D
@param[in] HobRaw A pointer to the start of gEdkiiBootManagerMe=
nuFileGuid HOB.=0D
- @param[in] HobLength The size of the data buffer.=0D
+ @param[in] HobLength The size of the HOB data buffer.=0D
@retval EFI_SUCCESS If it completed successfully.=0D
**/=0D
EFI_STATUS=0D
diff --git a/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.c b/UefiPaylo=
adPkg/UefiPayloadEntry/UefiPayloadEntry.c
index 0e6dcf10f9..adc56dc15f 100644
--- a/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.c
+++ b/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.c
@@ -389,6 +389,8 @@ BuildGenericHob (
/**=0D
Entry point to the C language phase of UEFI payload.=0D
=0D
+ @param[in] BootloaderParameter The starting address of bootloader p=
arameter block.=0D
+=0D
@retval It will not return if SUCCESS, and return error when passin=
g bootloader parameter.=0D
**/=0D
EFI_STATUS=0D
diff --git a/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.h b/UefiPaylo=
adPkg/UefiPayloadEntry/UefiPayloadEntry.h
index de51c2fba9..637ed9c20b 100644
--- a/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.h
+++ b/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.h
@@ -1,9 +1,9 @@
/** @file=0D
-*=0D
-* Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>=0D
-*=0D
-* SPDX-License-Identifier: BSD-2-Clause-Patent=0D
-*=0D
+=0D
+ Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>=0D
+=0D
+ SPDX-License-Identifier: BSD-2-Clause-Patent=0D
+=0D
**/=0D
=0D
#ifndef __UEFI_PAYLOAD_ENTRY_H__=0D
diff --git a/UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry.c b/Uefi=
PayloadPkg/UefiPayloadEntry/UniversalPayloadEntry.c
index 7e67cf0f04..4d1096b323 100644
--- a/UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry.c
+++ b/UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry.c
@@ -114,18 +114,19 @@ AddNewHob (
}=0D
=0D
/**=0D
- Found the Resource Descriptor HOB that contains a range=0D
+ Found the Resource Descriptor HOB that contains a range (Base, Top)=0D
=0D
+ @param[in] HobList Hob start address=0D
@param[in] Base Memory start address=0D
- @param[in] Top Memory Top.=0D
+ @param[in] Top Memory end address.=0D
=0D
- @return The pointer to the Resource Descriptor HOB.=0D
+ @retval The pointer to the Resource Descriptor HOB.=0D
**/=0D
EFI_HOB_RESOURCE_DESCRIPTOR *=0D
FindResourceDescriptorByRange (=0D
- VOID *HobList,=0D
- EFI_PHYSICAL_ADDRESS Base,=0D
- EFI_PHYSICAL_ADDRESS Top=0D
+ IN VOID *HobList,=0D
+ IN EFI_PHYSICAL_ADDRESS Base,=0D
+ IN EFI_PHYSICAL_ADDRESS Top=0D
)=0D
{=0D
EFI_PEI_HOB_POINTERS Hob;=0D
@@ -171,7 +172,7 @@ FindResourceDescriptorByRange (
@param[in] MinimalNeededSize Minimal needed size.=0D
@param[in] ExceptResourceHob Ignore this Resource Descriptor.=0D
=0D
- @return The pointer to the Resource Descriptor HOB.=0D
+ @retval The pointer to the Resource Descriptor HOB.=0D
**/=0D
EFI_HOB_RESOURCE_DESCRIPTOR *=0D
FindAnotherHighestBelow4GResourceDescriptor (=0D
@@ -240,6 +241,9 @@ FindAnotherHighestBelow4GResourceDescriptor (
/**=0D
It will build HOBs based on information from bootloaders.=0D
=0D
+ @param[in] BootloaderParameter The starting memory address of bootloa=
der parameter block.=0D
+ @param[out] DxeFv The pointer to the DXE FV in memory.=0D
+=0D
@retval EFI_SUCCESS If it completed successfully.=0D
@retval Others If it failed to build required HOBs.=0D
**/=0D
@@ -376,6 +380,8 @@ BuildHobs (
/**=0D
Entry point to the C language phase of UEFI payload.=0D
=0D
+ @param[in] BootloaderParameter The starting address of bootloader p=
arameter block.=0D
+=0D
@retval It will not return if SUCCESS, and return error when passin=
g bootloader parameter.=0D
**/=0D
EFI_STATUS=0D
--=20
2.32.0.windows.2


Ma, Maurice
 

Reviewed-by: Maurice Ma <maurice.ma@intel.com>

-----Original Message-----
From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Guo
Dong
Sent: Friday, October 15, 2021 16:35
To: devel@edk2.groups.io
Cc: Dong, Guo <guo.dong@intel.com>; Ni, Ray <ray.ni@intel.com>; Ma,
Maurice <maurice.ma@intel.com>; You, Benjamin
<benjamin.you@intel.com>
Subject: [edk2-devel] [`edk2-devel][PATCH v2] UefiPayloadPkg: Fix ECC
reported issues

From: Guo Dong <guo.dong@intel.com>

V2: Fix more header files on #ifdef variable

ECC reported some issues on UefiPayloadPkg, this patch fixed most of them
except several files including ElfLib\Elf32.h, coreboot.h, CbParseLib.c, etc.
It also removed unused functions in ResetSystemLib and Hob.c.

Signed-off-by: Guo Dong <guo.dong@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Maurice Ma <maurice.ma@intel.com>
Cc: Benjamin You <benjamin.you@intel.com>
---
UefiPayloadPkg/Include/Coreboot.h | 1 +
UefiPayloadPkg/Include/Guid/AcpiBoardInfoGuid.h | 4 ++--
UefiPayloadPkg/Include/Guid/MemoryMapInfoGuid.h | 4 ++--
UefiPayloadPkg/Include/Guid/SerialPortInfoGuid.h | 4 ++--
UefiPayloadPkg/Include/Guid/SystemTableInfoGuid.h | 4 ++--
UefiPayloadPkg/Include/Library/BlParseLib.h | 8 ++++----
UefiPayloadPkg/Include/Library/DxeHobListLib.h | 4 ++--
UefiPayloadPkg/Include/Library/PlatformSupportLib.h | 4 ++--
UefiPayloadPkg/Library/CbParseLib/CbParseLib.c | 22
+++++++++++-----------
UefiPayloadPkg/Library/DxeHobListLibNull/DxeHobListLibNull.c | 6
++++++
UefiPayloadPkg/Library/PayloadEntryHobLib/Hob.c | 28 ++---------
-----------------
UefiPayloadPkg/Library/PciHostBridgeLib/PciHostBridge.h | 4 ++--
UefiPayloadPkg/Library/PciHostBridgeLib/PciHostBridgeLib.c | 4 ++--
UefiPayloadPkg/Library/PciHostBridgeLib/PciHostBridgeSupport.c | 15
++++++++++-----
UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.c |
4 ++++
UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.h |
6 +++---
UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformConsole.h | 4
++--
UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformData.c | 2 +-
UefiPayloadPkg/Library/ResetSystemLib/ResetSystemLib.c | 16 -------
---------
UefiPayloadPkg/Library/SblParseLib/SblParseLib.c | 2 +-
UefiPayloadPkg/UefiPayloadEntry/LoadDxeCore.c | 2 +-
UefiPayloadPkg/UefiPayloadEntry/PrintHob.c | 17
++++++++++++++++-
UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.c | 2 ++
UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.h | 10 +++++--
---
UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry.c | 20
+++++++++++++-------
25 files changed, 98 insertions(+), 99 deletions(-)

diff --git a/UefiPayloadPkg/Include/Coreboot.h
b/UefiPayloadPkg/Include/Coreboot.h
index 8a6c300cde..86e14a1a4d 100644
--- a/UefiPayloadPkg/Include/Coreboot.h
+++ b/UefiPayloadPkg/Include/Coreboot.h
@@ -245,5 +245,6 @@ struct cb_cbmem_tab {
(void *)(((UINT8 *) (_rec)) + sizeof(*(_rec)) \ + (sizeof((_rec)->map[0]) *
(_idx))) +typedef struct cb_memory CB_MEMORY; #endif //
_COREBOOT_PEI_H_INCLUDED_diff --git
a/UefiPayloadPkg/Include/Guid/AcpiBoardInfoGuid.h
b/UefiPayloadPkg/Include/Guid/AcpiBoardInfoGuid.h
index 043b748ae4..2ff0677165 100644
--- a/UefiPayloadPkg/Include/Guid/AcpiBoardInfoGuid.h
+++ b/UefiPayloadPkg/Include/Guid/AcpiBoardInfoGuid.h
@@ -6,8 +6,8 @@
**/ -#ifndef __ACPI_BOARD_INFO_GUID_H__-#define
__ACPI_BOARD_INFO_GUID_H__+#ifndef
ACPI_BOARD_INFO_GUID_H_+#define ACPI_BOARD_INFO_GUID_H_ ///
/// Board information GUIDdiff --git
a/UefiPayloadPkg/Include/Guid/MemoryMapInfoGuid.h
b/UefiPayloadPkg/Include/Guid/MemoryMapInfoGuid.h
index 99187e8037..a62002ebbe 100644
--- a/UefiPayloadPkg/Include/Guid/MemoryMapInfoGuid.h
+++ b/UefiPayloadPkg/Include/Guid/MemoryMapInfoGuid.h
@@ -6,8 +6,8 @@
**/ -#ifndef __MEMORY_MAP_INFO_GUID_H__-#define
__MEMORY_MAP_INFO_GUID_H__+#ifndef
MEMORY_MAP_INFO_GUID_H_+#define MEMORY_MAP_INFO_GUID_H_
#include <Library/PcdLib.h> diff --git
a/UefiPayloadPkg/Include/Guid/SerialPortInfoGuid.h
b/UefiPayloadPkg/Include/Guid/SerialPortInfoGuid.h
index a15d5b8671..10197134a3 100644
--- a/UefiPayloadPkg/Include/Guid/SerialPortInfoGuid.h
+++ b/UefiPayloadPkg/Include/Guid/SerialPortInfoGuid.h
@@ -6,8 +6,8 @@
**/ -#ifndef __SERIAL_PORT_INFO_GUID_H__-#define
__SERIAL_PORT_INFO_GUID_H__+#ifndef
SERIAL_PORT_INFO_GUID_H_+#define SERIAL_PORT_INFO_GUID_H_ ///
/// Serial Port Information GUIDdiff --git
a/UefiPayloadPkg/Include/Guid/SystemTableInfoGuid.h
b/UefiPayloadPkg/Include/Guid/SystemTableInfoGuid.h
index 2446820285..e742dd0ca5 100644
--- a/UefiPayloadPkg/Include/Guid/SystemTableInfoGuid.h
+++ b/UefiPayloadPkg/Include/Guid/SystemTableInfoGuid.h
@@ -6,8 +6,8 @@
**/ -#ifndef __SYSTEM_TABLE_INFO_GUID_H__-#define
__SYSTEM_TABLE_INFO_GUID_H__+#ifndef
SYSTEM_TABLE_INFO_GUID_H_+#define SYSTEM_TABLE_INFO_GUID_H_
/// /// System Table Information GUIDdiff --git
a/UefiPayloadPkg/Include/Library/BlParseLib.h
b/UefiPayloadPkg/Include/Library/BlParseLib.h
index 49eac31248..ac61faf980 100644
--- a/UefiPayloadPkg/Include/Library/BlParseLib.h
+++ b/UefiPayloadPkg/Include/Library/BlParseLib.h
@@ -6,6 +6,9 @@
SPDX-License-Identifier: BSD-2-Clause-Patent **/+#ifndef
BOOTLOADER_PARSE_LIB_+#define BOOTLOADER_PARSE_LIB_+ #include
<PiPei.h> #include <Guid/GraphicsInfoHob.h> #include
<Guid/MemoryMapInfoGuid.h>@@ -13,9 +16,6 @@
#include <Guid/SystemTableInfoGuid.h> #include
<Guid/AcpiBoardInfoGuid.h> -#ifndef __BOOTLOADER_PARSE_LIB__-
#define __BOOTLOADER_PARSE_LIB__- #define
GET_BOOTLOADER_PARAMETER() PcdGet64 (PcdBootloaderParameter)
typedef RETURN_STATUS \@@ -73,7 +73,7 @@ ParseSystemTable (
/** Find the serial port information - @param SERIAL_PORT_INFO Pointer
to serial port info structure+ @param SerialPortInfo Pointer to serial port
info structure @retval RETURN_SUCCESS Successfully find the serial port
information. @retval RETURN_NOT_FOUND Failed to find the serial port
information .diff --git a/UefiPayloadPkg/Include/Library/DxeHobListLib.h
b/UefiPayloadPkg/Include/Library/DxeHobListLib.h
index 7e9b23f6d7..139b11e329 100644
--- a/UefiPayloadPkg/Include/Library/DxeHobListLib.h
+++ b/UefiPayloadPkg/Include/Library/DxeHobListLib.h
@@ -15,8 +15,8 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
**/ -#ifndef __DXE_HOB_LIST_LIB_H__-#define
__DXE_HOB_LIST_LIB_H__+#ifndef DXE_HOB_LIST_LIB_H_+#define
DXE_HOB_LIST_LIB_H_ /// /// Cache copy of the start of HOB listdiff --git
a/UefiPayloadPkg/Include/Library/PlatformSupportLib.h
b/UefiPayloadPkg/Include/Library/PlatformSupportLib.h
index d9f0b83075..73263722eb 100644
--- a/UefiPayloadPkg/Include/Library/PlatformSupportLib.h
+++ b/UefiPayloadPkg/Include/Library/PlatformSupportLib.h
@@ -8,8 +8,8 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
**/ -#ifndef __BOOTLOADER_PLATFORM_SUPPORT_LIB__-#define
__BOOTLOADER_PLATFORM_SUPPORT_LIB__+#ifndef
BOOTLOADER_PLATFORM_SUPPORT_LIB_+#define
BOOTLOADER_PLATFORM_SUPPORT_LIB_ /** Parse platform specific
information from bootloaderdiff --git
a/UefiPayloadPkg/Library/CbParseLib/CbParseLib.c
b/UefiPayloadPkg/Library/CbParseLib/CbParseLib.c
index 4be5d66ba5..990508496f 100644
--- a/UefiPayloadPkg/Library/CbParseLib/CbParseLib.c
+++ b/UefiPayloadPkg/Library/CbParseLib/CbParseLib.c
@@ -322,7 +322,7 @@ ParseCbMemTable (
) { EFI_STATUS Status;- struct cb_memory *rec;+ CB_MEMORY
*Rec; struct cb_memory_range *Range; UINT64 Start; UINT64
Size;@@ -339,13 +339,13 @@ ParseCbMemTable (
// // Get the coreboot memory table //- rec = (struct cb_memory
*)FindCbTag (CB_TAG_MEMORY);- if (rec == NULL) {+ Rec = (CB_MEMORY
*)FindCbTag (CB_TAG_MEMORY);+ if (Rec == NULL) { return Status; } -
for (Index = 0; Index < MEM_RANGE_COUNT(rec); Index++) {- Range =
MEM_RANGE_PTR(rec, Index);+ for (Index = 0; Index <
MEM_RANGE_COUNT(Rec); Index++) {+ Range = MEM_RANGE_PTR(Rec,
Index); Start = cb_unpack64(Range->start); Size = cb_unpack64(Range-
size); @@ -380,7 +380,7 @@ ParseMemoryInfo (
IN VOID *Params ) {- struct cb_memory *rec;+ CB_MEMORY
*Rec; struct cb_memory_range *Range; UINTN Index;
MEMROY_MAP_ENTRY MemoryMap;@@ -388,13 +388,13 @@
ParseMemoryInfo (
// // Get the coreboot memory table //- rec = (struct cb_memory
*)FindCbTag (CB_TAG_MEMORY);- if (rec == NULL) {+ Rec = (CB_MEMORY
*)FindCbTag (CB_TAG_MEMORY);+ if (Rec == NULL) { return
RETURN_NOT_FOUND; } - for (Index = 0; Index <
MEM_RANGE_COUNT(rec); Index++) {- Range = MEM_RANGE_PTR(rec,
Index);+ for (Index = 0; Index < MEM_RANGE_COUNT(Rec); Index++) {+
Range = MEM_RANGE_PTR(Rec, Index); MemoryMap.Base =
cb_unpack64(Range->start); MemoryMap.Size = cb_unpack64(Range-
size); MemoryMap.Type = (UINT8)Range->type;@@ -449,7 +449,7 @@
ParseSystemTable (
/** Find the serial port information - @param SERIAL_PORT_INFO Pointer
to serial port info structure+ @param SerialPortInfo Pointer to serial port
info structure @retval RETURN_SUCCESS Successfully find the serial port
information. @retval RETURN_NOT_FOUND Failed to find the serial port
information .diff --git
a/UefiPayloadPkg/Library/DxeHobListLibNull/DxeHobListLibNull.c
b/UefiPayloadPkg/Library/DxeHobListLibNull/DxeHobListLibNull.c
index 92d3e17ef0..6c69f9879e 100644
--- a/UefiPayloadPkg/Library/DxeHobListLibNull/DxeHobListLibNull.c
+++ b/UefiPayloadPkg/Library/DxeHobListLibNull/DxeHobListLibNull.c
@@ -10,6 +10,12 @@
#include <Uefi.h> +/**+ The dummy constructor for DxeHobListLib.++
@retval EFI_SUCCESS++**/ EFI_STATUS EFIAPI
DxeHobListLibNullConstructor (diff --git
a/UefiPayloadPkg/Library/PayloadEntryHobLib/Hob.c
b/UefiPayloadPkg/Library/PayloadEntryHobLib/Hob.c
index dd25ac2682..61cd11ba03 100644
--- a/UefiPayloadPkg/Library/PayloadEntryHobLib/Hob.c
+++ b/UefiPayloadPkg/Library/PayloadEntryHobLib/Hob.c
@@ -168,31 +168,6 @@ BuildResourceDescriptorHob (
Hob->ResourceLength = NumberOfBytes; } -VOID-EFIAPI-BuildFvHobs (-
IN EFI_PHYSICAL_ADDRESS PhysicalStart,- IN UINT64
NumberOfBytes,- IN EFI_RESOURCE_ATTRIBUTE_TYPE *ResourceAttribute-
)-{-- EFI_RESOURCE_ATTRIBUTE_TYPE Resource;-- BuildFvHob
(PhysicalStart, NumberOfBytes);-- if (ResourceAttribute == NULL) {-
Resource = (EFI_RESOURCE_ATTRIBUTE_PRESENT |-
EFI_RESOURCE_ATTRIBUTE_INITIALIZED |-
EFI_RESOURCE_ATTRIBUTE_TESTED |-
EFI_RESOURCE_ATTRIBUTE_WRITE_BACK_CACHEABLE);- } else {- Resource
= *ResourceAttribute;- }-- BuildResourceDescriptorHob
(EFI_RESOURCE_FIRMWARE_DEVICE, Resource, PhysicalStart,
NumberOfBytes);-}- /** Returns the next instance of a HOB type from the
starting HOB. @@ -283,7 +258,8 @@ EFIAPI
GetNextGuidHob ( IN CONST EFI_GUID *Guid, IN CONST VOID
*HobStart- ){+ )+{ EFI_PEI_HOB_POINTERS GuidHob; GuidHob.Raw =
(UINT8 *) HobStart;diff --git
a/UefiPayloadPkg/Library/PciHostBridgeLib/PciHostBridge.h
b/UefiPayloadPkg/Library/PciHostBridgeLib/PciHostBridge.h
index 3eee1fbeac..2848da5ce6 100644
--- a/UefiPayloadPkg/Library/PciHostBridgeLib/PciHostBridge.h
+++ b/UefiPayloadPkg/Library/PciHostBridgeLib/PciHostBridge.h
@@ -8,8 +8,8 @@
**/ -#ifndef _PCI_HOST_BRIDGE_H-#define
_PCI_HOST_BRIDGE_H+#ifndef PCI_HOST_BRIDGE_H_+#define
PCI_HOST_BRIDGE_H_ #include <UniversalPayload/PciRootBridges.h> diff --
git a/UefiPayloadPkg/Library/PciHostBridgeLib/PciHostBridgeLib.c
b/UefiPayloadPkg/Library/PciHostBridgeLib/PciHostBridgeLib.c
index a0d7cdc306..0eddebe229 100644
--- a/UefiPayloadPkg/Library/PciHostBridgeLib/PciHostBridgeLib.c
+++ b/UefiPayloadPkg/Library/PciHostBridgeLib/PciHostBridgeLib.c
@@ -210,8 +210,8 @@ PciHostBridgeGetRootBridges (
Free the root bridge instances array returned from
PciHostBridgeGetRootBridges(). - @param The root bridge instances array.-
@param The count of the array.+ @param Bridges The root bridge
instances array.+ @param Count The count of the array. **/ VOID
EFIAPIdiff --git
a/UefiPayloadPkg/Library/PciHostBridgeLib/PciHostBridgeSupport.c
b/UefiPayloadPkg/Library/PciHostBridgeLib/PciHostBridgeSupport.c
index b0268f0506..eb28d48b3b 100644
--- a/UefiPayloadPkg/Library/PciHostBridgeLib/PciHostBridgeSupport.c
+++ b/UefiPayloadPkg/Library/PciHostBridgeLib/PciHostBridgeSupport.c
@@ -205,7 +205,7 @@ PcatPciRootBridgeParseBars (
// // IO Bar //- if (Command & EFI_PCI_COMMAND_IO_SPACE)
{+ if ((Command & EFI_PCI_COMMAND_IO_SPACE) != 0) { Mask =
0xfffffffc; Base = OriginalValue & Mask; Length = ((~(Value & Mask))
& Mask) + 0x04;@@ -227,7 +227,7 @@ PcatPciRootBridgeParseBars (
// // Mem Bar //- if (Command &
EFI_PCI_COMMAND_MEMORY_SPACE) {+ if ((Command &
EFI_PCI_COMMAND_MEMORY_SPACE) != 0) { Mask = 0xfffffff0;
Base = OriginalValue & Mask;@@ -306,9 +306,14 @@ ScanForRootBridges (
UINT64 Base; UINT64 Limit; UINT64 Value;-
PCI_ROOT_BRIDGE_APERTURE Io, Mem, MemAbove4G, PMem,
PMemAbove4G, *MemAperture;- PCI_ROOT_BRIDGE *RootBridges;-
UINTN BarOffsetEnd;+ PCI_ROOT_BRIDGE_APERTURE Io;+
PCI_ROOT_BRIDGE_APERTURE Mem;+ PCI_ROOT_BRIDGE_APERTURE
MemAbove4G;+ PCI_ROOT_BRIDGE_APERTURE PMem;+
PCI_ROOT_BRIDGE_APERTURE PMemAbove4G;+
PCI_ROOT_BRIDGE_APERTURE *MemAperture;+ PCI_ROOT_BRIDGE
*RootBridges;+ UINTN BarOffsetEnd; *NumberOfRootBridges =
0;diff --git
a/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.c
b/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.c
index c4d317fa9e..dd91fcb29d 100644
---
a/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.c
+++
b/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.
+++ c
@@ -15,6 +15,10 @@ SPDX-License-Identifier: BSD-2-Clause-Patent

UNIVERSAL_PAYLOAD_PLATFORM_BOOT_MANAGER_OVERRIDE_PROTOCO
L *mUniversalPayloadPlatformBootManagerOverrideInstance = NULL;
+/**+ Signal EndOfDxe event and install SMM Ready to lock protocol.++**/
VOID InstallReadyToLock ( VOIDdiff --git
a/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.
h
b/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.
h
index 2f600c796f..c781610c6c 100644
---
a/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.
h
+++
b/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.
+++ h
@@ -1,12 +1,12 @@
-/**@file+/** @file Head file for BDS Platform specific code Copyright (c)
2015 - 2016, Intel Corporation. All rights reserved.<BR> SPDX-License-
Identifier: BSD-2-Clause-Patent **/ -#ifndef
_PLATFORM_BOOT_MANAGER_H-#define
_PLATFORM_BOOT_MANAGER_H+#ifndef
PLATFORM_BOOT_MANAGER_H_+#define
PLATFORM_BOOT_MANAGER_H_ #include <PiDxe.h> #include
<Protocol/LoadedImage.h>diff --git
a/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformConsole.h
b/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformConsole.h
index 68bdf5e555..e9d0eb00ee 100644
--- a/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformConsole.h
+++ b/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformConsole.h
@@ -5,8 +5,8 @@ Copyright (c) 2016, Intel Corporation. All rights
reserved.<BR>
SPDX-License-Identifier: BSD-2-Clause-Patent **/ -#ifndef
_PLATFORM_CONSOLE_H-#define _PLATFORM_CONSOLE_H+#ifndef
PLATFORM_CONSOLE_H_+#define PLATFORM_CONSOLE_H_ #include
<PiDxe.h> #include <IndustryStandard/Pci.h>diff --git
a/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformData.c
b/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformData.c
index d17e660e0f..892a7f01be 100644
--- a/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformData.c
+++ b/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformData.c
@@ -1,4 +1,4 @@
-/**@file+/** @file Defined the platform specific device path which will be
filled to ConIn/ConOut variables. diff --git
a/UefiPayloadPkg/Library/ResetSystemLib/ResetSystemLib.c
b/UefiPayloadPkg/Library/ResetSystemLib/ResetSystemLib.c
index 2e4b7fe592..b35a4cc1d9 100644
--- a/UefiPayloadPkg/Library/ResetSystemLib/ResetSystemLib.c
+++ b/UefiPayloadPkg/Library/ResetSystemLib/ResetSystemLib.c
@@ -43,22 +43,6 @@ ResetSystemLibConstructor (
return EFI_SUCCESS; } --VOID-AcpiPmControl (- UINTN SuspendType- )-{-
UINTN PmCtrlReg;-- ASSERT (SuspendType <= 7);-- PmCtrlReg =
(UINTN)mAcpiBoardInfo.PmCtrlRegBase;- IoAndThenOr16 (PmCtrlReg,
(UINT16) ~0x3c00, (UINT16) (SuspendType << 10));- IoOr16 (PmCtrlReg,
BIT13);- CpuDeadLoop ();-}- /** Calling this function causes a system-wide
reset. This sets all circuitry within the system to its initial state. This type of
resetdiff --git a/UefiPayloadPkg/Library/SblParseLib/SblParseLib.c
b/UefiPayloadPkg/Library/SblParseLib/SblParseLib.c
index ccdcbfc07d..fc6b1b9a16 100644
--- a/UefiPayloadPkg/Library/SblParseLib/SblParseLib.c
+++ b/UefiPayloadPkg/Library/SblParseLib/SblParseLib.c
@@ -141,7 +141,7 @@ ParseSystemTable (
/** Find the serial port information - @param SERIAL_PORT_INFO Pointer
to serial port info structure+ @param[out] SerialPortInfo Pointer to serial
port info structure @retval RETURN_SUCCESS Successfully find the serial
port information. @retval RETURN_NOT_FOUND Failed to find the serial
port information .diff --git
a/UefiPayloadPkg/UefiPayloadEntry/LoadDxeCore.c
b/UefiPayloadPkg/UefiPayloadEntry/LoadDxeCore.c
index 0b6cb47cd0..67eed179f0 100644
--- a/UefiPayloadPkg/UefiPayloadEntry/LoadDxeCore.c
+++ b/UefiPayloadPkg/UefiPayloadEntry/LoadDxeCore.c
@@ -190,7 +190,7 @@ FvFindFileByTypeGuid (
@param FileHeader A pointer to the file header that contains the set
of sections to be searched.- @param SearchType The
value of the section type to search.+ @param SectionType The value
of the section type to search. @param SectionData A pointer to the
discovered section, if successful. @retval EFI_SUCCESS The section
was found.diff --git a/UefiPayloadPkg/UefiPayloadEntry/PrintHob.c
b/UefiPayloadPkg/UefiPayloadEntry/PrintHob.c
index 265d47ca9d..d7f3af1304 100644
--- a/UefiPayloadPkg/UefiPayloadEntry/PrintHob.c
+++ b/UefiPayloadPkg/UefiPayloadEntry/PrintHob.c
@@ -196,7 +196,10 @@ PrintResourceDiscriptorHob (
/** Print the information in Acpi Guid Hob.+ @param[in] HobRaw A
pointer to the start of gUniversalPayloadAcpiTableGuid HOB.+ @param[in]
HobLength The size of the HOB data buffer.+ @retval EFI_SUCCESS If
it completed successfully. **/ EFI_STATUS@@ -217,6 +220,8 @@
PrintAcpiGuidHob (
/** Print the information in Serial Guid Hob. @param[in] HobRaw A
pointer to the start of gUniversalPayloadSerialPortInfoGuid HOB.+
@param[in] HobLength The size of the HOB data buffer.+ @retval
EFI_SUCCESS If it completed successfully. **/ EFI_STATUS@@ -240,6
+245,7 @@ PrintSerialGuidHob (
/** Print the information in Smbios Guid Hob. @param[in] HobRaw A
pointer to the start of gUniversalPayloadSmbios3TableGuid HOB.+
@param[in] HobLength The size of the HOB data buffer. @retval
EFI_SUCCESS If it completed successfully. **/ EFI_STATUS@@ -260,6
+266,8 @@ PrintSmbios3GuidHob (
/** Print the information in Smbios Guid Hob. @param[in] HobRaw A
pointer to the start of gUniversalPayloadSmbiosTableGuid HOB.+ @param[in]
HobLength The size of the HOB data buffer.+ @retval EFI_SUCCESS If
it completed successfully. **/ EFI_STATUS@@ -280,6 +288,8 @@
PrintSmbiosTablGuidHob (
/** Print the information in Acpi BoardInfo Guid Hob. @param[in] HobRaw
A pointer to the start of gUefiAcpiBoardInfoGuid HOB.+ @param[in]
HobLength The size of the HOB data buffer.+ @retval EFI_SUCCESS If
it completed successfully. **/ EFI_STATUS@@ -307,6 +317,7 @@
PrintAcpiBoardInfoGuidHob (
/** Print the information in Pci RootBridge Info Guid Hob. @param[in]
HobRaw A pointer to the start of
gUniversalPayloadPciRootBridgeInfoGuid HOB.+ @param[in] HobLength
The size of the HOB data buffer. @retval EFI_SUCCESS If it completed
successfully. **/@@ -362,6 +373,8 @@ PrintPciRootBridgeInfoGuidHob (
/** Print the information in Extra Data Guid Hob. @param[in] HobRaw
A pointer to the start of gUniversalPayloadExtraDataGuid HOB.+ @param[in]
HobLength The size of the HOB data buffer.+ @retval EFI_SUCCESS If
it completed successfully. **/ EFI_STATUS@@ -394,6 +407,8 @@
PrintExtraDataGuidHob (
/** Print the information in MemoryTypeInfoGuidHob. @param[in]
HobRaw A pointer to the start of gEfiMemoryTypeInformationGuid
HOB.+ @param[in] HobLength The size of the HOB data buffer.+ @retval
EFI_SUCCESS If it completed successfully. **/ EFI_STATUS@@ -414,7
+429,7 @@ PrintMemoryTypeInfoGuidHob (
/** Print the information in EdkiiBootManagerMenuFileGuid. @param[in]
HobRaw A pointer to the start of gEdkiiBootManagerMenuFileGuid
HOB.- @param[in] HobLength The size of the data buffer.+ @param[in]
HobLength The size of the HOB data buffer. @retval EFI_SUCCESS If it
completed successfully. **/ EFI_STATUSdiff --git
a/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.c
b/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.c
index 0e6dcf10f9..adc56dc15f 100644
--- a/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.c
+++ b/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.c
@@ -389,6 +389,8 @@ BuildGenericHob (
/** Entry point to the C language phase of UEFI payload. + @param[in]
BootloaderParameter The starting address of bootloader parameter block.+
@retval It will not return if SUCCESS, and return error when passing
bootloader parameter. **/ EFI_STATUSdiff --git
a/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.h
b/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.h
index de51c2fba9..637ed9c20b 100644
--- a/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.h
+++ b/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.h
@@ -1,9 +1,9 @@
/** @file-*-* Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>-
*-* SPDX-License-Identifier: BSD-2-Clause-Patent-*++ Copyright (c) 2021,
Intel Corporation. All rights reserved.<BR>++ SPDX-License-Identifier: BSD-
2-Clause-Patent+ **/ #ifndef __UEFI_PAYLOAD_ENTRY_H__diff --git
a/UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry.c
b/UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry.c
index 7e67cf0f04..4d1096b323 100644
--- a/UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry.c
+++ b/UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry.c
@@ -114,18 +114,19 @@ AddNewHob (
} /**- Found the Resource Descriptor HOB that contains a range+ Found
the Resource Descriptor HOB that contains a range (Base, Top) + @param[in]
HobList Hob start address @param[in] Base Memory start address-
@param[in] Top Memory Top.+ @param[in] Top Memory end
address. - @return The pointer to the Resource Descriptor HOB.+ @retval
The pointer to the Resource Descriptor HOB. **/
EFI_HOB_RESOURCE_DESCRIPTOR * FindResourceDescriptorByRange (-
VOID *HobList,- EFI_PHYSICAL_ADDRESS Base,-
EFI_PHYSICAL_ADDRESS Top+ IN VOID *HobList,+ IN
EFI_PHYSICAL_ADDRESS Base,+ IN EFI_PHYSICAL_ADDRESS Top )
{ EFI_PEI_HOB_POINTERS Hob;@@ -171,7 +172,7 @@
FindResourceDescriptorByRange (
@param[in] MinimalNeededSize Minimal needed size. @param[in]
ExceptResourceHob Ignore this Resource Descriptor. - @return The
pointer to the Resource Descriptor HOB.+ @retval The pointer to the
Resource Descriptor HOB. **/ EFI_HOB_RESOURCE_DESCRIPTOR *
FindAnotherHighestBelow4GResourceDescriptor (@@ -240,6 +241,9 @@
FindAnotherHighestBelow4GResourceDescriptor (
/** It will build HOBs based on information from bootloaders. + @param[in]
BootloaderParameter The starting memory address of bootloader
parameter block.+ @param[out] DxeFv The pointer to the DXE FV in
memory.+ @retval EFI_SUCCESS If it completed successfully. @retval
Others If it failed to build required HOBs. **/@@ -376,6 +380,8 @@
BuildHobs (
/** Entry point to the C language phase of UEFI payload. + @param[in]
BootloaderParameter The starting address of bootloader parameter block.+
@retval It will not return if SUCCESS, and return error when passing
bootloader parameter. **/ EFI_STATUS--
2.32.0.windows.2



-=-=-=-=-=-=
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#82173): https://edk2.groups.io/g/devel/message/82173
Mute This Topic: https://groups.io/mt/86362335/1773972
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [maurice.ma@intel.com]
-=-=-=-=-=-=