]> git.proxmox.com Git - mirror_edk2.git/blob - MdeModulePkg/Core/DxeIplPeim/DxeIpl.h
Add doxygen style comments for functions in DxeIpl.
[mirror_edk2.git] / MdeModulePkg / Core / DxeIplPeim / DxeIpl.h
1 /** @file
2 Master header file for DxeIpl PEIM. All source files in this module should
3 include this file for common defininitions.
4
5 Copyright (c) 2006 - 2008, Intel Corporation. <BR>
6 All rights reserved. This program and the accompanying materials
7 are licensed and made available under the terms and conditions of the BSD License
8 which accompanies this distribution. The full text of the license may be found at
9 http://opensource.org/licenses/bsd-license.php
10
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
13
14 **/
15
16 #ifndef __PEI_DXEIPL_H__
17 #define __PEI_DXEIPL_H__
18
19 #include <PiPei.h>
20 #include <Ppi/DxeIpl.h>
21 #include <Protocol/EdkDecompress.h>
22 #include <Ppi/EndOfPeiPhase.h>
23 #include <Protocol/CustomizedDecompress.h>
24 #include <Protocol/Decompress.h>
25 #include <Ppi/MemoryDiscovered.h>
26 #include <Ppi/ReadOnlyVariable2.h>
27 #include <Guid/MemoryTypeInformation.h>
28 #include <Ppi/Decompress.h>
29 #include <Ppi/FirmwareVolumeInfo.h>
30
31 #include <Guid/MemoryAllocationHob.h>
32 #include <Guid/FirmwareFileSystem2.h>
33
34 #include <Library/DebugLib.h>
35 #include <Library/PeimEntryPoint.h>
36 #include <Library/BaseLib.h>
37 #include <Library/HobLib.h>
38 #include <Library/PeiServicesLib.h>
39 #include <Library/ReportStatusCodeLib.h>
40 #include <Library/CacheMaintenanceLib.h>
41 #include <Library/UefiDecompressLib.h>
42 #include <Library/ExtractGuidedSectionLib.h>
43 #include <Library/PeiServicesTablePointerLib.h>
44 #include <Library/BaseMemoryLib.h>
45 #include <Library/MemoryAllocationLib.h>
46 #include <Library/PcdLib.h>
47 #include <Library/PeCoffLib.h>
48 #include <Library/S3Lib.h>
49 #include <Library/RecoveryLib.h>
50
51 #define STACK_SIZE 0x20000
52 #define BSP_STORE_SIZE 0x4000
53
54 #define GET_OCCUPIED_SIZE(ActualSize, Alignment) ((ActualSize + (Alignment - 1)) & ~(Alignment - 1))
55
56 extern BOOLEAN gInMemory;
57
58
59
60
61 /**
62 Loads and relocates a PE/COFF image into memory.
63
64 @param FileHandle The image file handle
65 @param ImageAddress The base address of the relocated PE/COFF image
66 @param ImageSize The size of the relocated PE/COFF image
67 @param EntryPoint The entry point of the relocated PE/COFF image
68
69 @return EFI_SUCCESS The file was loaded and relocated
70 @return EFI_OUT_OF_RESOURCES There was not enough memory to load and relocate the PE/COFF file
71
72 **/
73 EFI_STATUS
74 PeiLoadFile (
75 IN EFI_PEI_FILE_HANDLE FileHandle,
76 OUT EFI_PHYSICAL_ADDRESS *ImageAddress,
77 OUT UINT64 *ImageSize,
78 OUT EFI_PHYSICAL_ADDRESS *EntryPoint
79 )
80 ;
81
82
83
84 /**
85 Find DxeCore driver from all First Volumes.
86
87 @param FileHandle Pointer to FFS file to search.
88
89 @return EFI_SUCESS Success to find the FFS in specificed FV
90 @return others Fail to find the FFS in specificed FV
91
92 **/
93 EFI_STATUS
94 DxeIplFindDxeCore (
95 OUT EFI_PEI_FILE_HANDLE *FileHandle
96 )
97 ;
98
99
100
101 /**
102 This function simply retrieves the function pointer of ImageRead in
103 ImageContext structure.
104
105 @param ImageContext A pointer to the structure of
106 PE_COFF_LOADER_IMAGE_CONTEXT
107
108 @retval EFI_SUCCESS This function always return EFI_SUCCESS.
109
110 **/
111 EFI_STATUS
112 GetImageReadFunction (
113 IN PE_COFF_LOADER_IMAGE_CONTEXT *ImageContext
114 )
115 ;
116
117
118
119 /**
120 Main entry point to last PEIM
121
122 @param This Entry point for DXE IPL PPI
123 @param PeiServices General purpose services available to every PEIM.
124 @param HobList Address to the Pei HOB list
125
126 @return EFI_SUCCESS DXE core was successfully loaded.
127 @return EFI_OUT_OF_RESOURCES There are not enough resources to load DXE core.
128
129 **/
130 EFI_STATUS
131 EFIAPI
132 DxeLoadCore (
133 IN EFI_DXE_IPL_PPI *This,
134 IN EFI_PEI_SERVICES **PeiServices,
135 IN EFI_PEI_HOB_POINTERS HobList
136 );
137
138
139
140 /**
141 Transfers control to DxeCore.
142
143 This function performs a CPU architecture specific operations to execute
144 the entry point of DxeCore with the parameters of HobList.
145 It also intalls EFI_END_OF_PEI_PPI to signal the end of PEI phase.
146
147 @param DxeCoreEntryPoint The entrypoint of DxeCore.
148 @param HobList The start of HobList passed to DxeCore.
149 @param EndOfPeiSignal The PPI descriptor for EFI_END_OF_PEI_PPI.
150
151 **/
152 VOID
153 HandOffToDxeCore (
154 IN EFI_PHYSICAL_ADDRESS DxeCoreEntryPoint,
155 IN EFI_PEI_HOB_POINTERS HobList,
156 IN EFI_PEI_PPI_DESCRIPTOR *EndOfPeiSignal
157 );
158
159
160
161 /**
162 Updates the Stack HOB passed to DXE phase.
163
164 This function traverses the whole HOB list and update the stack HOB to
165 reflect the real stack that is used by DXE core.
166
167 @param BaseAddress The lower address of stack used by DxeCore.
168 @param Length The length of stack used by DxeCore.
169
170 **/
171 VOID
172 UpdateStackHob (
173 IN EFI_PHYSICAL_ADDRESS BaseAddress,
174 IN UINT64 Length
175 );
176
177
178
179 /**
180 Initializes the Dxe Ipl PPI
181
182 @param FfsHandle The handle of FFS file.
183 @param PeiServices General purpose services available to
184 every PEIM.
185 @return EFI_SUCESS
186
187 **/
188 EFI_STATUS
189 EFIAPI
190 PeimInitializeDxeIpl (
191 IN EFI_PEI_FILE_HANDLE FfsHandle,
192 IN EFI_PEI_SERVICES **PeiServices
193 )
194 ;
195
196
197 #endif