2 These functions assist in parsing and manipulating a Firmware Volume.
4 Copyright (c) 2004 - 2014, Intel Corporation. All rights reserved.<BR>
5 This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
23 #include <Common/UefiBaseTypes.h>
24 #include <Common/PiFirmwareFile.h>
25 #include <Common/PiFirmwareVolume.h>
36 OUT EFI_FIRMWARE_VOLUME_HEADER
**FvHeader
,
43 IN EFI_FFS_FILE_HEADER
*CurrentFile
,
44 OUT EFI_FFS_FILE_HEADER
**NextFile
50 IN EFI_GUID
*FileName
,
51 OUT EFI_FFS_FILE_HEADER
**File
57 IN EFI_FV_FILETYPE FileType
,
59 OUT EFI_FFS_FILE_HEADER
**File
65 IN EFI_FFS_FILE_HEADER
*File
,
66 IN EFI_SECTION_TYPE SectionType
,
68 OUT EFI_FILE_SECTION_POINTER
*Section
72 // will not parse compressed sections
76 IN EFI_FIRMWARE_VOLUME_HEADER
*FvHeader
82 IN EFI_FFS_FILE_HEADER
*FfsHeader
88 EFI_FFS_FILE_HEADER
*FfsHeader
93 GetSectionFileLength (
94 EFI_COMMON_SECTION_HEADER
*SectionHeader
100 IN EFI_FFS_FILE_HEADER
*FfsHeader
105 GetSectionHeaderLength(
106 IN EFI_COMMON_SECTION_HEADER
*SectionHeader
114 Verify the current pointer points to a FFS file header.
118 FfsHeader Pointer to an alleged FFS file.
122 EFI_SUCCESS The Ffs header is valid.
123 EFI_NOT_FOUND This "file" is the beginning of free space.
124 EFI_VOLUME_CORRUPTED The Ffs header is not valid.
129 UINT8
*ThreeByteLength
137 Converts a three byte length value into a UINT32.
141 ThreeByteLength Pointer to the first of the 3 byte length.
145 UINT32 Size of the section
150 OUT BOOLEAN
*ErasePolarity
158 This function returns with the FV erase polarity. If the erase polarity
159 for a bit is 1, the function return TRUE.
163 ErasePolarity A pointer to the erase polarity.
167 EFI_SUCCESS The function completed successfully.
168 EFI_INVALID_PARAMETER One of the input parameters was invalid.
173 IN BOOLEAN ErasePolarity
,
174 IN EFI_FFS_FILE_HEADER
*FfsHeader
182 This function returns a the highest state bit in the FFS that is set.
183 It in no way validate the FFS file.
187 ErasePolarity The erase polarity for the file state bits.
188 FfsHeader Pointer to a FFS file.
192 UINT8 The hightest set state of the file.