]> git.proxmox.com Git - mirror_edk2.git/blame - BaseTools/Source/C/Common/FvLib.h
BaseTools: Fix compile error on VS2010
[mirror_edk2.git] / BaseTools / Source / C / Common / FvLib.h
CommitLineData
30fdf114 1/** @file\r
97fa0ee9
YL
2These functions assist in parsing and manipulating a Firmware Volume.\r
3 \r
4Copyright (c) 2004 - 2014, Intel Corporation. All rights reserved.<BR>\r
40d841f6 5This program and the accompanying materials \r
30fdf114
LG
6are licensed and made available under the terms and conditions of the BSD License \r
7which accompanies this distribution. The full text of the license may be found at \r
8http://opensource.org/licenses/bsd-license.php \r
9 \r
10THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
11WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
12\r
30fdf114
LG
13**/\r
14\r
15#ifndef _EFI_FV_LIB_H\r
16#define _EFI_FV_LIB_H\r
17\r
18//\r
19// Include files\r
20//\r
21#include <string.h>\r
22\r
23#include <Common/UefiBaseTypes.h>\r
24#include <Common/PiFirmwareFile.h>\r
25#include <Common/PiFirmwareVolume.h>\r
26\r
27EFI_STATUS\r
28InitializeFvLib (\r
29 IN VOID *Fv,\r
30 IN UINT32 FvLength\r
31 )\r
32;\r
33\r
34EFI_STATUS\r
35GetFvHeader (\r
36 OUT EFI_FIRMWARE_VOLUME_HEADER **FvHeader,\r
37 OUT UINT32 *FvLength\r
38 )\r
39;\r
40\r
41EFI_STATUS\r
42GetNextFile (\r
43 IN EFI_FFS_FILE_HEADER *CurrentFile,\r
44 OUT EFI_FFS_FILE_HEADER **NextFile\r
45 )\r
46;\r
47\r
48EFI_STATUS\r
49GetFileByName (\r
50 IN EFI_GUID *FileName,\r
51 OUT EFI_FFS_FILE_HEADER **File\r
52 )\r
53;\r
54\r
55EFI_STATUS\r
56GetFileByType (\r
57 IN EFI_FV_FILETYPE FileType,\r
58 IN UINTN Instance,\r
59 OUT EFI_FFS_FILE_HEADER **File\r
60 )\r
61;\r
62\r
63EFI_STATUS\r
64GetSectionByType (\r
65 IN EFI_FFS_FILE_HEADER *File,\r
66 IN EFI_SECTION_TYPE SectionType,\r
67 IN UINTN Instance,\r
68 OUT EFI_FILE_SECTION_POINTER *Section\r
69 )\r
70;\r
71//\r
72// will not parse compressed sections\r
73//\r
74EFI_STATUS\r
75VerifyFv (\r
76 IN EFI_FIRMWARE_VOLUME_HEADER *FvHeader\r
77 )\r
78;\r
79\r
80EFI_STATUS\r
81VerifyFfsFile (\r
82 IN EFI_FFS_FILE_HEADER *FfsHeader\r
83 )\r
84;\r
85\r
e8a47801
LG
86UINT32\r
87GetFfsFileLength (\r
88 EFI_FFS_FILE_HEADER *FfsHeader\r
89 )\r
90;\r
91\r
92UINT32\r
93GetSectionFileLength (\r
94 EFI_COMMON_SECTION_HEADER *SectionHeader\r
95 )\r
96;\r
97\r
98UINT32\r
99GetFfsHeaderLength(\r
100 IN EFI_FFS_FILE_HEADER *FfsHeader\r
101 )\r
102;\r
103\r
104UINT32\r
105GetSectionHeaderLength(\r
106 IN EFI_COMMON_SECTION_HEADER *SectionHeader\r
107 )\r
108;\r
109\r
30fdf114
LG
110/*++\r
111\r
112Routine Description:\r
113\r
114 Verify the current pointer points to a FFS file header.\r
115\r
116Arguments:\r
117\r
118 FfsHeader Pointer to an alleged FFS file.\r
119\r
120Returns:\r
121\r
122 EFI_SUCCESS The Ffs header is valid.\r
123 EFI_NOT_FOUND This "file" is the beginning of free space.\r
124 EFI_VOLUME_CORRUPTED The Ffs header is not valid.\r
125\r
126--*/\r
127UINT32\r
128GetLength (\r
129 UINT8 *ThreeByteLength\r
130 )\r
131;\r
132\r
133/*++\r
134\r
135Routine Description:\r
136\r
137 Converts a three byte length value into a UINT32.\r
138\r
139Arguments:\r
140\r
141 ThreeByteLength Pointer to the first of the 3 byte length.\r
142\r
143Returns:\r
144\r
145 UINT32 Size of the section\r
146\r
147--*/\r
148EFI_STATUS\r
149GetErasePolarity (\r
150 OUT BOOLEAN *ErasePolarity\r
151 )\r
152;\r
153\r
154/*++\r
155\r
156Routine Description:\r
157\r
158 This function returns with the FV erase polarity. If the erase polarity\r
159 for a bit is 1, the function return TRUE.\r
160\r
161Arguments:\r
162\r
163 ErasePolarity A pointer to the erase polarity.\r
164\r
165Returns:\r
166\r
167 EFI_SUCCESS The function completed successfully.\r
168 EFI_INVALID_PARAMETER One of the input parameters was invalid.\r
169\r
170--*/\r
171UINT8\r
172GetFileState (\r
173 IN BOOLEAN ErasePolarity,\r
174 IN EFI_FFS_FILE_HEADER *FfsHeader\r
175 )\r
176;\r
177\r
178/*++\r
179\r
180Routine Description:\r
181\r
182 This function returns a the highest state bit in the FFS that is set.\r
183 It in no way validate the FFS file.\r
184\r
185Arguments:\r
186 \r
187 ErasePolarity The erase polarity for the file state bits.\r
188 FfsHeader Pointer to a FFS file.\r
189\r
190Returns:\r
191\r
192 UINT8 The hightest set state of the file.\r
193\r
194--*/\r
195#endif\r