]> git.proxmox.com Git - mirror_edk2.git/commitdiff
BaseTools: Follow PI spec to update ExtendedSize in EFI_FFS_FILE_HEADER2
authorStar Zeng <star.zeng@intel.com>
Mon, 24 Aug 2015 01:42:37 +0000 (01:42 +0000)
committerlzeng14 <lzeng14@Edk2>
Mon, 24 Aug 2015 01:42:37 +0000 (01:42 +0000)
for FFS data above 16 bytes alignment requirement.

PI spec requires FFS header to be at 8 bytes alignment to FV header.
And, FFS data alignment requires the beginning of the file data must
be aligned on a particular boundary, such as 1, 16, 128 bytes or above.
If FFS data alignment requires to be above 16 bytes, and FFS header
must be at 8 byte alignment, so FFS header size must be multiple of 8.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18262 6f19259b-4bc3-4df7-8a09-765794883524

BaseTools/Source/C/Common/FirmwareVolumeBuffer.c
BaseTools/Source/C/Common/FvLib.c
BaseTools/Source/C/Include/Common/PiFirmwareFile.h

index 01d4e72a5683d6d386ab33f20366477f0e4367b1..7988d8e43a059a62dfac85d0f4528a153e1f8767 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
 EFI Firmware Volume routines which work on a Fv image in buffers.\r
 \r
-Copyright (c) 1999 - 2014, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 1999 - 2015, 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
@@ -864,7 +864,7 @@ Returns:
     return 0;\r
   }\r
   if (Ffs->Attributes & FFS_ATTRIB_LARGE_FILE) {\r
-    return ((EFI_FFS_FILE_HEADER2 *)Ffs)->ExtendedSize;\r
+    return (UINT32) ((EFI_FFS_FILE_HEADER2 *)Ffs)->ExtendedSize;\r
   }\r
   return FvBufExpand3ByteSize(Ffs->Size);\r
 }\r
index 1b3c08bf161766dd106d27a9a2155acc72f8bb11..938aa098f5642cda2b2281853d4e2a8350fc1b89 100644 (file)
@@ -1,7 +1,7 @@
 /** @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
+Copyright (c) 2004 - 2015, 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
@@ -784,7 +784,7 @@ Returns:
     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
index ec31eab8a88361548a5dcd4f1369cb4db2da4e37..298486023002ec6623b6072739db3af66f301ea5 100644 (file)
@@ -2,9 +2,9 @@
   The firmware file related definitions in PI.\r
   \r
   @par Revision Reference:\r
-  Version 1.0.\r
+  Version 1.4.\r
 \r
-  Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR>\r
 \r
   This program and the accompanying materials are licensed and made available\r
   under the terms and conditions of the BSD License which accompanies this\r
@@ -110,7 +110,7 @@ typedef struct {
   EFI_FFS_FILE_ATTRIBUTES Attributes;\r
   UINT8                   Size[3];\r
   EFI_FFS_FILE_STATE      State;\r
-  UINT32                  ExtendedSize;\r
+  UINT64                  ExtendedSize;\r
 } EFI_FFS_FILE_HEADER2;\r
 \r
 #define MAX_FFS_SIZE        0x1000000\r