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