]> git.proxmox.com Git - mirror_edk2.git/blame - EdkModulePkg/Core/DxeIplPeim/Ipf/DxeLoadFunc.c
set pcd data type to boolean when declaring a FEATURE_FLAG usage typed pcd in package...
[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
24EFI_STATUS\r
25CreateArchSpecificHobs (\r
26 OUT EFI_PHYSICAL_ADDRESS *BspStore\r
27 )\r
28/*++\r
29\r
30Routine Description:\r
31\r
32 Creates architecture-specific HOBs.\r
33\r
34 Note: New parameters should NOT be added for any HOBs that are added to this\r
35 function. BspStore is a special case because it is required for the\r
36 call to SwitchStacks() in DxeLoad().\r
37\r
38Arguments:\r
39\r
40 BspStore - The address of the BSP Store for those architectures that need\r
41 it. Otherwise 0.\r
42\r
43Returns:\r
44\r
45 EFI_SUCCESS - The HOBs were created successfully.\r
46\r
47--*/\r
48{\r
49 EFI_STATUS Status;\r
50\r
eeb1cd5a 51 Status = EFI_SUCCESS;\r
52\r
878ddf1f 53 ASSERT (NULL != BspStore);\r
54\r
55 //\r
56 // Allocate 16KB for the BspStore\r
57 //\r
84a99d48 58 Status = PeiServicesAllocatePages (EfiBootServicesData, EFI_SIZE_TO_PAGES (BSP_STORE_SIZE), BspStore);\r
878ddf1f 59 if (EFI_ERROR (Status)) {\r
60 return Status;\r
61 }\r
62\r
63 BuildBspStoreHob (\r
64 *BspStore,\r
65 BSP_STORE_SIZE,\r
66 EfiBootServicesData\r
67 );\r
68\r
69 return EFI_SUCCESS;\r
70}\r
eeb1cd5a 71\r
72/**\r
73 Transfers control to a function starting with a new stack.\r
74\r
75 Transfers control to the function specified by EntryPoint using the new stack\r
76 specified by NewStack and passing in the parameters specified by Context1 and\r
77 Context2. Context1 and Context2 are optional and may be NULL. The function\r
78 EntryPoint must never return.\r
79\r
80 If EntryPoint is NULL, then ASSERT().\r
81 If NewStack is NULL, then ASSERT().\r
82\r
83 @param EntryPoint A pointer to function to call with the new stack.\r
84 @param Context1 A pointer to the context to pass into the EntryPoint\r
85 function.\r
86 @param Context2 A pointer to the context to pass into the EntryPoint\r
87 function.\r
88 @param NewStack A pointer to the new stack to use for the EntryPoint\r
89 function.\r
90 @param NewBsp A pointer to the new BSP for the EntryPoint on IPF. It's\r
91 Reserved on other architectures.\r
92\r
93**/\r
94VOID\r
95EFIAPI\r
96SwitchIplStacks (\r
97 IN SWITCH_STACK_ENTRY_POINT EntryPoint,\r
98 IN VOID *Context1, OPTIONAL\r
99 IN VOID *Context2, OPTIONAL\r
100 IN VOID *NewStack,\r
101 IN VOID *NewBsp\r
102 )\r
103{\r
104 AsmSwitchStackAndBackingStore (\r
105 EntryPoint,\r
106 Context1,\r
107 Context2,\r
108 NewStack,\r
109 NewBsp\r
110 );\r
111}\r