Enable Nt32 platform boot to DXE phase.
[mirror_edk2.git] / MdeModulePkg / Core / DxeIplPeim / X64 / DxeLoadFunc.c
CommitLineData
95276127 1/*++\r
2\r
3Copyright (c) 2006, Intel Corporation\r
4All rights reserved. This program and the accompanying materials\r
5are licensed and made available under the terms and conditions of the BSD License\r
6which accompanies this distribution. The full text of the license may be found at\r
7http://opensource.org/licenses/bsd-license.php\r
8\r
9THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
10WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
11\r
12Module Name:\r
13\r
14 DxeLoadFunc.c\r
15\r
16Abstract:\r
17\r
18 Ia32-specifc functionality for DxeLoad.\r
19\r
20--*/\r
21\r
22//\r
23// Include common header file for this module.\r
24//\r
25#include "CommonHeader.h"\r
26\r
27#include "DxeIpl.h"\r
28\r
29VOID\r
30HandOffToDxeCore (\r
31 IN EFI_PHYSICAL_ADDRESS DxeCoreEntryPoint,\r
32 IN EFI_PEI_HOB_POINTERS HobList,\r
33 IN EFI_PEI_PPI_DESCRIPTOR *EndOfPeiSignal\r
34 )\r
35{\r
36 VOID *BaseOfStack;\r
37 VOID *TopOfStack;\r
38 EFI_STATUS Status;\r
39\r
40 //\r
41 // Allocate 128KB for the Stack\r
42 //\r
43 BaseOfStack = AllocatePages (EFI_SIZE_TO_PAGES (STACK_SIZE));\r
44 ASSERT (BaseOfStack != NULL);\r
45\r
46 //\r
47 // Compute the top of the stack we were allocated. Pre-allocate a UINTN\r
48 // for safety.\r
49 //\r
50 TopOfStack = (VOID *) ((UINTN) BaseOfStack + EFI_SIZE_TO_PAGES (STACK_SIZE) * EFI_PAGE_SIZE - CPU_STACK_ALIGNMENT);\r
51 TopOfStack = ALIGN_POINTER (TopOfStack, CPU_STACK_ALIGNMENT);\r
52\r
53 //\r
54 // End of PEI phase singal\r
55 //\r
56 Status = PeiServicesInstallPpi (EndOfPeiSignal);\r
57 ASSERT_EFI_ERROR (Status);\r
58\r
59 SwitchStack (\r
60 (SWITCH_STACK_ENTRY_POINT)(UINTN)DxeCoreEntryPoint,\r
61 HobList.Raw,\r
62 NULL,\r
63 TopOfStack\r
64 );\r
65}\r