]> git.proxmox.com Git - mirror_edk2.git/blob - StandaloneMmPkg/Include/Library/FvLib.h
UefiCpuPkg: Move AsmRelocateApLoopStart from Mpfuncs.nasm to AmdSev.nasm
[mirror_edk2.git] / StandaloneMmPkg / Include / Library / FvLib.h
1 /** @file
2
3 Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>
4 Copyright (c) 2016 - 2018, ARM Limited. All rights reserved.<BR>
5
6 SPDX-License-Identifier: BSD-2-Clause-Patent
7
8 **/
9
10 #ifndef _FV_LIB_H_
11 #define _FV_LIB_H_
12
13 #include <Uefi.h>
14 #include <Pi/PiFirmwareVolume.h>
15 #include <Pi/PiFirmwareFile.h>
16
17 /**
18 Given the input file pointer, search for the next matching file in the
19 FFS volume as defined by SearchType. The search starts from FileHeader inside
20 the Firmware Volume defined by FwVolHeader.
21
22 @param SearchType Filter to find only files of this type.
23 Type EFI_FV_FILETYPE_ALL causes no filtering to be done.
24 @param FwVolHeader Pointer to the FV header of the volume to search.
25 This parameter must point to a valid FFS volume.
26 @param FileHeader Pointer to the current file from which to begin searching.
27 This pointer will be updated upon return to reflect the file found.
28
29 @retval EFI_NOT_FOUND No files matching the search criteria were found
30 @retval EFI_SUCCESS
31 **/
32 EFI_STATUS
33 EFIAPI
34 FfsFindNextFile (
35 IN EFI_FV_FILETYPE SearchType,
36 IN EFI_FIRMWARE_VOLUME_HEADER *FwVolHeader,
37 IN OUT EFI_FFS_FILE_HEADER **FileHeader
38 );
39
40 /**
41 Given the input file pointer, search for the next matching section in the
42 FFS volume.
43
44 @param SearchType Filter to find only sections of this type.
45 @param FfsFileHeader Pointer to the current file to search.
46 @param SectionHeader Pointer to the Section matching SectionType in FfsFileHeader.
47 NULL if section not found
48
49 @retval EFI_NOT_FOUND No files matching the search criteria were found
50 @retval EFI_SUCCESS
51 **/
52 EFI_STATUS
53 EFIAPI
54 FfsFindSection (
55 IN EFI_SECTION_TYPE SectionType,
56 IN EFI_FFS_FILE_HEADER *FfsFileHeader,
57 IN OUT EFI_COMMON_SECTION_HEADER **SectionHeader
58 );
59
60 /**
61 Locates a section within a series of sections
62 with the specified section type.
63
64 @param[in] Sections The sections to search
65 @param[in] SizeOfSections Total size of all sections
66 @param[in] SectionType The section type to locate
67 @param[out] FoundSection The FFS section if found
68
69 @retval EFI_SUCCESS The file and section was found
70 @retval EFI_NOT_FOUND The file and section was not found
71 @retval EFI_VOLUME_CORRUPTED The firmware volume was corrupted
72 **/
73 EFI_STATUS
74 EFIAPI
75 FindFfsSectionInSections (
76 IN VOID *Sections,
77 IN UINTN SizeOfSections,
78 IN EFI_SECTION_TYPE SectionType,
79 OUT EFI_COMMON_SECTION_HEADER **FoundSection
80 );
81
82 /**
83 Given the input file pointer, search for the next matching section in the
84 FFS volume.
85
86 @param SearchType Filter to find only sections of this type.
87 @param FfsFileHeader Pointer to the current file to search.
88 @param SectionData Pointer to the Section matching SectionType in FfsFileHeader.
89 NULL if section not found
90 @param SectionDataSize The size of SectionData
91
92 @retval EFI_NOT_FOUND No files matching the search criteria were found
93 @retval EFI_SUCCESS
94 **/
95 EFI_STATUS
96 EFIAPI
97 FfsFindSectionData (
98 IN EFI_SECTION_TYPE SectionType,
99 IN EFI_FFS_FILE_HEADER *FfsFileHeader,
100 OUT VOID **SectionData,
101 OUT UINTN *SectionDataSize
102 );
103
104 #endif