UefiPayloadPkg: Fix ECC reported issues
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> Reviewed-by: Maurice Ma <maurice.ma@intel.com>
This commit is contained in:
@@ -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;
|
||||
MEMORY_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 .
|
||||
|
@@ -10,6 +10,12 @@
|
||||
|
||||
#include <Uefi.h>
|
||||
|
||||
/**
|
||||
The dummy constructor for DxeHobListLib.
|
||||
|
||||
@retval EFI_SUCCESS
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
DxeHobListLibNullConstructor (
|
||||
|
@@ -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;
|
||||
|
@@ -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>
|
||||
|
||||
|
@@ -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
|
||||
EFIAPI
|
||||
|
@@ -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;
|
||||
|
@@ -15,6 +15,10 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||
|
||||
UNIVERSAL_PAYLOAD_PLATFORM_BOOT_MANAGER_OVERRIDE_PROTOCOL *mUniversalPayloadPlatformBootManagerOverrideInstance = NULL;
|
||||
|
||||
/**
|
||||
Signal EndOfDxe event and install SMM Ready to lock protocol.
|
||||
|
||||
**/
|
||||
VOID
|
||||
InstallReadyToLock (
|
||||
VOID
|
||||
|
@@ -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>
|
||||
|
@@ -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>
|
||||
|
@@ -1,4 +1,4 @@
|
||||
/**@file
|
||||
/** @file
|
||||
Defined the platform specific device path which will be filled to
|
||||
ConIn/ConOut variables.
|
||||
|
||||
|
@@ -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 reset
|
||||
|
@@ -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 .
|
||||
|
Reference in New Issue
Block a user