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