]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Core/DxeIplPeim/Ia32/DxeLoadFunc.c
Update to fix minor coding style issues.
[mirror_edk2.git] / MdeModulePkg / Core / DxeIplPeim / Ia32 / DxeLoadFunc.c
index bdece76187d78d49fe9e4c2a250e65931ae21396..7dfb3407b4deaccff5a834d9c0079f816bbe5cd9 100644 (file)
@@ -1,6 +1,7 @@
-/*++\r
+/** @file\r
+  Ia32-specifc functionality for DxeLoad.\r
 \r
-Copyright (c) 2006, Intel Corporation\r
+Copyright (c) 2006 - 2008, Intel Corporation. <BR>\r
 All rights reserved. This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -9,15 +10,7 @@ http://opensource.org/licenses/bsd-license.php
 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
 \r
-Module Name:\r
-\r
-  DxeLoadFunc.c\r
-\r
-Abstract:\r
-\r
-  Ia32-specifc functionality for DxeLoad.\r
-\r
---*/\r
+**/\r
 \r
 #include "DxeIpl.h"\r
 #include "VirtualMemory.h"\r
@@ -51,6 +44,22 @@ GLOBAL_REMOVE_IF_UNREFERENCED  IA32_DESCRIPTOR gLidtDescriptor = {
   0\r
 };\r
 \r
+\r
+\r
+\r
+\r
+/**\r
+   Transfers control to DxeCore.\r
+\r
+   This function performs a CPU architecture specific operations to execute\r
+   the entry point of DxeCore with the parameters of HobList.\r
+   It also intalls EFI_END_OF_PEI_PPI to signal the end of PEI phase.\r
+\r
+   @param DxeCoreEntryPoint         The entrypoint of DxeCore.\r
+   @param HobList                   The start of HobList passed to DxeCore.\r
+   @param EndOfPeiSignal            The PPI descriptor for EFI_END_OF_PEI_PPI.\r
+\r
+**/\r
 VOID\r
 HandOffToDxeCore (\r
   IN EFI_PHYSICAL_ADDRESS   DxeCoreEntryPoint,\r
@@ -106,6 +115,10 @@ HandOffToDxeCore (
     \r
     AsmWriteCr3 (PageTables);\r
 \r
+    //\r
+    // Update the contents of BSP stack HOB to reflect the real stack info passed to DxeCore.\r
+    //    \r
+    UpdateStackHob (BaseOfStack, STACK_SIZE);\r
 \r
     if (FeaturePcdGet (PcdDxeIplEnableIdt)) {\r
       SizeOfTemplate = AsmGetVectorTemplatInfo (&TemplateBase);\r
@@ -125,8 +138,8 @@ HandOffToDxeCore (
         IdtTable[Index].Ia32IdtEntry.Bits.Selector    =  SYS_CODE64_SEL;\r
   \r
         IdtTable[Index].Ia32IdtEntry.Bits.OffsetLow   = (UINT16) VectorAddress;\r
-        IdtTable[Index].Ia32IdtEntry.Bits.OffsetHigh  = (UINT16) (VectorAddress >> 16);\r
-        IdtTable[Index].Offset32To63                  = (UINT32) (VectorAddress >> 32);\r
+        IdtTable[Index].Ia32IdtEntry.Bits.OffsetHigh  = (UINT16) (RShiftU64 (VectorAddress, 16));\r
+        IdtTable[Index].Offset32To63                  = (UINT32) (RShiftU64 (VectorAddress, 32));\r
         IdtTable[Index].Reserved                      = 0;\r
   \r
         CopyMem ((VOID *) (UINTN) VectorAddress, TemplateBase, SizeOfTemplate);\r
@@ -163,6 +176,11 @@ HandOffToDxeCore (
     Status = PeiServicesInstallPpi (EndOfPeiSignal);\r
     ASSERT_EFI_ERROR (Status);\r
 \r
+    //\r
+    // Update the contents of BSP stack HOB to reflect the real stack info passed to DxeCore.\r
+    //    \r
+    UpdateStackHob (BaseOfStack, STACK_SIZE);\r
+\r
     SwitchStack (\r
       (SWITCH_STACK_ENTRY_POINT)(UINTN)DxeCoreEntryPoint,\r
       HobList.Raw,\r