summaryrefslogtreecommitdiffstats
path: root/MdeModulePkg/Core/Pei
diff options
context:
space:
mode:
authorStar Zeng <star.zeng@intel.com>2017-09-21 18:07:11 +0800
committerStar Zeng <star.zeng@intel.com>2017-09-26 18:01:03 +0800
commite411f8ca3845aafacefe88321fdde340c88c1beb (patch)
tree6015429aa736e0521a60cff15a08052d0a87a107 /MdeModulePkg/Core/Pei
parentc8a9f0693aa9042eed73aec7acbdd926e583dea2 (diff)
downloadedk2-e411f8ca3845aafacefe88321fdde340c88c1beb.tar.gz
edk2-e411f8ca3845aafacefe88321fdde340c88c1beb.tar.bz2
edk2-e411f8ca3845aafacefe88321fdde340c88c1beb.zip
MdeModulePkg Core: Support FFS_ATTRIB_DATA_ALIGNMENT_2
Follow PI 1.6 spec to support FFS_ATTRIB_DATA_ALIGNMENT_2 for FFS alignment extended to support maximum 16MB. Cc: Liming Gao <liming.gao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
Diffstat (limited to 'MdeModulePkg/Core/Pei')
-rw-r--r--MdeModulePkg/Core/Pei/FwVol/FwVol.c35
1 files changed, 24 insertions, 11 deletions
diff --git a/MdeModulePkg/Core/Pei/FwVol/FwVol.c b/MdeModulePkg/Core/Pei/FwVol/FwVol.c
index 0bbb86d958..c90a70b5f7 100644
--- a/MdeModulePkg/Core/Pei/FwVol/FwVol.c
+++ b/MdeModulePkg/Core/Pei/FwVol/FwVol.c
@@ -75,18 +75,27 @@ EFI_PEI_PPI_DESCRIPTOR mPeiFfs3FvPpiList = {
};
/**
-Required Alignment Alignment Value in FFS Alignment Value in
-(bytes) Attributes Field Firmware Volume Interfaces
-1 0 0
-16 1 4
-128 2 7
-512 3 9
-1 KB 4 10
-4 KB 5 12
-32 KB 6 15
-64 KB 7 16
+Required Alignment Alignment Value in FFS FFS_ATTRIB_DATA_ALIGNMENT2 Alignment Value in
+(bytes) Attributes Field in FFS Attributes Field Firmware Volume Interfaces
+1 0 0 0
+16 1 0 4
+128 2 0 7
+512 3 0 9
+1 KB 4 0 10
+4 KB 5 0 12
+32 KB 6 0 15
+64 KB 7 0 16
+128 KB 0 1 17
+256 KB 1 1 18
+512 KB 2 1 19
+1 MB 3 1 20
+2 MB 4 1 21
+4 MB 5 1 22
+8 MB 6 1 23
+16 MB 7 1 24
**/
UINT8 mFvAttributes[] = {0, 4, 7, 9, 10, 12, 15, 16};
+UINT8 mFvAttributes2[] = {17, 18, 19, 20, 21, 22, 23, 24};
/**
Convert the FFS File Attributes to FV File Attributes
@@ -107,7 +116,11 @@ FfsAttributes2FvFileAttributes (
DataAlignment = (UINT8) ((FfsAttributes & FFS_ATTRIB_DATA_ALIGNMENT) >> 3);
ASSERT (DataAlignment < 8);
- FileAttribute = (EFI_FV_FILE_ATTRIBUTES) mFvAttributes[DataAlignment];
+ if ((FfsAttributes & FFS_ATTRIB_DATA_ALIGNMENT_2) != 0) {
+ FileAttribute = (EFI_FV_FILE_ATTRIBUTES) mFvAttributes2[DataAlignment];
+ } else {
+ FileAttribute = (EFI_FV_FILE_ATTRIBUTES) mFvAttributes[DataAlignment];
+ }
if ((FfsAttributes & FFS_ATTRIB_FIXED) == FFS_ATTRIB_FIXED) {
FileAttribute |= EFI_FV_FILE_ATTRIB_FIXED;