From 25549f698d796b649ff501cf810d592868bb4ec2 Mon Sep 17 00:00:00 2001 From: lgao4 Date: Tue, 21 Nov 2006 03:01:52 +0000 Subject: [PATCH] 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 --- EdkModulePkg/Core/DxeIplX64Peim/DxeIplX64.msa | 3 -- EdkModulePkg/Core/DxeIplX64Peim/DxeLoadX64.c | 30 +++---------------- 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 @@ gEfiPeiSecurityPpiGuid - - gPeiInMemoryGuid - 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()); } -- 2.39.2