/** @file\r
These functions assist in parsing and manipulating a Firmware Volume.\r
\r
-Copyright (c) 2004 - 2014, Intel Corporation. All rights reserved.<BR>\r
-This program and the accompanying materials \r
-are licensed and made available under the terms and conditions of the BSD License \r
-which accompanies this distribution. The full text of the license may be found at \r
-http://opensource.org/licenses/bsd-license.php \r
- \r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+Copyright (c) 2004 - 2018, Intel Corporation. All rights reserved.<BR>\r
+SPDX-License-Identifier: BSD-2-Clause-Patent\r
\r
**/\r
\r
\r
Fv Buffer containing the FV.\r
FvLength Length of the FV\r
- \r
+\r
Returns:\r
- \r
+\r
EFI_SUCCESS Function Completed successfully.\r
EFI_INVALID_PARAMETER A required parameter was NULL.\r
\r
\r
FvHeader Pointer to the FV buffer.\r
FvLength Length of the FV\r
- \r
+\r
Returns:\r
- \r
+\r
EFI_SUCCESS Function Completed successfully.\r
EFI_INVALID_PARAMETER A required parameter was NULL.\r
EFI_ABORTED The library needs to be initialized.\r
Routine Description:\r
\r
This function returns the next file. If the current file is NULL, it returns\r
- the first file in the FV. If the function returns EFI_SUCCESS and the file \r
+ the first file in the FV. If the function returns EFI_SUCCESS and the file\r
pointer is NULL, then there are no more files in the FV.\r
\r
Arguments:\r
\r
CurrentFile Pointer to the current file, must be within the current FV.\r
NextFile Pointer to the next file in the FV.\r
- \r
+\r
Returns:\r
- \r
+\r
EFI_SUCCESS Function completed successfully.\r
EFI_INVALID_PARAMETER A required parameter was NULL or is out of range.\r
EFI_ABORTED The library needs to be initialized.\r
//\r
// Get next file, compensate for 8 byte alignment if necessary.\r
//\r
- *NextFile = (EFI_FFS_FILE_HEADER *) ((((UINTN) CurrentFile - (UINTN) mFvHeader + GetFfsFileLength(CurrentFile) + 0x07) & (-1 << 3)) + (UINT8 *) mFvHeader);\r
+ *NextFile = (EFI_FFS_FILE_HEADER *) ((((UINTN) CurrentFile - (UINTN) mFvHeader + GetFfsFileLength(CurrentFile) + 0x07) & (~(UINTN) 7)) + (UINT8 *) mFvHeader);\r
\r
//\r
// Verify file is in this FV.\r
Arguments:\r
\r
FileType Type of file to search for.\r
- Instance Instace of the file type to return.\r
+ Instance Instance of the file type to return.\r
File Return pointer. In the case of an error, contents are undefined.\r
\r
Returns:\r
//\r
// Find next section (including compensating for alignment issues.\r
//\r
- CurrentSection.CommonHeader = (EFI_COMMON_SECTION_HEADER *) ((((UINTN) CurrentSection.CommonHeader) + GetSectionFileLength(CurrentSection.CommonHeader) + 0x03) & (-1 << 2));\r
+ CurrentSection.CommonHeader = (EFI_COMMON_SECTION_HEADER *) ((((UINTN) CurrentSection.CommonHeader) + GetSectionFileLength(CurrentSection.CommonHeader) + 0x03) & (~(UINTN) 3));\r
}\r
\r
return EFI_NOT_FOUND;\r
\r
Routine Description:\r
\r
- Find a section in a file by type and instance. An instance of 1 is the first \r
+ Find a section in a file by type and instance. An instance of 1 is the first\r
instance. The function will return NULL if a matching section cannot be found.\r
GUID-defined sections, if special processing is not needed, are handled in a\r
depth-first manner.\r
\r
File The file to search.\r
SectionType Type of file to search for.\r
- Instance Instace of the section to return.\r
+ Instance Instance of the section to return.\r
Section Return pointer. In the case of an error, contents are undefined.\r
\r
Returns:\r
// Get the first section\r
//\r
CurrentSection.CommonHeader = (EFI_COMMON_SECTION_HEADER *) ((UINTN) File + GetFfsHeaderLength(File));\r
- \r
+\r
//\r
// Depth-first manner to find section file.\r
//\r
return 0;\r
}\r
if (FfsHeader->Attributes & FFS_ATTRIB_LARGE_FILE) {\r
- return ((EFI_FFS_FILE_HEADER2 *)FfsHeader)->ExtendedSize;\r
+ return (UINT32) ((EFI_FFS_FILE_HEADER2 *)FfsHeader)->ExtendedSize;\r
} else {\r
return GetLength(FfsHeader->Size);\r
}\r
EFI_SUCCESS The function completed successfully.\r
EFI_INVALID_PARAMETER One of the input parameters was invalid.\r
EFI_ABORTED Operation aborted.\r
- \r
+\r
--*/\r
{\r
EFI_STATUS Status;\r
It in no way validate the FFS file.\r
\r
Arguments:\r
- \r
+\r
ErasePolarity The erase polarity for the file state bits.\r
FfsHeader Pointer to a FFS file.\r
\r