]> git.proxmox.com Git - mirror_edk2.git/blame - EdkModulePkg/Core/DxeIplPeim/DxeIpl.h
Introduce PcdDxeIplSwitchToLongMode to DxeIplPeim and remove DxeIplX64Peim.
[mirror_edk2.git] / EdkModulePkg / Core / DxeIplPeim / DxeIpl.h
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 DxeIpl.h\r
15\r
16Abstract:\r
17\r
18--*/\r
19\r
20#ifndef __PEI_DXEIPL_H__\r
21#define __PEI_DXEIPL_H__\r
22\r
23#define STACK_SIZE 0x20000\r
24#define BSP_STORE_SIZE 0x4000\r
25\r
abb26634 26#define GET_OCCUPIED_SIZE(ActualSize, Alignment) ((ActualSize + (Alignment - 1)) & ~(Alignment - 1))\r
27\r
878ddf1f 28extern BOOLEAN gInMemory;\r
29\r
eeb1cd5a 30/**\r
31 Transfers control to a function starting with a new stack.\r
32\r
33 Transfers control to the function specified by EntryPoint using the new stack\r
34 specified by NewStack and passing in the parameters specified by Context1 and\r
35 Context2. Context1 and Context2 are optional and may be NULL. The function\r
36 EntryPoint must never return.\r
37\r
38 If EntryPoint is NULL, then ASSERT().\r
39 If NewStack is NULL, then ASSERT().\r
40\r
41 @param EntryPoint A pointer to function to call with the new stack.\r
42 @param Context1 A pointer to the context to pass into the EntryPoint\r
43 function.\r
44 @param Context2 A pointer to the context to pass into the EntryPoint\r
45 function.\r
46 @param NewStack A pointer to the new stack to use for the EntryPoint\r
47 function.\r
48 @param NewBsp A pointer to the new BSP for the EntryPoint on IPF. It's\r
49 Reserved on other architectures.\r
50\r
51**/\r
878ddf1f 52VOID\r
eeb1cd5a 53EFIAPI\r
878ddf1f 54SwitchIplStacks (\r
eeb1cd5a 55 IN SWITCH_STACK_ENTRY_POINT EntryPoint,\r
56 IN VOID *Context1, OPTIONAL\r
57 IN VOID *Context2, OPTIONAL\r
58 IN VOID *NewStack,\r
59 IN VOID *NewBsp\r
60 );\r
878ddf1f 61\r
62EFI_STATUS\r
63PeiFindFile (\r
64 IN UINT8 Type,\r
65 IN UINT16 SectionType,\r
66 OUT EFI_GUID *FileName,\r
67 OUT VOID **Pe32Data\r
68 )\r
69;\r
70\r
71EFI_STATUS\r
72PeiLoadFile (\r
73 IN EFI_PEI_PE_COFF_LOADER_PROTOCOL *PeiEfiPeiPeCoffLoader,\r
74 IN VOID *Pe32Data,\r
75 OUT EFI_PHYSICAL_ADDRESS *ImageAddress,\r
76 OUT UINT64 *ImageSize,\r
77 OUT EFI_PHYSICAL_ADDRESS *EntryPoint\r
78 )\r
79;\r
80\r
81\r
82EFI_STATUS\r
83CreateArchSpecificHobs (\r
84 OUT EFI_PHYSICAL_ADDRESS *BspStore\r
85 )\r
86;\r
87\r
88EFI_STATUS\r
89GetImageReadFunction (\r
90 IN PE_COFF_LOADER_IMAGE_CONTEXT *ImageContext\r
91 )\r
92;\r
93\r
94EFI_STATUS\r
95PeiImageRead (\r
96 IN VOID *FileHandle,\r
97 IN UINTN FileOffset,\r
98 IN OUT UINTN *ReadSize,\r
99 OUT VOID *Buffer\r
100 )\r
101;\r
102\r
103EFI_STATUS\r
104EFIAPI\r
105DxeIplLoadFile (\r
106 IN EFI_PEI_FV_FILE_LOADER_PPI *This,\r
107 IN EFI_FFS_FILE_HEADER *FfsHeader,\r
108 OUT EFI_PHYSICAL_ADDRESS *ImageAddress,\r
109 OUT UINT64 *ImageSize,\r
110 OUT EFI_PHYSICAL_ADDRESS *EntryPoint\r
111 );\r
112\r
113EFI_STATUS\r
114ShadowDxeIpl (\r
115 IN EFI_FFS_FILE_HEADER *DxeIpl,\r
116 IN EFI_PEI_PE_COFF_LOADER_PROTOCOL *PeiEfiPeiPeCoffLoader\r
117 );\r
118\r
119EFI_STATUS\r
120EFIAPI\r
121DxeLoadCore (\r
122 IN EFI_DXE_IPL_PPI *This,\r
123 IN EFI_PEI_SERVICES **PeiServices,\r
124 IN EFI_PEI_HOB_POINTERS HobList\r
125 );\r
126\r
127EFI_STATUS\r
128PeiProcessFile (\r
6326ee4e 129 IN UINT16 SectionType,\r
abb26634 130 IN EFI_FFS_FILE_HEADER *FfsFileHeader,\r
131 OUT VOID **Pe32Data,\r
132 IN EFI_PEI_HOB_POINTERS *OrigHob\r
878ddf1f 133 );\r
134\r
135EFI_STATUS\r
136EFIAPI\r
137PeimInitializeDxeIpl (\r
138 IN EFI_FFS_FILE_HEADER *FfsHeader,\r
139 IN EFI_PEI_SERVICES **PeiServices\r
140 );\r
141\r
142EFI_STATUS\r
143PeiLoadx64File (\r
144 IN EFI_PEI_PE_COFF_LOADER_PROTOCOL *PeiEfiPeiPeCoffLoader,\r
145 IN VOID *Pe32Data,\r
146 IN EFI_MEMORY_TYPE MemoryType,\r
147 OUT EFI_PHYSICAL_ADDRESS *ImageAddress,\r
148 OUT UINT64 *ImageSize,\r
149 OUT EFI_PHYSICAL_ADDRESS *EntryPoint\r
150 )\r
151;\r
152\r
153EFI_PHYSICAL_ADDRESS\r
154CreateIdentityMappingPageTables (\r
155 IN UINT32 NumberOfProcessorPhysicalAddressBits\r
156 )\r
157;\r
158\r
159VOID\r
160ActivateLongMode (\r
eeb1cd5a 161 IN EFI_PHYSICAL_ADDRESS PageTables,\r
878ddf1f 162 IN EFI_PHYSICAL_ADDRESS HobStart,\r
163 IN EFI_PHYSICAL_ADDRESS Stack,\r
164 IN EFI_PHYSICAL_ADDRESS CodeEntryPoint1,\r
165 IN EFI_PHYSICAL_ADDRESS CodeEntryPoint2\r
166 );\r
167\r
168VOID\r
169LoadGo64Gdt();\r
170\r
171#endif\r