TianoCore EDK2 master
Loading...
Searching...
No Matches
HobParseLib.c File Reference

Go to the source code of this file.

Macros

#define MEMORY_ATTRIBUTE_MASK
 
#define TESTED_MEMORY_ATTRIBUTES
 

Functions

VOID *EFIAPI CreateHob (IN UINT16 HobType, IN UINT16 HobLength)
 
EFI_HOB_HANDOFF_INFO_TABLE *EFIAPI HobConstructor (IN VOID *EfiMemoryBottom, IN VOID *EfiMemoryTop, IN VOID *EfiFreeMemoryBottom, IN VOID *EfiFreeMemoryTop)
 
ACPI_BOARD_INFOBuildHobFromAcpi (IN UINT64 AcpiTableBase)
 
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)
 

Variables

VOID * mHobList
 

Detailed Description

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

Definition in file HobParseLib.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 23 of file HobParseLib.c.

◆ TESTED_MEMORY_ATTRIBUTES

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

Definition at line 35 of file HobParseLib.c.

Function Documentation

◆ 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 101 of file HobParseLib.c.

◆ BuildHobFromAcpi()

ACPI_BOARD_INFO * BuildHobFromAcpi ( IN UINT64  AcpiTableBase)

Build ACPI board info HOB using infomation from ACPI table

Parameters
AcpiTableBaseACPI table start address in memory
Return values
Apointer to ACPI board HOB ACPI_BOARD_INFO. Null if build HOB failure.

Definition at line 139 of file AcpiTable.c.

◆ CreateHob()

VOID *EFIAPI CreateHob ( IN UINT16  HobType,
IN UINT16  HobLength 
)

Add a new HOB to the HOB List.

Parameters
HobTypeType of the new HOB.
HobLengthLength of the new HOB to allocate.
Returns
NULL if there is no space to create a hob.
The address point to the new created hob.

This service enables PEIMs to create various types of HOBs.

Parameters
TypeThe type of HOB to be installed.
LengthThe length of the HOB to be added.
Return values
!NULLThe HOB was successfully created.
NULLThere is no additional space for HOB creation.

Definition at line 101 of file Hob.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 184 of file HobParseLib.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 128 of file HobParseLib.c.

◆ HobConstructor()

EFI_HOB_HANDOFF_INFO_TABLE *EFIAPI HobConstructor ( IN VOID *  EfiMemoryBottom,
IN VOID *  EfiMemoryTop,
IN VOID *  EfiFreeMemoryBottom,
IN VOID *  EfiFreeMemoryTop 
)

Build a Handoff Information Table HOB

This function initialize a HOB region from EfiMemoryBegin to EfiMemoryTop. And EfiFreeMemoryBottom and EfiFreeMemoryTop should be inside the HOB region.

Parameters
[in]EfiMemoryBottomTotal memory start address
[in]EfiMemoryTopTotal memory end address.
[in]EfiFreeMemoryBottomFree memory start address
[in]EfiFreeMemoryTopFree memory end address.
Returns
The pointer to the handoff HOB table.

Definition at line 54 of file Hob.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 264 of file HobParseLib.c.

Variable Documentation

◆ mHobList

VOID* mHobList
extern

Definition at line 25 of file HobLib.c.