|
TianoCore EDK2 master
|
Go to the source code of this file.
Macros | |
| #define | GET_OCCUPIED_SIZE(ActualSize, Alignment) (ActualSize) + (((Alignment) - ((ActualSize) & ((Alignment) - 1))) & ((Alignment) - 1)) |
Implementation of the 6 PEI Ffs (FV) APIs in library form.
This code only knows about a FV if it has a EFI_HOB_TYPE_FV entry in the HOB list
Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file FwVol.c.
| #define GET_OCCUPIED_SIZE | ( | ActualSize, | |
| Alignment | |||
| ) | (ActualSize) + (((Alignment) - ((ActualSize) & ((Alignment) - 1))) & ((Alignment) - 1)) |
| STATIC UINT8 CalculateHeaderChecksum | ( | IN EFI_FFS_FILE_HEADER * | FileHeader | ) |
| EFI_STATUS EFIAPI FfsAnyFvFindFirstFile | ( | IN EFI_FV_FILETYPE | FileType, |
| OUT EFI_PEI_FV_HANDLE * | VolumeHandle, | ||
| OUT EFI_PEI_FILE_HANDLE * | FileHandle | ||
| ) |
Search through every FV until you find a file of type FileType
| FileType | File handle of a Fv type file. |
| Volumehandle | On success Volume Handle of the match |
| FileHandle | On success File Handle of the match |
| EFI_NOT_FOUND | FV image can't be found. |
| EFI_SUCCESS | Successfully found FileType |
| EFI_STATUS EFIAPI FfsFindFileByName | ( | IN CONST EFI_GUID * | FileName, |
| IN EFI_PEI_FV_HANDLE | VolumeHandle, | ||
| OUT EFI_PEI_FILE_HANDLE * | FileHandle | ||
| ) |
Find a file in the volume by name
| FileName | A pointer to the name of the file to find within the firmware volume. |
| VolumeHandle | The firmware volume to search FileHandle Upon exit, points to the found file's handle or NULL if it could not be found. |
| EFI_SUCCESS | File was found. |
| EFI_NOT_FOUND | File was not found. |
| EFI_INVALID_PARAMETER | VolumeHandle or FileHandle or FileName was NULL. |
| EFI_STATUS EFIAPI FfsFindNextFile | ( | IN UINT8 | SearchType, |
| IN EFI_PEI_FV_HANDLE | VolumeHandle, | ||
| IN OUT EFI_PEI_FILE_HANDLE * | FileHandle | ||
| ) |
This service enables discovery of additional firmware files.
| SearchType | A filter to find files only of this type. |
| FwVolHeader | Pointer to the firmware volume header of the volume to search. This parameter must point to a valid FFS volume. |
| FileHeader | Pointer to the current file from which to begin searching. |
| EFI_SUCCESS | The file was found. |
| EFI_NOT_FOUND | The file was not found. |
| EFI_NOT_FOUND | The header checksum was not zero. |
| EFI_STATUS EFIAPI FfsFindNextVolume | ( | IN UINTN | Instance, |
| IN OUT EFI_PEI_FV_HANDLE * | VolumeHandle | ||
| ) |
This service enables discovery of additional firmware volumes.
| Instance | This instance of the firmware volume to find. The value 0 is the Boot Firmware Volume (BFV). |
| FwVolHeader | Pointer to the firmware volume header of the volume to return. |
| EFI_SUCCESS | The volume was found. |
| EFI_NOT_FOUND | The volume was not found. |
| EFI_STATUS EFIAPI FfsFindSectionData | ( | IN EFI_SECTION_TYPE | SectionType, |
| IN EFI_PEI_FILE_HANDLE | FileHandle, | ||
| OUT VOID ** | SectionData | ||
| ) |
This service enables discovery sections of a given type within a valid FFS file.
| SectionType | The value of the section type to find. |
| FileHandle | A pointer to the file header that contains the set of sections to be searched. |
| SectionData | A pointer to the discovered section, if successful. |
| EFI_SUCCESS | The section was found. |
| EFI_NOT_FOUND | The section was not found. |
| EFI_STATUS EFIAPI FfsFindSectionDataWithHook | ( | IN EFI_SECTION_TYPE | SectionType, |
| IN FFS_CHECK_SECTION_HOOK | SectionCheckHook, | ||
| IN EFI_PEI_FILE_HANDLE | FileHandle, | ||
| OUT VOID ** | SectionData | ||
| ) |
This service enables discovery sections of a given type within a valid FFS file. Caller also can provide a SectionCheckHook to do additional checking.
| SectionType | The value of the section type to find. |
| SectionCheckHook | A hook which can check if the section is the target one. |
| FileHandle | A pointer to the file header that contains the set of sections to be searched. |
| SectionData | A pointer to the discovered section, if successful. |
| EFI_SUCCESS | The section was found. |
| EFI_NOT_FOUND | The section was not found. |
| EFI_STATUS EFIAPI FfsGetFileInfo | ( | IN EFI_PEI_FILE_HANDLE | FileHandle, |
| OUT EFI_FV_FILE_INFO * | FileInfo | ||
| ) |
Get information about the file by name.
| FileHandle | Handle of the file. |
| FileInfo | Upon exit, points to the file's information. |
| EFI_SUCCESS | File information returned. |
| EFI_INVALID_PARAMETER | If FileHandle does not represent a valid file. |
| EFI_INVALID_PARAMETER | If FileInfo is NULL. |
| EFI_STATUS EFIAPI FfsGetVolumeInfo | ( | IN EFI_PEI_FV_HANDLE | VolumeHandle, |
| OUT EFI_FV_INFO * | VolumeInfo | ||
| ) |
Get Information about the volume by name
| VolumeHandle | Handle of the volume. |
| VolumeInfo | Upon exit, points to the volume's information. |
| EFI_SUCCESS | File information returned. |
| EFI_INVALID_PARAMETER | If FileHandle does not represent a valid file. |
| EFI_INVALID_PARAMETER | If FileInfo is NULL. |
| EFI_STATUS EFIAPI FfsProcessFvFile | ( | IN EFI_PEI_FILE_HANDLE | FvFileHandle | ) |
| EFI_STATUS FfsProcessSection | ( | IN EFI_SECTION_TYPE | SectionType, |
| IN FFS_CHECK_SECTION_HOOK | SectionCheckHook, | ||
| IN EFI_COMMON_SECTION_HEADER * | Section, | ||
| IN UINTN | SectionSize, | ||
| OUT VOID ** | OutputBuffer | ||
| ) |
Go through the file to search SectionType section, when meeting an encapsuled section.
| SectionType | - Filter to find only section of this type. |
| SectionCheckHook | - A hook which can check if the section is the target one. |
| Section | - From where to search. |
| SectionSize | - The file size to search. |
| OutputBuffer | - Pointer to the section to search. |
| EFI_SUCCESS |
| STATIC BOOLEAN EFIAPI FileHandleToVolume | ( | IN EFI_PEI_FILE_HANDLE | FileHandle, |
| OUT EFI_PEI_FV_HANDLE * | VolumeHandle | ||
| ) |
| EFI_STATUS FindFileEx | ( | IN CONST EFI_PEI_FV_HANDLE | FvHandle, |
| IN CONST EFI_GUID *FileName | OPTIONAL, | ||
| IN EFI_FV_FILETYPE | SearchType, | ||
| IN OUT EFI_PEI_FILE_HANDLE * | FileHandle | ||
| ) |
Given the input file pointer, search for the next matching file in the FFS volume as defined by SearchType. The search starts from FileHeader inside the Firmware Volume defined by FwVolHeader.
| FileHandle | File handle to look up |
| VolumeHandle | Match for FileHandle |
| STATIC EFI_FFS_FILE_STATE GetFileState | ( | IN UINT8 | ErasePolarity, |
| IN EFI_FFS_FILE_HEADER * | FfsHeader | ||
| ) |