to handle the case PE file alignment is not same as PE section alignment.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17063
6f19259b-4bc3-4df7-8a09-
765794883524
This driver is dispatched by Dxe core and the driver will reload itself to ACPI reserved memory\r
in the entry point. The functionality is to interpret and restore the S3 boot script\r
\r
This driver is dispatched by Dxe core and the driver will reload itself to ACPI reserved memory\r
in the entry point. The functionality is to interpret and restore the S3 boot script\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\r
are licensed and made available under the terms and conditions of the BSD License\r
\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
//\r
Status = PeCoffLoaderGetImageInfo (&ImageContext);\r
ASSERT_EFI_ERROR (Status);\r
//\r
Status = PeCoffLoaderGetImageInfo (&ImageContext);\r
ASSERT_EFI_ERROR (Status);\r
- Pages = EFI_SIZE_TO_PAGES(BufferSize + ImageContext.SectionAlignment);\r
+ if (ImageContext.SectionAlignment > EFI_PAGE_SIZE) {\r
+ Pages = EFI_SIZE_TO_PAGES (ImageContext.ImageSize + ImageContext.SectionAlignment);\r
+ } else {\r
+ Pages = EFI_SIZE_TO_PAGES (ImageContext.ImageSize);\r
+ }\r
FfsBuffer = 0xFFFFFFFF;\r
Status = gBS->AllocatePages (\r
AllocateMaxAddress,\r
FfsBuffer = 0xFFFFFFFF;\r
Status = gBS->AllocatePages (\r
AllocateMaxAddress,\r