StandaloneMmPkg/HobLib: Add HOB Library for management mode.
[mirror_edk2.git] / StandaloneMmPkg / Include / Library / FvLib.h
CommitLineData
e85162ac
SV
1/** @file\r
2\r
3Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>\r
4Copyright (c) 2016 - 2018, ARM Limited. All rights reserved.<BR>\r
5\r
6This program and the accompanying materials\r
7are licensed and made available under the terms and conditions of the BSD License\r
8which accompanies this distribution. The full text of the license may be found at\r
9http://opensource.org/licenses/bsd-license.php\r
10\r
11THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
12WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
13\r
14**/\r
15\r
16#ifndef _FV_LIB_H_\r
17#define _FV_LIB_H_\r
18\r
19#include <Uefi.h>\r
20#include <Pi/PiFirmwareVolume.h>\r
21#include <Pi/PiFirmwareFile.h>\r
22\r
23/**\r
24 Given the input file pointer, search for the next matching file in the\r
25 FFS volume as defined by SearchType. The search starts from FileHeader inside\r
26 the Firmware Volume defined by FwVolHeader.\r
27\r
28 @param SearchType Filter to find only files of this type.\r
29 Type EFI_FV_FILETYPE_ALL causes no filtering to be done.\r
30 @param FwVolHeader Pointer to the FV header of the volume to search.\r
31 This parameter must point to a valid FFS volume.\r
32 @param FileHeader Pointer to the current file from which to begin searching.\r
33 This pointer will be updated upon return to reflect the file found.\r
34\r
35 @retval EFI_NOT_FOUND No files matching the search criteria were found\r
36 @retval EFI_SUCCESS\r
37**/\r
38EFI_STATUS\r
39EFIAPI\r
40FfsFindNextFile (\r
41 IN EFI_FV_FILETYPE SearchType,\r
42 IN EFI_FIRMWARE_VOLUME_HEADER *FwVolHeader,\r
43 IN OUT EFI_FFS_FILE_HEADER **FileHeader\r
44 );\r
45\r
46/**\r
47 Given the input file pointer, search for the next matching section in the\r
48 FFS volume.\r
49\r
50 @param SearchType Filter to find only sections of this type.\r
51 @param FfsFileHeader Pointer to the current file to search.\r
52 @param SectionHeader Pointer to the Section matching SectionType in FfsFileHeader.\r
53 NULL if section not found\r
54\r
55 @retval EFI_NOT_FOUND No files matching the search criteria were found\r
56 @retval EFI_SUCCESS\r
57**/\r
58EFI_STATUS\r
59FfsFindSection (\r
60 IN EFI_SECTION_TYPE SectionType,\r
61 IN EFI_FFS_FILE_HEADER *FfsFileHeader,\r
62 IN OUT EFI_COMMON_SECTION_HEADER **SectionHeader\r
63 );\r
64\r
65/**\r
66 Locates a section within a series of sections\r
67 with the specified section type.\r
68\r
69 @param[in] Sections The sections to search\r
70 @param[in] SizeOfSections Total size of all sections\r
71 @param[in] SectionType The section type to locate\r
72 @param[out] FoundSection The FFS section if found\r
73\r
74 @retval EFI_SUCCESS The file and section was found\r
75 @retval EFI_NOT_FOUND The file and section was not found\r
76 @retval EFI_VOLUME_CORRUPTED The firmware volume was corrupted\r
77**/\r
78EFI_STATUS\r
79EFIAPI\r
80FindFfsSectionInSections (\r
81 IN VOID *Sections,\r
82 IN UINTN SizeOfSections,\r
83 IN EFI_SECTION_TYPE SectionType,\r
84 OUT EFI_COMMON_SECTION_HEADER **FoundSection\r
85 );\r
86\r
87/**\r
88 Given the input file pointer, search for the next matching section in the\r
89 FFS volume.\r
90\r
91 @param SearchType Filter to find only sections of this type.\r
92 @param FfsFileHeader Pointer to the current file to search.\r
93 @param SectionData Pointer to the Section matching SectionType in FfsFileHeader.\r
94 NULL if section not found\r
95 @param SectionDataSize The size of SectionData\r
96\r
97 @retval EFI_NOT_FOUND No files matching the search criteria were found\r
98 @retval EFI_SUCCESS\r
99**/\r
100EFI_STATUS\r
101EFIAPI\r
102FfsFindSectionData (\r
103 IN EFI_SECTION_TYPE SectionType,\r
104 IN EFI_FFS_FILE_HEADER *FfsFileHeader,\r
105 OUT VOID **SectionData,\r
106 OUT UINTN *SectionDataSize\r
107 );\r
108\r
109#endif\r