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