summaryrefslogtreecommitdiff
path: root/MdeModulePkg/Core/DxeIplPeim
diff options
context:
space:
mode:
authorqhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524>2008-07-16 13:17:50 +0000
committerqhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524>2008-07-16 13:17:50 +0000
commitb98da1b1f9b726f580d05f8680455122ba924da6 (patch)
tree044866ae28f1a5ce4696f75bc350fda37faa3cfb /MdeModulePkg/Core/DxeIplPeim
parentf8ea30263caf89a7ebefa417a642beea3db15ad7 (diff)
downloadedk2-b98da1b1f9b726f580d05f8680455122ba924da6.zip
edk2-b98da1b1f9b726f580d05f8680455122ba924da6.tar.gz
edk2-b98da1b1f9b726f580d05f8680455122ba924da6.tar.bz2
Code Scrub DxeIpl module.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@5502 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg/Core/DxeIplPeim')
-rw-r--r--MdeModulePkg/Core/DxeIplPeim/DxeIpl.h106
-rw-r--r--MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf12
-rw-r--r--MdeModulePkg/Core/DxeIplPeim/DxeLoad.c162
-rw-r--r--MdeModulePkg/Core/DxeIplPeim/Ia32/DxeLoadFunc.c17
-rw-r--r--MdeModulePkg/Core/DxeIplPeim/Ia32/ImageRead.c8
-rw-r--r--MdeModulePkg/Core/DxeIplPeim/Ipf/DxeLoadFunc.c3
-rw-r--r--MdeModulePkg/Core/DxeIplPeim/Ipf/ImageRead.c2
-rw-r--r--MdeModulePkg/Core/DxeIplPeim/X64/DxeLoadFunc.c3
8 files changed, 148 insertions, 165 deletions
diff --git a/MdeModulePkg/Core/DxeIplPeim/DxeIpl.h b/MdeModulePkg/Core/DxeIplPeim/DxeIpl.h
index b046f39..151f28d 100644
--- a/MdeModulePkg/Core/DxeIplPeim/DxeIpl.h
+++ b/MdeModulePkg/Core/DxeIplPeim/DxeIpl.h
@@ -21,10 +21,11 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#include <Ppi/EndOfPeiPhase.h>
#include <Ppi/MemoryDiscovered.h>
#include <Ppi/ReadOnlyVariable2.h>
-#include <Guid/MemoryTypeInformation.h>
#include <Ppi/Decompress.h>
#include <Ppi/FirmwareVolumeInfo.h>
+#include <Ppi/GuidedSectionExtraction.h>
+#include <Guid/MemoryTypeInformation.h>
#include <Guid/MemoryAllocationHob.h>
#include <Guid/FirmwareFileSystem2.h>
@@ -48,13 +49,18 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#define STACK_SIZE 0x20000
#define BSP_STORE_SIZE 0x4000
+
+//
+// This macro aligns the ActualSize with a given alignment and is used to
+// calculate the size an image occupies.
+//
#define GET_OCCUPIED_SIZE(ActualSize, Alignment) ((ActualSize + (Alignment - 1)) & ~(Alignment - 1))
+//
+// Indicate whether DxeIpl has been shadowed to memory.
+//
extern BOOLEAN gInMemory;
-
-
-
/**
Loads and relocates a PE/COFF image into memory.
@@ -109,7 +115,6 @@ GetImageReadFunction (
);
-
/**
Main entry point to last PEIM
@@ -168,7 +173,98 @@ UpdateStackHob (
IN UINT64 Length
);
+/**
+ The ExtractSection() function processes the input section and
+ returns a pointer to the section contents. If the section being
+ extracted does not require processing (if the section
+ GuidedSectionHeader.Attributes has the
+ EFI_GUIDED_SECTION_PROCESSING_REQUIRED field cleared), then
+ OutputBuffer is just updated to point to the start of the
+ section's contents. Otherwise, *Buffer must be allocated
+ from PEI permanent memory.
+
+ @param This Indicates the
+ EFI_PEI_GUIDED_SECTION_EXTRACTION_PPI instance.
+ Buffer containing the input GUIDed section to be
+ processed. OutputBuffer OutputBuffer is
+ allocated from PEI permanent memory and contains
+ the new section stream.
+ @param InputSection A pointer to the input buffer, which contains
+ the input section to be processed.
+ @param OutputBuffer A pointer to a caller-allocated buffer, whose
+ size is specified by the contents of OutputSize.
+ @param OutputSize A pointer to a caller-allocated
+ UINTN in which the size of *OutputBuffer
+ allocation is stored. If the function
+ returns anything other than EFI_SUCCESS,
+ the value of OutputSize is undefined.
+ @param AuthenticationStatus A pointer to a caller-allocated
+ UINT32 that indicates the
+ authentication status of the
+ output buffer. If the input
+ section's GuidedSectionHeader.
+ Attributes field has the
+ EFI_GUIDED_SECTION_AUTH_STATUS_VALID
+ bit as clear,
+ AuthenticationStatus must return
+ zero. These bits reflect the
+ status of the extraction
+ operation. If the function
+ returns anything other than
+ EFI_SUCCESS, the value of
+ AuthenticationStatus is
+ undefined.
+
+ @retval EFI_SUCCESS The InputSection was
+ successfully processed and the
+ section contents were returned.
+
+ @retval EFI_OUT_OF_RESOURCES The system has insufficient
+ resources to process the request.
+
+ @retval EFI_INVALID_PARAMETER The GUID in InputSection does
+ not match this instance of the
+ GUIDed Section Extraction PPI.
+**/
+EFI_STATUS
+CustomGuidedSectionExtract (
+ IN CONST EFI_PEI_GUIDED_SECTION_EXTRACTION_PPI *This,
+ IN CONST VOID *InputSection,
+ OUT VOID **OutputBuffer,
+ OUT UINTN *OutputSize,
+ OUT UINT32 *AuthenticationStatus
+ );
+
+
+/**
+ Decompresses a section to the output buffer.
+
+ This function lookes up the compression type field in the input section and
+ applies the appropriate compression algorithm to compress the section to a
+ callee allocated buffer.
+
+ @param This Points to this instance of the
+ EFI_PEI_DECOMPRESS_PEI PPI.
+ @param CompressionSection Points to the compressed section.
+ @param OutputBuffer Holds the returned pointer to the decompressed
+ sections.
+ @param OutputSize Holds the returned size of the decompress
+ section streams.
+
+ @retval EFI_SUCCESS The section was decompressed successfully.
+ OutputBuffer contains the resulting data and
+ OutputSize contains the resulting size.
+
+**/
+EFI_STATUS
+EFIAPI
+Decompress (
+ IN CONST EFI_PEI_DECOMPRESS_PPI *This,
+ IN CONST EFI_COMPRESSION_SECTION *CompressionSection,
+ OUT VOID **OutputBuffer,
+ OUT UINTN *OutputSize
+ );
/**
Initializes the Dxe Ipl PPI
diff --git a/MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf b/MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf
index 33d9bfc..0e7f382 100644
--- a/MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf
+++ b/MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf
@@ -1,8 +1,9 @@
#/** @file
#
-# Component description file for DxeIpl module
+# Component description file for DxeIpl module
#
-# The responsibility of this module is to load the DXE Core from a Firmware Volume. This implementation i used to load a 32-bit DXE Core.
+# The responsibility of this module is to load the DXE Core from a Firmware Volume.
+# This implementation is used to load a 32-bit DXE Core.
#
# Copyright (c) 2006 - 2008, Intel Corporation. <BR>
# All rights reserved. This program and the accompanying materials
@@ -29,7 +30,7 @@
#
# The following information is for reference only and not required by the build tools.
#
-# VALID_ARCHITECTURES = IA32 X64 IPF EBC
+# VALID_ARCHITECTURES = IA32 X64 IPF
#
[Sources.common]
@@ -52,11 +53,6 @@
Ipf/DxeLoadFunc.c
Ipf/ImageRead.c
-[Sources.EBC]
- X64/DxeLoadFunc.c
- Ia32/ImageRead.c
-
-
[Packages]
MdePkg/MdePkg.dec
MdeModulePkg/MdeModulePkg.dec
diff --git a/MdeModulePkg/Core/DxeIplPeim/DxeLoad.c b/MdeModulePkg/Core/DxeIplPeim/DxeLoad.c
index 3988d9c..3b8245d 100644
--- a/MdeModulePkg/Core/DxeIplPeim/DxeLoad.c
+++ b/MdeModulePkg/Core/DxeIplPeim/DxeLoad.c
@@ -14,123 +14,30 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
#include "DxeIpl.h"
-#include <Ppi/GuidedSectionExtraction.h>
-
-
-
-/**
- The ExtractSection() function processes the input section and
- returns a pointer to the section contents. If the section being
- extracted does not require processing (if the section
- GuidedSectionHeader.Attributes has the
- EFI_GUIDED_SECTION_PROCESSING_REQUIRED field cleared), then
- OutputBuffer is just updated to point to the start of the
- section's contents. Otherwise, *Buffer must be allocated
- from PEI permanent memory.
-
- @param This Indicates the
- EFI_PEI_GUIDED_SECTION_EXTRACTION_PPI instance.
- Buffer containing the input GUIDed section to be
- processed. OutputBuffer OutputBuffer is
- allocated from PEI permanent memory and contains
- the new section stream.
- @param InputSection A pointer to the input buffer, which contains
- the input section to be processed.
- @param OutputBuffer A pointer to a caller-allocated buffer, whose
- size is specified by the contents of OutputSize.
- @param OutputSize A pointer to a caller-allocated
- UINTN in which the size of *OutputBuffer
- allocation is stored. If the function
- returns anything other than EFI_SUCCESS,
- the value of OutputSize is undefined.
- @param AuthenticationStatus A pointer to a caller-allocated
- UINT32 that indicates the
- authentication status of the
- output buffer. If the input
- section's GuidedSectionHeader.
- Attributes field has the
- EFI_GUIDED_SECTION_AUTH_STATUS_VALID
- bit as clear,
- AuthenticationStatus must return
- zero. These bits reflect the
- status of the extraction
- operation. If the function
- returns anything other than
- EFI_SUCCESS, the value of
- AuthenticationStatus is
- undefined.
-
- @retval EFI_SUCCESS The InputSection was
- successfully processed and the
- section contents were returned.
-
- @retval EFI_OUT_OF_RESOURCES The system has insufficient
- resources to process the request.
-
- @retval EFI_INVALID_PARAMETER The GUID in InputSection does
- not match this instance of the
- GUIDed Section Extraction PPI.
-
-**/
-EFI_STATUS
-CustomGuidedSectionExtract (
- IN CONST EFI_PEI_GUIDED_SECTION_EXTRACTION_PPI *This,
- IN CONST VOID *InputSection,
- OUT VOID **OutputBuffer,
- OUT UINTN *OutputSize,
- OUT UINT32 *AuthenticationStatus
-);
-
-
-/**
- Decompresses a section to the output buffer.
-
- This function lookes up the compression type field in the input section and
- applies the appropriate compression algorithm to compress the section to a
- callee allocated buffer.
-
- @param This Points to this instance of the
- EFI_PEI_DECOMPRESS_PEI PPI.
- @param CompressionSection Points to the compressed section.
- @param OutputBuffer Holds the returned pointer to the decompressed
- sections.
- @param OutputSize Holds the returned size of the decompress
- section streams.
-
- @retval EFI_SUCCESS The section was decompressed successfully.
- OutputBuffer contains the resulting data and
- OutputSize contains the resulting size.
-
-**/
-EFI_STATUS
-EFIAPI
-Decompress (
- IN CONST EFI_PEI_DECOMPRESS_PPI *This,
- IN CONST EFI_COMPRESSION_SECTION *CompressionSection,
- OUT VOID **OutputBuffer,
- OUT UINTN *OutputSize
- );
-
+//
+// This global variable indicates whether this module has been shadowed
+// to memory.
+//
BOOLEAN gInMemory = FALSE;
//
// Module Globals used in the DXE to PEI handoff
// These must be module globals, so the stack can be switched
//
-STATIC EFI_DXE_IPL_PPI mDxeIplPpi = {
+CONST EFI_DXE_IPL_PPI mDxeIplPpi = {
DxeLoadCore
};
-STATIC EFI_PEI_GUIDED_SECTION_EXTRACTION_PPI mCustomGuidedSectionExtractionPpi = {
+CONST EFI_PEI_GUIDED_SECTION_EXTRACTION_PPI mCustomGuidedSectionExtractionPpi = {
CustomGuidedSectionExtract
};
-STATIC EFI_PEI_DECOMPRESS_PPI mDecompressPpi = {
+CONST EFI_PEI_DECOMPRESS_PPI mDecompressPpi = {
Decompress
};
-STATIC EFI_PEI_PPI_DESCRIPTOR mPpiList[] = {
+CONST EFI_PEI_PPI_DESCRIPTOR mPpiList[] = {
{
EFI_PEI_PPI_DESCRIPTOR_PPI,
&gEfiDxeIplPpiGuid,
@@ -143,7 +50,7 @@ STATIC EFI_PEI_PPI_DESCRIPTOR mPpiList[] = {
}
};
-STATIC EFI_PEI_PPI_DESCRIPTOR mPpiSignal = {
+CONST EFI_PEI_PPI_DESCRIPTOR mPpiSignal = {
(EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST),
&gEfiEndOfPeiSignalPpiGuid,
NULL
@@ -171,8 +78,7 @@ PeimInitializeDxeIpl (
UINTN ExtractHandlerNumber;
EFI_PEI_PPI_DESCRIPTOR *GuidPpi;
- Status = PeiServicesGetBootMode (&BootMode);
- ASSERT_EFI_ERROR (Status);
+ BootMode = GetBootModeHob ();
if (BootMode != BOOT_ON_S3_RESUME) {
Status = PeiServicesRegisterForShadow (FfsHandle);
@@ -182,9 +88,7 @@ PeimInitializeDxeIpl (
//
return Status;
} else if (Status == EFI_ALREADY_STARTED) {
-
- gInMemory = TRUE;
-
+
//
// Get custom extract guided section method guid list
//
@@ -194,7 +98,6 @@ PeimInitializeDxeIpl (
// Install custom extraction guid ppi
//
if (ExtractHandlerNumber > 0) {
- GuidPpi = NULL;
GuidPpi = (EFI_PEI_PPI_DESCRIPTOR *) AllocatePool (ExtractHandlerNumber * sizeof (EFI_PEI_PPI_DESCRIPTOR));
ASSERT (GuidPpi != NULL);
while (ExtractHandlerNumber-- > 0) {
@@ -220,11 +123,11 @@ PeimInitializeDxeIpl (
}
/**
- Main entry point to last PEIM
+ Main entry point to last PEIM.
- @param This Entry point for DXE IPL PPI
+ @param This Entry point for DXE IPL PPI.
@param PeiServices General purpose services available to every PEIM.
- @param HobList Address to the Pei HOB list
+ @param HobList Address to the Pei HOB list.
@return EFI_SUCCESS DXE core was successfully loaded.
@return EFI_OUT_OF_RESOURCES There are not enough resources to load DXE core.
@@ -252,8 +155,7 @@ DxeLoadCore (
//
// if in S3 Resume, restore configure
//
- Status = PeiServicesGetBootMode (&BootMode);
- ASSERT_EFI_ERROR(Status);
+ BootMode = GetBootModeHob ();
if (BootMode == BOOT_ON_S3_RESUME) {
Status = AcpiS3ResumeOs();
@@ -305,18 +207,17 @@ DxeLoadCore (
Status = DxeIplFindDxeCore (&FileHandle);
ASSERT_EFI_ERROR (Status);
- CopyMem(&DxeCoreFileName, &(((EFI_FFS_FILE_HEADER*)FileHandle)->Name), sizeof (EFI_GUID));
+ CopyGuid(&DxeCoreFileName, &(((EFI_FFS_FILE_HEADER*)FileHandle)->Name));
//
// Load the DXE Core from a Firmware Volume, may use LoadFile ppi to do this for save code size.
//
Status = PeiLoadFile (
- FileHandle,
- &DxeCoreAddress,
- &DxeCoreSize,
- &DxeCoreEntryPoint
- );
-
+ FileHandle,
+ &DxeCoreAddress,
+ &DxeCoreSize,
+ &DxeCoreEntryPoint
+ );
ASSERT_EFI_ERROR (Status);
//
@@ -325,7 +226,7 @@ DxeLoadCore (
BuildModuleHob (
&DxeCoreFileName,
DxeCoreAddress,
- EFI_SIZE_TO_PAGES ((UINT32) DxeCoreSize) * EFI_PAGE_SIZE,
+ EFI_SIZE_TO_PAGES ((UINTN) DxeCoreSize) * EFI_PAGE_SIZE,
DxeCoreEntryPoint
);
@@ -341,15 +242,9 @@ DxeLoadCore (
EFI_IMAGE_OPTIONAL_HEADER_PTR_UNION PtrPeImage;
PtrPeImage.Pe32 = (EFI_IMAGE_NT_HEADERS32 *) ((UINTN) DxeCoreAddress + ((EFI_IMAGE_DOS_HEADER *) (UINTN) DxeCoreAddress)->e_lfanew);
-
- if (PtrPeImage.Pe32->FileHeader.Machine != IMAGE_FILE_MACHINE_IA64) {
- DEBUG ((DEBUG_INFO | DEBUG_LOAD, "Loading DXE CORE at 0x%10p EntryPoint=0x%10p\n", (VOID *)(UINTN)DxeCoreAddress, (VOID *)(UINTN)DxeCoreEntryPoint));
- } else {
- //
- // For IPF Image, the real entry point should be print.
- //
- DEBUG ((DEBUG_INFO | DEBUG_LOAD, "Loading DXE CORE at 0x%10p EntryPoint=0x%10p\n", (VOID *)(UINTN)DxeCoreAddress, (VOID *)(UINTN)(*(UINT64 *)(UINTN)DxeCoreEntryPoint)));
- }
+
+ DEBUG ((DEBUG_INFO | DEBUG_LOAD, "Loading DXE CORE at 0x%10p EntryPoint=0x%10p\n", (VOID *)(UINTN)DxeCoreAddress, FUNCTION_ENTRY_POINT (DxeCoreEntryPoint)));
+
DEBUG_CODE_END ();
//
@@ -406,8 +301,6 @@ DxeIplFindDxeCore (
}
-
-
/**
Loads and relocates a PE/COFF image into memory.
@@ -432,6 +325,7 @@ PeiLoadFile (
EFI_STATUS Status;
PE_COFF_LOADER_IMAGE_CONTEXT ImageContext;
VOID *Pe32Data;
+
//
// First try to find the PE32 section in this ffs file.
//
@@ -440,7 +334,6 @@ PeiLoadFile (
FileHandle,
&Pe32Data
);
-
if (EFI_ERROR (Status)) {
//
// NO image types we support so exit.
@@ -615,7 +508,6 @@ CustomGuidedSectionExtract (
ScratchBuffer,
AuthenticationStatus
);
-
if (EFI_ERROR (Status)) {
//
// Decode failed
@@ -674,7 +566,7 @@ Decompress (
}
Section = (EFI_COMMON_SECTION_HEADER *) CompressionSection;
- SectionLength = *(UINT32 *) (Section->Size) & 0x00ffffff;
+ SectionLength = *(UINT32 *) (Section->Size) & 0x00ffffff;
//
// This is a compression set, expand it
diff --git a/MdeModulePkg/Core/DxeIplPeim/Ia32/DxeLoadFunc.c b/MdeModulePkg/Core/DxeIplPeim/Ia32/DxeLoadFunc.c
index 7dfb340..4458ddd 100644
--- a/MdeModulePkg/Core/DxeIplPeim/Ia32/DxeLoadFunc.c
+++ b/MdeModulePkg/Core/DxeIplPeim/Ia32/DxeLoadFunc.c
@@ -18,7 +18,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
//
// Global Descriptor Table (GDT)
//
-GLOBAL_REMOVE_IF_UNREFERENCED IA32_GDT gGdtEntries [] = {
+GLOBAL_REMOVE_IF_UNREFERENCED IA32_GDT gGdtEntries[] = {
/* selector { Global Segment Descriptor } */
/* 0x00 */ {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}}, //null descriptor
/* 0x08 */ {{0xffff, 0, 0, 0x2, 1, 0, 1, 0xf, 0, 0, 1, 1, 0}}, //linear data segment descriptor
@@ -44,10 +44,6 @@ GLOBAL_REMOVE_IF_UNREFERENCED IA32_DESCRIPTOR gLidtDescriptor = {
0
};
-
-
-
-
/**
Transfers control to DxeCore.
@@ -93,7 +89,7 @@ HandOffToDxeCore (
TopOfStack = BaseOfStack + EFI_SIZE_TO_PAGES (STACK_SIZE) * EFI_PAGE_SIZE - 32;
//
- // X64 Calling Conventions requires that the stack must be aligned to 16 bytes
+ // x64 Calling Conventions requires that the stack must be aligned to 16 bytes
//
TopOfStack = (EFI_PHYSICAL_ADDRESS) (UINTN) ALIGN_POINTER (TopOfStack, 16);
@@ -128,7 +124,6 @@ HandOffToDxeCore (
EFI_SIZE_TO_PAGES((SizeOfTemplate + sizeof (X64_IDT_GATE_DESCRIPTOR)) * 32),
&VectorAddress
);
-
ASSERT_EFI_ERROR (Status);
IdtTable = (X64_IDT_GATE_DESCRIPTOR *) (UINTN) (VectorAddress + SizeOfTemplate * 32);
@@ -152,7 +147,8 @@ HandOffToDxeCore (
AsmWriteIdtr (&gLidtDescriptor);
}
//
- // Go to Long Mode. Interrupts will not get turned on until the CPU AP is loaded.
+ // Go to Long Mode and transfer control to DxeCore.
+ // Interrupts will not get turned on until the CPU AP is loaded.
// Call x64 drivers passing in single argument, a pointer to the HOBs.
//
AsmEnablePaging64 (
@@ -180,7 +176,10 @@ HandOffToDxeCore (
// Update the contents of BSP stack HOB to reflect the real stack info passed to DxeCore.
//
UpdateStackHob (BaseOfStack, STACK_SIZE);
-
+
+ //
+ // Transfer the control to the entry point of DxeCore.
+ //
SwitchStack (
(SWITCH_STACK_ENTRY_POINT)(UINTN)DxeCoreEntryPoint,
HobList.Raw,
diff --git a/MdeModulePkg/Core/DxeIplPeim/Ia32/ImageRead.c b/MdeModulePkg/Core/DxeIplPeim/Ia32/ImageRead.c
index bca3180..a303c90 100644
--- a/MdeModulePkg/Core/DxeIplPeim/Ia32/ImageRead.c
+++ b/MdeModulePkg/Core/DxeIplPeim/Ia32/ImageRead.c
@@ -14,10 +14,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#include "DxeIpl.h"
-
-
-
-
/**
Support routine for the PE/COFF Loader that reads a buffer from a PE/COFF file
@@ -50,8 +46,6 @@ PeiImageRead (
//
// This function assumes 32-bit alignment to increase performance
//
-// ASSERT (ALIGN_POINTER (Destination32, sizeof (UINT32)) == Destination32);
-// ASSERT (ALIGN_POINTER (Source32, sizeof (UINT32)) == Source32);
Length = *ReadSize;
while (Length-- != 0) {
@@ -72,7 +66,7 @@ PeiImageRead (
@param ImageContext A pointer to the structure of
PE_COFF_LOADER_IMAGE_CONTEXT
- @retval EFI_SUCCESS This function always return EFI_SUCCESS.
+ @retval EFI_SUCCESS This function always returns EFI_SUCCESS.
**/
EFI_STATUS
diff --git a/MdeModulePkg/Core/DxeIplPeim/Ipf/DxeLoadFunc.c b/MdeModulePkg/Core/DxeIplPeim/Ipf/DxeLoadFunc.c
index c31cba8..2c94dc7 100644
--- a/MdeModulePkg/Core/DxeIplPeim/Ipf/DxeLoadFunc.c
+++ b/MdeModulePkg/Core/DxeIplPeim/Ipf/DxeLoadFunc.c
@@ -74,6 +74,9 @@ HandOffToDxeCore (
//
UpdateStackHob ((EFI_PHYSICAL_ADDRESS)(UINTN) BaseOfStack, STACK_SIZE);
+ //
+ // Transfer the control to the entry point of DxeCore.
+ //
SwitchStack (
(SWITCH_STACK_ENTRY_POINT)(UINTN)DxeCoreEntryPoint,
HobList.Raw,
diff --git a/MdeModulePkg/Core/DxeIplPeim/Ipf/ImageRead.c b/MdeModulePkg/Core/DxeIplPeim/Ipf/ImageRead.c
index fd82724..c736760 100644
--- a/MdeModulePkg/Core/DxeIplPeim/Ipf/ImageRead.c
+++ b/MdeModulePkg/Core/DxeIplPeim/Ipf/ImageRead.c
@@ -57,7 +57,7 @@ PeiImageRead (
@param ImageContext A pointer to the structure of
PE_COFF_LOADER_IMAGE_CONTEXT
- @retval EFI_SUCCESS This function always return EFI_SUCCESS.
+ @retval EFI_SUCCESS This function always returns EFI_SUCCESS.
**/
EFI_STATUS
diff --git a/MdeModulePkg/Core/DxeIplPeim/X64/DxeLoadFunc.c b/MdeModulePkg/Core/DxeIplPeim/X64/DxeLoadFunc.c
index 4fca3f6..c871dbe 100644
--- a/MdeModulePkg/Core/DxeIplPeim/X64/DxeLoadFunc.c
+++ b/MdeModulePkg/Core/DxeIplPeim/X64/DxeLoadFunc.c
@@ -63,6 +63,9 @@ HandOffToDxeCore (
//
UpdateStackHob ((EFI_PHYSICAL_ADDRESS)(UINTN) BaseOfStack, STACK_SIZE);
+ //
+ // Transfer the control to the entry point of DxeCore.
+ //
SwitchStack (
(SWITCH_STACK_ENTRY_POINT)(UINTN)DxeCoreEntryPoint,
HobList.Raw,