Revision: 17064
http://sourceforge.net/p/edk2/code/17064
Author: lzeng14
Date: 2015-03-18 08:49:21 +0000 (Wed, 18 Mar 2015)
Log Message:
-----------
EdkCompatibilityPkg: Use ImageContext.ImageSize to allocate memory for PE image
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 <[email protected]>
Reviewed-by: Jiewen Yao <[email protected]>
Modified Paths:
--------------
trunk/edk2/EdkCompatibilityPkg/Compatibility/BootScriptSaveOnS3SaveStateThunk/ScriptSave.c
Modified:
trunk/edk2/EdkCompatibilityPkg/Compatibility/BootScriptSaveOnS3SaveStateThunk/ScriptSave.c
===================================================================
---
trunk/edk2/EdkCompatibilityPkg/Compatibility/BootScriptSaveOnS3SaveStateThunk/ScriptSave.c
2015-03-18 08:47:47 UTC (rev 17063)
+++
trunk/edk2/EdkCompatibilityPkg/Compatibility/BootScriptSaveOnS3SaveStateThunk/ScriptSave.c
2015-03-18 08:49:21 UTC (rev 17064)
@@ -2,7 +2,7 @@
Implementation for S3 Boot Script Save thunk driver.
This thunk driver consumes PI S3SaveState protocol to produce framework
S3BootScriptSave Protocol
- Copyright (c) 2010 - 2014, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2010 - 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
which accompanies this distribution. The full text of the license may be
found at
@@ -899,7 +899,11 @@
ASSERT_EFI_ERROR (Status);
MemoryAddress = SIZE_4GB - 1;
- PageNumber = EFI_SIZE_TO_PAGES (BufferSize +
ImageContext.SectionAlignment);
+ if (ImageContext.SectionAlignment > EFI_PAGE_SIZE) {
+ PageNumber = EFI_SIZE_TO_PAGES (ImageContext.ImageSize +
ImageContext.SectionAlignment);
+ } else {
+ PageNumber = EFI_SIZE_TO_PAGES (ImageContext.ImageSize);
+ }
Status = gBS->AllocatePages (
AllocateMaxAddress,
EfiReservedMemoryType,
------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits