3 Copyright (c) 2004 - 2013, Intel Corporation. All rights reserved.<BR>
4 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
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.
18 These functions assist in parsing and manipulating a Firmware Volume.
30 #include <Common/UefiBaseTypes.h>
31 #include <Common/PiFirmwareFile.h>
32 #include <Common/PiFirmwareVolume.h>
43 OUT EFI_FIRMWARE_VOLUME_HEADER
**FvHeader
,
50 IN EFI_FFS_FILE_HEADER
*CurrentFile
,
51 OUT EFI_FFS_FILE_HEADER
**NextFile
57 IN EFI_GUID
*FileName
,
58 OUT EFI_FFS_FILE_HEADER
**File
64 IN EFI_FV_FILETYPE FileType
,
66 OUT EFI_FFS_FILE_HEADER
**File
72 IN EFI_FFS_FILE_HEADER
*File
,
73 IN EFI_SECTION_TYPE SectionType
,
75 OUT EFI_FILE_SECTION_POINTER
*Section
79 // will not parse compressed sections
83 IN EFI_FIRMWARE_VOLUME_HEADER
*FvHeader
89 IN EFI_FFS_FILE_HEADER
*FfsHeader
95 EFI_FFS_FILE_HEADER
*FfsHeader
100 GetSectionFileLength (
101 EFI_COMMON_SECTION_HEADER
*SectionHeader
107 IN EFI_FFS_FILE_HEADER
*FfsHeader
112 GetSectionHeaderLength(
113 IN EFI_COMMON_SECTION_HEADER
*SectionHeader
121 Verify the current pointer points to a FFS file header.
125 FfsHeader Pointer to an alleged FFS file.
129 EFI_SUCCESS The Ffs header is valid.
130 EFI_NOT_FOUND This "file" is the beginning of free space.
131 EFI_VOLUME_CORRUPTED The Ffs header is not valid.
136 UINT8
*ThreeByteLength
144 Converts a three byte length value into a UINT32.
148 ThreeByteLength Pointer to the first of the 3 byte length.
152 UINT32 Size of the section
157 OUT BOOLEAN
*ErasePolarity
165 This function returns with the FV erase polarity. If the erase polarity
166 for a bit is 1, the function return TRUE.
170 ErasePolarity A pointer to the erase polarity.
174 EFI_SUCCESS The function completed successfully.
175 EFI_INVALID_PARAMETER One of the input parameters was invalid.
180 IN BOOLEAN ErasePolarity
,
181 IN EFI_FFS_FILE_HEADER
*FfsHeader
189 This function returns a the highest state bit in the FFS that is set.
190 It in no way validate the FFS file.
194 ErasePolarity The erase polarity for the file state bits.
195 FfsHeader Pointer to a FFS file.
199 UINT8 The hightest set state of the file.