TianoCore EDK2 master
Loading...
Searching...
No Matches
UniversalPayloadEntry.c File Reference
#include "UefiPayloadEntry.h"

Go to the source code of this file.

Macros

#define MEMORY_ATTRIBUTE_MASK
 
#define TESTED_MEMORY_ATTRIBUTES
 

Functions

VOID PrintHob (IN CONST VOID *HobStart)
 
EFI_STATUS FixUpPcdDatabase (IN EFI_FIRMWARE_VOLUME_HEADER *DxeFv)
 
VOID AddNewHob (IN EFI_PEI_HOB_POINTERS *Hob)
 
EFI_HOB_RESOURCE_DESCRIPTORFindResourceDescriptorByRange (IN VOID *HobList, IN EFI_PHYSICAL_ADDRESS Base, IN EFI_PHYSICAL_ADDRESS Top)
 
EFI_HOB_RESOURCE_DESCRIPTORFindAnotherHighestBelow4GResourceDescriptor (IN VOID *HobList, IN UINTN MinimalNeededSize, IN EFI_HOB_RESOURCE_DESCRIPTOR *ExceptResourceHob)
 
BOOLEAN IsHobNeed (EFI_PEI_HOB_POINTERS Hob)
 
EFI_STATUS BuildHobs (IN UINTN BootloaderParameter, OUT EFI_FIRMWARE_VOLUME_HEADER **DxeFv)
 
EFI_STATUS EFIAPI _ModuleEntryPoint (IN UINTN BootloaderParameter)
 

Variables

VOID * mHobList
 

Detailed Description

Copyright (c) 2021, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file UniversalPayloadEntry.c.

Macro Definition Documentation

◆ MEMORY_ATTRIBUTE_MASK

#define MEMORY_ATTRIBUTE_MASK
Value:
(EFI_RESOURCE_ATTRIBUTE_PRESENT | \
EFI_RESOURCE_ATTRIBUTE_INITIALIZED | \
EFI_RESOURCE_ATTRIBUTE_TESTED | \
EFI_RESOURCE_ATTRIBUTE_READ_PROTECTED | \
EFI_RESOURCE_ATTRIBUTE_WRITE_PROTECTED | \
EFI_RESOURCE_ATTRIBUTE_EXECUTION_PROTECTED | \
EFI_RESOURCE_ATTRIBUTE_READ_ONLY_PROTECTED | \
EFI_RESOURCE_ATTRIBUTE_16_BIT_IO | \
EFI_RESOURCE_ATTRIBUTE_32_BIT_IO | \
EFI_RESOURCE_ATTRIBUTE_64_BIT_IO | \
EFI_RESOURCE_ATTRIBUTE_PERSISTENT )

Definition at line 10 of file UniversalPayloadEntry.c.

◆ TESTED_MEMORY_ATTRIBUTES

#define TESTED_MEMORY_ATTRIBUTES
Value:
(EFI_RESOURCE_ATTRIBUTE_PRESENT | \
EFI_RESOURCE_ATTRIBUTE_INITIALIZED | \
EFI_RESOURCE_ATTRIBUTE_TESTED )

Definition at line 22 of file UniversalPayloadEntry.c.

Function Documentation

◆ _ModuleEntryPoint()

EFI_STATUS EFIAPI _ModuleEntryPoint ( IN UINTN  BootloaderParameter)

Entry point to the C language phase of UEFI payload.

Parameters
[in]BootloaderParameterThe starting address of bootloader parameter block.
Return values
Itwill not return if SUCCESS, and return error when passing bootloader parameter.

Definition at line 454 of file UniversalPayloadEntry.c.

◆ AddNewHob()

VOID AddNewHob ( IN EFI_PEI_HOB_POINTERS Hob)

Add HOB into HOB list

Parameters
[in]HobThe HOB to be added into the HOB list.

Definition at line 103 of file UniversalPayloadEntry.c.

◆ BuildHobs()

EFI_STATUS BuildHobs ( IN UINTN  BootloaderParameter,
OUT EFI_FIRMWARE_VOLUME_HEADER **  DxeFv 
)

It will build HOBs based on information from bootloaders.

Parameters
[in]BootloaderParameterThe starting memory address of bootloader parameter block.
[out]DxeFvThe pointer to the DXE FV in memory.
Return values
EFI_SUCCESSIf it completed successfully.
OthersIf it failed to build required HOBs.

Definition at line 296 of file UniversalPayloadEntry.c.

◆ FindAnotherHighestBelow4GResourceDescriptor()

EFI_HOB_RESOURCE_DESCRIPTOR * FindAnotherHighestBelow4GResourceDescriptor ( IN VOID *  HobList,
IN UINTN  MinimalNeededSize,
IN EFI_HOB_RESOURCE_DESCRIPTOR ExceptResourceHob 
)

Find the highest below 4G memory resource descriptor, except the input Resource Descriptor.

Parameters
[in]HobListHob start address
[in]MinimalNeededSizeMinimal needed size.
[in]ExceptResourceHobIgnore this Resource Descriptor.
Return values
Thepointer to the Resource Descriptor HOB.

Definition at line 188 of file UniversalPayloadEntry.c.

◆ FindResourceDescriptorByRange()

EFI_HOB_RESOURCE_DESCRIPTOR * FindResourceDescriptorByRange ( IN VOID *  HobList,
IN EFI_PHYSICAL_ADDRESS  Base,
IN EFI_PHYSICAL_ADDRESS  Top 
)

Found the Resource Descriptor HOB that contains a range (Base, Top)

Parameters
[in]HobListHob start address
[in]BaseMemory start address
[in]TopMemory end address.
Return values
Thepointer to the Resource Descriptor HOB.

Definition at line 132 of file UniversalPayloadEntry.c.

◆ FixUpPcdDatabase()

EFI_STATUS FixUpPcdDatabase ( IN EFI_FIRMWARE_VOLUME_HEADER DxeFv)

Some bootloader may pass a pcd database, and UPL also contain a PCD database. Dxe PCD driver has the assumption that the two PCD database can be catenated and the local token number should be successive. This function will fix up the UPL PCD database to meet that assumption.

Parameters
[in]DxeFvThe FV where to find the Universal PCD database.
Return values
EFI_SUCCESSIf it completed successfully.
otherFailed to fix up.

Definition at line 50 of file UniversalPayloadEntry.c.

◆ IsHobNeed()

BOOLEAN IsHobNeed ( EFI_PEI_HOB_POINTERS  Hob)

Check the HOB and decide if it is need inside Payload

Payload maintainer may make decision which HOB is need or needn't Then add the check logic in the function.

Parameters
[in]HobThe HOB to check
Return values
TRUEIf HOB is need inside Payload
FALSEIf HOB is needn't inside Payload

Definition at line 268 of file UniversalPayloadEntry.c.

◆ PrintHob()

VOID PrintHob ( IN CONST VOID *  HobStart)

Print all HOBs info from the HOB list.

Returns
The pointer to the HOB list.

Print all HOBs info from the HOB list.

Parameters
[in]HobStartA pointer to the HOB list

Definition at line 362 of file PrintHob.c.

Variable Documentation

◆ mHobList

VOID* mHobList
extern

Definition at line 25 of file HobLib.c.