]> git.proxmox.com Git - mirror_edk2.git/blame - EdkModulePkg/Core/DxeIplPeim/Ipf/DxeLoadFunc.c
In original DxeIpl64 PEIM, Creating page table is performed before sending End Of...
[mirror_edk2.git] / EdkModulePkg / Core / DxeIplPeim / Ipf / DxeLoadFunc.c
CommitLineData
878ddf1f 1/*++\r
2\r
eeb1cd5a 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
878ddf1f 11\r
12Module Name:\r
13\r
14 IpfDxeLoad.c\r
15\r
16Abstract:\r
17\r
18 Ipf-specifc functionality for DxeLoad.\r
19\r
20--*/\r
21\r
abb26634 22#include "DxeIpl.h"\r
878ddf1f 23\r
657d3918 24VOID\r
25HandOffToDxeCore (\r
26 IN EFI_PHYSICAL_ADDRESS DxeCoreEntryPoint,\r
3d109491 27 IN EFI_PEI_HOB_POINTERS HobList,\r
28 IN EFI_PEI_PPI_DESCRIPTOR *EndOfPeiSignal\r
878ddf1f 29 )\r
878ddf1f 30{\r
657d3918 31 VOID *BaseOfStack;\r
32 VOID *TopOfStack;\r
33 VOID *BspStore;\r
878ddf1f 34\r
657d3918 35 //\r
36 // Allocate 128KB for the Stack\r
37 //\r
38 BaseOfStack = AllocatePages (EFI_SIZE_TO_PAGES (STACK_SIZE));\r
39 ASSERT (BaseOfStack != NULL);\r
878ddf1f 40\r
41 //\r
42 // Allocate 16KB for the BspStore\r
43 //\r
657d3918 44 BspStore = AllocatePages (EFI_SIZE_TO_PAGES (BSP_STORE_SIZE));\r
45 ASSERT (BspStore != NULL);\r
46 //\r
47 // Build BspStoreHob\r
48 //\r
49 BuildBspStoreHob ((EFI_PHYSICAL_ADDRESS) (UINTN) BspStore, BSP_STORE_SIZE, EfiBootServicesData);\r
eeb1cd5a 50\r
657d3918 51 //\r
52 // Compute the top of the stack we were allocated. Pre-allocate a UINTN\r
53 // for safety.\r
54 //\r
55 TopOfStack = (VOID *) ((UINTN) BaseOfStack + EFI_SIZE_TO_PAGES (STACK_SIZE) * EFI_PAGE_SIZE - CPU_STACK_ALIGNMENT);\r
56 TopOfStack = ALIGN_POINTER (TopOfStack, CPU_STACK_ALIGNMENT);\r
eeb1cd5a 57\r
3d109491 58 //\r
59 // End of PEI phase singal\r
60 //\r
61 Status = PeiServicesInstallPpi (EndOfPeiSignal);\r
62 ASSERT_EFI_ERROR (Status);\r
63\r
eeb1cd5a 64 AsmSwitchStackAndBackingStore (\r
657d3918 65 (SWITCH_STACK_ENTRY_POINT)(UINTN)DxeCoreEntryPoint,\r
66 HobList.Raw,\r
67 NULL,\r
68 TopOfStack,\r
69 BspStore\r
eeb1cd5a 70 );\r
71}\r