]> git.proxmox.com Git - mirror_edk2.git/blame - Tools/Source/TianoTools/Common/FvLib.h
1. Removed the unnecessary #include statements and include files
[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
28#include <Base.h>\r
29#include <UefiBaseTypes.h>\r
30#include <Common/EfiImage.h>\r
31#include <Common/FirmwareVolumeImageFormat.h>\r
32#include <Common/FirmwareFileSystem.h>\r
33#include <Common/FirmwareVolumeHeader.h>\r
34/*\r
35#include "TianoCommon.h"\r
36#include "EfiFirmwareVolumeHeader.h"\r
37#include "EfiFirmwareFileSystem.h"\r
38*/\r
39#include <string.h>\r
40\r
41EFI_STATUS\r
42InitializeFvLib (\r
43 IN VOID *Fv,\r
44 IN UINT32 FvLength\r
45 )\r
46;\r
47\r
48EFI_STATUS\r
49GetFvHeader (\r
50 OUT EFI_FIRMWARE_VOLUME_HEADER **FvHeader,\r
51 OUT UINT32 *FvLength\r
52 )\r
53;\r
54\r
55EFI_STATUS\r
56GetNextFile (\r
57 IN EFI_FFS_FILE_HEADER *CurrentFile,\r
58 OUT EFI_FFS_FILE_HEADER **NextFile\r
59 )\r
60;\r
61\r
62EFI_STATUS\r
63GetFileByName (\r
64 IN EFI_GUID *FileName,\r
65 OUT EFI_FFS_FILE_HEADER **File\r
66 )\r
67;\r
68\r
69EFI_STATUS\r
70GetFileByType (\r
71 IN EFI_FV_FILETYPE FileType,\r
72 IN UINTN Instance,\r
73 OUT EFI_FFS_FILE_HEADER **File\r
74 )\r
75;\r
76\r
77EFI_STATUS\r
78GetSectionByType (\r
79 IN EFI_FFS_FILE_HEADER *File,\r
80 IN EFI_SECTION_TYPE SectionType,\r
81 IN UINTN Instance,\r
82 OUT EFI_FILE_SECTION_POINTER *Section\r
83 )\r
84;\r
85//\r
86// will not parse compressed sections\r
87//\r
88EFI_STATUS\r
89VerifyFv (\r
90 IN EFI_FIRMWARE_VOLUME_HEADER *FvHeader\r
91 )\r
92;\r
93\r
94EFI_STATUS\r
95VerifyFfsFile (\r
96 IN EFI_FFS_FILE_HEADER *FfsHeader\r
97 )\r
98;\r
99\r
100/*++\r
101\r
102Routine Description:\r
103\r
104 Verify the current pointer points to a FFS file header.\r
105\r
106Arguments:\r
107\r
108 FfsHeader Pointer to an alleged FFS file.\r
109\r
110Returns:\r
111\r
112 EFI_SUCCESS The Ffs header is valid.\r
113 EFI_NOT_FOUND This "file" is the beginning of free space.\r
114 EFI_VOLUME_CORRUPTED The Ffs header is not valid.\r
115\r
116--*/\r
117UINT32\r
118GetLength (\r
119 UINT8 *ThreeByteLength\r
120 )\r
121;\r
122\r
123/*++\r
124\r
125Routine Description:\r
126\r
127 Converts a three byte length value into a UINT32.\r
128\r
129Arguments:\r
130\r
131 ThreeByteLength Pointer to the first of the 3 byte length.\r
132\r
133Returns:\r
134\r
135 UINT32 Size of the section\r
136\r
137--*/\r
138EFI_STATUS\r
139GetErasePolarity (\r
140 OUT BOOLEAN *ErasePolarity\r
141 )\r
142;\r
143\r
144/*++\r
145\r
146Routine Description:\r
147\r
148 This function returns with the FV erase polarity. If the erase polarity\r
149 for a bit is 1, the function return TRUE.\r
150\r
151Arguments:\r
152\r
153 ErasePolarity A pointer to the erase polarity.\r
154\r
155Returns:\r
156\r
157 EFI_SUCCESS The function completed successfully.\r
158 EFI_INVALID_PARAMETER One of the input parameters was invalid.\r
159\r
160--*/\r
161UINT8\r
162GetFileState (\r
163 IN BOOLEAN ErasePolarity,\r
164 IN EFI_FFS_FILE_HEADER *FfsHeader\r
165 )\r
166;\r
167\r
168/*++\r
169\r
170Routine Description:\r
171\r
172 This function returns a the highest state bit in the FFS that is set.\r
173 It in no way validate the FFS file.\r
174\r
175Arguments:\r
176 \r
177 ErasePolarity The erase polarity for the file state bits.\r
178 FfsHeader Pointer to a FFS file.\r
179\r
180Returns:\r
181\r
182 UINT8 The hightest set state of the file.\r
183\r
184--*/\r
185#endif\r