From b98da1b1f9b726f580d05f8680455122ba924da6 Mon Sep 17 00:00:00 2001 From: qhuang8 Date: Wed, 16 Jul 2008 13:17:50 +0000 Subject: Code Scrub DxeIpl module. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@5502 6f19259b-4bc3-4df7-8a09-765794883524 --- MdeModulePkg/Core/DxeIplPeim/Ia32/DxeLoadFunc.c | 17 ++++++++--------- MdeModulePkg/Core/DxeIplPeim/Ia32/ImageRead.c | 8 +------- 2 files changed, 9 insertions(+), 16 deletions(-) (limited to 'MdeModulePkg/Core/DxeIplPeim/Ia32') diff --git a/MdeModulePkg/Core/DxeIplPeim/Ia32/DxeLoadFunc.c b/MdeModulePkg/Core/DxeIplPeim/Ia32/DxeLoadFunc.c index 7dfb3407b4..4458ddd8ff 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 bca3180aad..a303c90721 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 -- cgit v1.2.3