From 6d9a0f280d49fd1000fa685ee1392f45ff998e69 Mon Sep 17 00:00:00 2001 From: lgao4 Date: Mon, 26 Oct 2009 09:14:47 +0000 Subject: [PATCH] Update comments on setting >= 8 bytes Fv Alignment. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9372 6f19259b-4bc3-4df7-8a09-765794883524 --- MdeModulePkg/Core/Dxe/Dispatcher/Dispatcher.c | 5 ++++- MdeModulePkg/Core/Dxe/FwVolBlock/FwVolBlock.c | 3 +++ MdeModulePkg/Core/Pei/FwVol/FwVol.c | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/MdeModulePkg/Core/Dxe/Dispatcher/Dispatcher.c b/MdeModulePkg/Core/Dxe/Dispatcher/Dispatcher.c index 7e6ddce77a..6a18fe909e 100644 --- a/MdeModulePkg/Core/Dxe/Dispatcher/Dispatcher.c +++ b/MdeModulePkg/Core/Dxe/Dispatcher/Dispatcher.c @@ -845,9 +845,12 @@ CoreProcessFvImageFile ( // FvImage should be at its required alignment. // FvHeader = (EFI_FIRMWARE_VOLUME_HEADER *) Buffer; + // + // Get FvHeader alignment + // FvAlignment = 1 << ((FvHeader->Attributes & EFI_FVB2_ALIGNMENT) >> 16); // - // FvAlignment must be more than 8 bytes required by FvHeader structure. + // FvAlignment must be greater than or equal to 8 bytes of the minimum FFS alignment value. // if (FvAlignment < 8) { FvAlignment = 8; diff --git a/MdeModulePkg/Core/Dxe/FwVolBlock/FwVolBlock.c b/MdeModulePkg/Core/Dxe/FwVolBlock/FwVolBlock.c index 9b7b166a99..5a3b243af7 100644 --- a/MdeModulePkg/Core/Dxe/FwVolBlock/FwVolBlock.c +++ b/MdeModulePkg/Core/Dxe/FwVolBlock/FwVolBlock.c @@ -450,6 +450,9 @@ ProduceFVBProtocolOnBuffer ( // Get FvHeader alignment // FvAlignment = 1 << ((FwVolHeader->Attributes & EFI_FVB2_ALIGNMENT) >> 16); + // + // FvAlignment must be greater than or equal to 8 bytes of the minimum FFS alignment value. + // if (FvAlignment < 8) { FvAlignment = 8; } diff --git a/MdeModulePkg/Core/Pei/FwVol/FwVol.c b/MdeModulePkg/Core/Pei/FwVol/FwVol.c index 54501f5057..a86e4e5578 100644 --- a/MdeModulePkg/Core/Pei/FwVol/FwVol.c +++ b/MdeModulePkg/Core/Pei/FwVol/FwVol.c @@ -893,7 +893,7 @@ ProcessFvFile ( ASSERT_EFI_ERROR (Status); // - // FvAlignment must be more than 8 bytes required by FvHeader structure. + // FvAlignment must be greater than or equal to 8 bytes of the minimum FFS alignment value. // FvAlignment = 1 << ((FvImageInfo.FvAttributes & EFI_FVB2_ALIGNMENT) >> 16); if (FvAlignment < 8) { -- 2.39.2