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