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