summaryrefslogtreecommitdiff
path: root/EdkModulePkg
diff options
context:
space:
mode:
authorlgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524>2006-11-21 03:01:52 +0000
committerlgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524>2006-11-21 03:01:52 +0000
commit25549f698d796b649ff501cf810d592868bb4ec2 (patch)
tree513a45c22259edaff6aabfbd604e323d72b7141a /EdkModulePkg
parent4c50c885441c6406bb8a82f8b4e6106ce0706544 (diff)
downloadedk2-platforms-25549f698d796b649ff501cf810d592868bb4ec2.tar.xz
Use global variable gInMemory in place of gInMemoryGuid ppi in DxeIplX64 module to point this module is shadowed or not for size reduction.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1987 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'EdkModulePkg')
-rw-r--r--EdkModulePkg/Core/DxeIplX64Peim/DxeIplX64.msa3
-rw-r--r--EdkModulePkg/Core/DxeIplX64Peim/DxeLoadX64.c30
2 files changed, 4 insertions, 29 deletions
diff --git a/EdkModulePkg/Core/DxeIplX64Peim/DxeIplX64.msa b/EdkModulePkg/Core/DxeIplX64Peim/DxeIplX64.msa
index d6e1057785..d9fcb9d373 100644
--- a/EdkModulePkg/Core/DxeIplX64Peim/DxeIplX64.msa
+++ b/EdkModulePkg/Core/DxeIplX64Peim/DxeIplX64.msa
@@ -116,9 +116,6 @@
<Ppi Usage="SOMETIMES_CONSUMED">
<PpiCName>gEfiPeiSecurityPpiGuid</PpiCName>
</Ppi>
- <Ppi Usage="PRIVATE">
- <PpiCName>gPeiInMemoryGuid</PpiCName>
- </Ppi>
</PPIs>
<Guids>
<GuidCNames Usage="ALWAYS_CONSUMED">
diff --git a/EdkModulePkg/Core/DxeIplX64Peim/DxeLoadX64.c b/EdkModulePkg/Core/DxeIplX64Peim/DxeLoadX64.c
index 990eec164c..57ffb28f4a 100644
--- a/EdkModulePkg/Core/DxeIplX64Peim/DxeLoadX64.c
+++ b/EdkModulePkg/Core/DxeIplX64Peim/DxeLoadX64.c
@@ -52,12 +52,6 @@ static EFI_PEI_PPI_DESCRIPTOR mPpiList = {
&mDxeIplPpi
};
-static EFI_PEI_PPI_DESCRIPTOR mPpiPeiInMemory = {
- (EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST),
- &gPeiInMemoryGuid,
- NULL
-};
-
static EFI_PEI_PPI_DESCRIPTOR mPpiSignal = {
(EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST),
&gEfiEndOfPeiSignalPpiGuid,
@@ -127,14 +121,7 @@ Returns:
ASSERT_EFI_ERROR (Status);
- Status = PeiServicesLocatePpi (
- &gPeiInMemoryGuid,
- 0,
- NULL,
- NULL
- );
-
- if (EFI_ERROR (Status) && (BootMode != BOOT_ON_S3_RESUME)) {
+ if (!gInMemory && (BootMode != BOOT_ON_S3_RESUME)) {
//
// The DxeIpl has not yet been shadowed
//
@@ -150,10 +137,6 @@ Returns:
} else {
if (BootMode != BOOT_ON_S3_RESUME) {
- //
- // The DxeIpl has been shadowed
- //
- gInMemory = TRUE;
//
// Install LoadFile PPI
@@ -167,7 +150,7 @@ Returns:
//
// Install DxeIpl PPI
//
- PeiServicesInstallPpi (&mPpiList);
+ Status = PeiServicesInstallPpi (&mPpiList);
if (EFI_ERROR (Status)) {
return Status;
@@ -620,14 +603,9 @@ Returns:
if (Status == EFI_SUCCESS) {
//
- // Install PeiInMemory to indicate the Dxeipl is shadowed
+ // Set gInMemory global variable to TRUE to indicate the dxeipl is shadowed.
//
- Status = PeiServicesInstallPpi (&mPpiPeiInMemory);
-
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
+ *(BOOLEAN *) ((UINTN) &gInMemory + (UINTN) DxeIplEntryPoint - (UINTN) _ModuleEntryPoint) = TRUE;
Status = ((EFI_PEIM_ENTRY_POINT) (UINTN) DxeIplEntryPoint) (DxeIplFileHeader, GetPeiServicesTablePointer());
}