Reviewed-by: Liming Gao <liming....@intel.com>

-----Original Message-----
From: Zeng, Star 
Sent: Friday, August 21, 2015 2:19 PM
To: edk2-devel@lists.01.org
Cc: Gao, Liming
Subject: [PATCH 2/2] MdePkg: Follow PI spec to update ExtendedSize in 
EFI_FFS_FILE_HEADER2

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.

Cc: Liming Gao <liming....@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <star.z...@intel.com>
---
 MdePkg/Include/Pi/PiFirmwareFile.h | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/MdePkg/Include/Pi/PiFirmwareFile.h 
b/MdePkg/Include/Pi/PiFirmwareFile.h
index 1f94429..7343444 100644
--- a/MdePkg/Include/Pi/PiFirmwareFile.h
+++ b/MdePkg/Include/Pi/PiFirmwareFile.h
@@ -1,7 +1,7 @@
 /** @file
   The firmware file related definitions in PI.
 
-Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR>
 This program and the accompanying materials are licensed and made available 
under  the terms and conditions of the BSD License that accompanies this 
distribution.
 The full text of the license may be found at @@ -11,7 +11,7 @@ THE PROGRAM IS 
DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,  WITHOUT WARRANTIES OR 
REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 
   @par Revision Reference:
-  PI Version 1.2.
+  PI Version 1.4.
 
 **/
 
@@ -173,7 +173,7 @@ typedef struct {
   /// If FFS_ATTRIB_LARGE_FILE is set in Attributes, then ExtendedSize exists 
and Size must be set to zero.
   /// If FFS_ATTRIB_LARGE_FILE is not set then EFI_FFS_FILE_HEADER is used.
   ///
-  UINT32                    ExtendedSize;
+  UINT64                    ExtendedSize;
 } EFI_FFS_FILE_HEADER2;
 
 #define IS_FFS_FILE2(FfsFileHeaderPtr) \ @@ -183,7 +183,7 @@ typedef struct {
     ((UINT32) (*((UINT32 *) ((EFI_FFS_FILE_HEADER *) (UINTN) 
FfsFileHeaderPtr)->Size) & 0x00ffffff))
 
 #define FFS_FILE2_SIZE(FfsFileHeaderPtr) \
-    (((EFI_FFS_FILE_HEADER2 *) (UINTN) FfsFileHeaderPtr)->ExtendedSize)
+    ((UINT32) (((EFI_FFS_FILE_HEADER2 *) (UINTN) 
+ FfsFileHeaderPtr)->ExtendedSize))
 
 typedef UINT8 EFI_SECTION_TYPE;
 
--
1.9.5.msysgit.0

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel

Reply via email to