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

Go to the source code of this file.

Functions

VOID * AllocateCodePages (IN UINTN Pages)
 
EFI_STATUS LoadPeCoffImage (IN VOID *PeCoffImage, OUT EFI_PHYSICAL_ADDRESS *ImageAddress, OUT UINT64 *ImageSize, OUT EFI_PHYSICAL_ADDRESS *EntryPoint)
 
EFI_STATUS FvFindFileByTypeGuid (IN EFI_FIRMWARE_VOLUME_HEADER *FvHeader, IN EFI_FV_FILETYPE FileType, IN EFI_GUID *Guid OPTIONAL, OUT EFI_FFS_FILE_HEADER **FileHeader)
 
EFI_STATUS FileFindSection (IN EFI_FFS_FILE_HEADER *FileHeader, IN EFI_SECTION_TYPE SectionType, OUT VOID **SectionData)
 
EFI_STATUS LoadDxeCore (OUT PHYSICAL_ADDRESS *DxeCoreEntryPoint)
 
EFI_STATUS UniversalLoadDxeCore (IN EFI_FIRMWARE_VOLUME_HEADER *DxeFv, OUT PHYSICAL_ADDRESS *DxeCoreEntryPoint)
 

Detailed Description

Copyright (c) 2020, Intel Corporation. All rights reserved.

SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file LoadDxeCore.c.

Function Documentation

◆ AllocateCodePages()

VOID * AllocateCodePages ( IN UINTN  Pages)

Allocate pages for code.

Parameters
[in]PagesNumber of pages to be allocated.
Returns
Allocated memory.

Definition at line 19 of file LoadDxeCore.c.

◆ FileFindSection()

EFI_STATUS FileFindSection ( IN EFI_FFS_FILE_HEADER FileHeader,
IN EFI_SECTION_TYPE  SectionType,
OUT VOID **  SectionData 
)

This function searchs a given section type within a valid FFS file.

Parameters
FileHeaderA pointer to the file header that contains the set of sections to be searched.
SectionTypeThe value of the section type to search.
SectionDataA pointer to the discovered section, if successful.
Return values
EFI_SUCCESSThe section was found.
EFI_NOT_FOUNDThe section was not found.

Definition at line 201 of file LoadDxeCore.c.

◆ FvFindFileByTypeGuid()

EFI_STATUS FvFindFileByTypeGuid ( IN EFI_FIRMWARE_VOLUME_HEADER FvHeader,
IN EFI_FV_FILETYPE  FileType,
IN EFI_GUID *Guid  OPTIONAL,
OUT EFI_FFS_FILE_HEADER **  FileHeader 
)

This function searchs a given file type with a given Guid within a valid FV. If input Guid is NULL, will locate the first section having the given file type

Parameters
FvHeaderA pointer to firmware volume header that contains the set of files to be searched.
FileTypeFile type to be searched.
GuidWill ignore if it is NULL.
FileHeaderA pointer to the discovered file, if successful.
Return values
EFI_SUCCESSSuccessfully found FileType
EFI_NOT_FOUNDFile type can't be found.

Definition at line 131 of file LoadDxeCore.c.

◆ LoadDxeCore()

EFI_STATUS LoadDxeCore ( OUT PHYSICAL_ADDRESS *  DxeCoreEntryPoint)

Find DXE core from FV and build DXE core HOBs.

Parameters
[out]DxeCoreEntryPointDXE core entry point
Return values
EFI_SUCCESSIf it completed successfully.
EFI_NOT_FOUNDIf it failed to load DXE FV.

Definition at line 259 of file LoadDxeCore.c.

◆ LoadPeCoffImage()

EFI_STATUS LoadPeCoffImage ( IN VOID *  PeCoffImage,
OUT EFI_PHYSICAL_ADDRESS ImageAddress,
OUT UINT64 *  ImageSize,
OUT EFI_PHYSICAL_ADDRESS EntryPoint 
)

Loads and relocates a PE/COFF image

Parameters
[in]PeCoffImagePoint to a Pe/Coff image.
[out]ImageAddressThe image memory address after relocation.
[out]ImageSizeThe image size.
[out]EntryPointThe image entry point.
Returns
EFI_SUCCESS If the image is loaded and relocated successfully.
Others If the image failed to load or relocate.

Definition at line 60 of file LoadDxeCore.c.

◆ UniversalLoadDxeCore()

EFI_STATUS UniversalLoadDxeCore ( IN EFI_FIRMWARE_VOLUME_HEADER DxeFv,
OUT PHYSICAL_ADDRESS *  DxeCoreEntryPoint 
)

Find DXE core from FV and build DXE core HOBs.

Parameters
[in]DxeFvThe FV where to find the DXE core.
[out]DxeCoreEntryPointDXE core entry point
Return values
EFI_SUCCESSIf it completed successfully.
EFI_NOT_FOUNDIf it failed to load DXE FV.

Definition at line 327 of file LoadDxeCore.c.