]> git.proxmox.com Git - mirror_edk2.git/blame - MdeModulePkg/Core/DxeIplPeim/DxeIpl.h
1. DxeIplPeim will locate Vector Handoff Table PPI and build GUIDed HOB if it has.
[mirror_edk2.git] / MdeModulePkg / Core / DxeIplPeim / DxeIpl.h
CommitLineData
96226baa 1/** @file\r
fbc81c1e 2 Master header file for DxeIpl PEIM. All source files in this module should\r
48557c65 3 include this file for common definitions.\r
95276127 4\r
57f360f2 5Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>\r
cd5ebaa0 6This program and the accompanying materials\r
95276127 7are licensed and made available under the terms and conditions of the BSD License\r
8which accompanies this distribution. The full text of the license may be found at\r
9http://opensource.org/licenses/bsd-license.php\r
10\r
11THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
12WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
13\r
797a9d67 14**/\r
95276127 15\r
16#ifndef __PEI_DXEIPL_H__\r
17#define __PEI_DXEIPL_H__\r
18\r
859b72fa
A
19#include <PiPei.h>\r
20#include <Ppi/DxeIpl.h>\r
859b72fa 21#include <Ppi/EndOfPeiPhase.h>\r
859b72fa 22#include <Ppi/MemoryDiscovered.h>\r
b74350e9 23#include <Ppi/ReadOnlyVariable2.h>\r
b0d803fe 24#include <Ppi/Decompress.h>\r
25#include <Ppi/FirmwareVolumeInfo.h>\r
b98da1b1 26#include <Ppi/GuidedSectionExtraction.h>\r
28efc722 27#include <Ppi/LoadFile.h>\r
77215d10 28#include <Ppi/S3Resume2.h>\r
28efc722 29#include <Ppi/RecoveryModule.h>\r
57f360f2 30#include <Ppi/VectorHandoffInfo.h>\r
b0d803fe 31\r
b98da1b1 32#include <Guid/MemoryTypeInformation.h>\r
30c8f861 33#include <Guid/MemoryAllocationHob.h>\r
b0d803fe 34#include <Guid/FirmwareFileSystem2.h>\r
35\r
859b72fa
A
36#include <Library/DebugLib.h>\r
37#include <Library/PeimEntryPoint.h>\r
38#include <Library/BaseLib.h>\r
39#include <Library/HobLib.h>\r
40#include <Library/PeiServicesLib.h>\r
41#include <Library/ReportStatusCodeLib.h>\r
859b72fa 42#include <Library/UefiDecompressLib.h>\r
18fd8d65 43#include <Library/ExtractGuidedSectionLib.h>\r
859b72fa
A
44#include <Library/BaseMemoryLib.h>\r
45#include <Library/MemoryAllocationLib.h>\r
46#include <Library/PcdLib.h>\r
4fb31c2c 47#include <Library/S3Lib.h>\r
48#include <Library/RecoveryLib.h>\r
e7af83ae 49#include <Library/DebugAgentLib.h>\r
bdfbe63e 50#include <Library/PeiServicesTablePointerLib.h>\r
95276127 51\r
52#define STACK_SIZE 0x20000\r
53#define BSP_STORE_SIZE 0x4000\r
54\r
b98da1b1 55\r
9b937a73 56//\r
e7af83ae 57// This PPI is installed to indicate the end of the PEI usage of memory\r
9b937a73 58//\r
59extern CONST EFI_PEI_PPI_DESCRIPTOR gEndOfPeiSignalPpi;\r
60\r
61\r
91d92e25 62/**\r
b6b98e91 63 Searches DxeCore in all firmware Volumes and loads the first\r
64 instance that contains DxeCore.\r
91d92e25 65\r
9b937a73 66 @return FileHandle of DxeCore to load DxeCore.\r
e7af83ae 67\r
91d92e25 68**/\r
9b937a73 69EFI_PEI_FILE_HANDLE\r
288f9b38 70DxeIplFindDxeCore (\r
b6b98e91 71 VOID\r
f45af90b 72 );\r
95276127 73\r
91d92e25 74\r
91d92e25 75/**\r
e7af83ae 76 Main entry point to last PEIM\r
77\r
91d92e25 78 @param This Entry point for DXE IPL PPI\r
79 @param PeiServices General purpose services available to every PEIM.\r
80 @param HobList Address to the Pei HOB list\r
e7af83ae 81\r
82 @return EFI_SUCCESS DXE core was successfully loaded.\r
91d92e25 83 @return EFI_OUT_OF_RESOURCES There are not enough resources to load DXE core.\r
84\r
85**/\r
95276127 86EFI_STATUS\r
87EFIAPI\r
88DxeLoadCore (\r
1f3a753e 89 IN CONST EFI_DXE_IPL_PPI *This,\r
95276127 90 IN EFI_PEI_SERVICES **PeiServices,\r
91 IN EFI_PEI_HOB_POINTERS HobList\r
92 );\r
93\r
91d92e25 94\r
95\r
96/**\r
97 Transfers control to DxeCore.\r
98\r
99 This function performs a CPU architecture specific operations to execute\r
100 the entry point of DxeCore with the parameters of HobList.\r
48557c65 101 It also installs EFI_END_OF_PEI_PPI to signal the end of PEI phase.\r
91d92e25 102\r
48557c65 103 @param DxeCoreEntryPoint The entry point of DxeCore.\r
91d92e25 104 @param HobList The start of HobList passed to DxeCore.\r
91d92e25 105\r
106**/\r
95276127 107VOID\r
108HandOffToDxeCore (\r
109 IN EFI_PHYSICAL_ADDRESS DxeCoreEntryPoint,\r
9b937a73 110 IN EFI_PEI_HOB_POINTERS HobList\r
95276127 111 );\r
112\r
91d92e25 113\r
114\r
115/**\r
116 Updates the Stack HOB passed to DXE phase.\r
117\r
118 This function traverses the whole HOB list and update the stack HOB to\r
119 reflect the real stack that is used by DXE core.\r
120\r
121 @param BaseAddress The lower address of stack used by DxeCore.\r
122 @param Length The length of stack used by DxeCore.\r
123\r
124**/\r
30c8f861 125VOID\r
126UpdateStackHob (\r
127 IN EFI_PHYSICAL_ADDRESS BaseAddress,\r
128 IN UINT64 Length\r
129 );\r
130\r
b98da1b1 131/**\r
132 The ExtractSection() function processes the input section and\r
133 returns a pointer to the section contents. If the section being\r
134 extracted does not require processing (if the section\r
135 GuidedSectionHeader.Attributes has the\r
136 EFI_GUIDED_SECTION_PROCESSING_REQUIRED field cleared), then\r
137 OutputBuffer is just updated to point to the start of the\r
138 section's contents. Otherwise, *Buffer must be allocated\r
139 from PEI permanent memory.\r
140\r
141 @param This Indicates the\r
142 EFI_PEI_GUIDED_SECTION_EXTRACTION_PPI instance.\r
143 Buffer containing the input GUIDed section to be\r
144 processed. OutputBuffer OutputBuffer is\r
145 allocated from PEI permanent memory and contains\r
146 the new section stream.\r
147 @param InputSection A pointer to the input buffer, which contains\r
148 the input section to be processed.\r
149 @param OutputBuffer A pointer to a caller-allocated buffer, whose\r
150 size is specified by the contents of OutputSize.\r
151 @param OutputSize A pointer to a caller-allocated\r
152 UINTN in which the size of *OutputBuffer\r
153 allocation is stored. If the function\r
154 returns anything other than EFI_SUCCESS,\r
155 the value of OutputSize is undefined.\r
156 @param AuthenticationStatus A pointer to a caller-allocated\r
157 UINT32 that indicates the\r
158 authentication status of the\r
159 output buffer. If the input\r
160 section's GuidedSectionHeader.\r
161 Attributes field has the\r
e7af83ae 162 EFI_GUIDED_SECTION_AUTH_STATUS_VALID\r
b98da1b1 163 bit as clear,\r
164 AuthenticationStatus must return\r
165 zero. These bits reflect the\r
166 status of the extraction\r
167 operation. If the function\r
168 returns anything other than\r
169 EFI_SUCCESS, the value of\r
170 AuthenticationStatus is\r
171 undefined.\r
e7af83ae 172\r
b98da1b1 173 @retval EFI_SUCCESS The InputSection was\r
174 successfully processed and the\r
175 section contents were returned.\r
e7af83ae 176\r
b98da1b1 177 @retval EFI_OUT_OF_RESOURCES The system has insufficient\r
178 resources to process the request.\r
e7af83ae 179\r
b98da1b1 180 @retval EFI_INVALID_PARAMETER The GUID in InputSection does\r
181 not match this instance of the\r
182 GUIDed Section Extraction PPI.\r
91d92e25 183\r
b98da1b1 184**/\r
185EFI_STATUS\r
6d3ea23f 186EFIAPI\r
b98da1b1 187CustomGuidedSectionExtract (\r
188 IN CONST EFI_PEI_GUIDED_SECTION_EXTRACTION_PPI *This,\r
189 IN CONST VOID *InputSection,\r
190 OUT VOID **OutputBuffer,\r
191 OUT UINTN *OutputSize,\r
192 OUT UINT32 *AuthenticationStatus\r
193 );\r
194\r
195\r
196/**\r
197 Decompresses a section to the output buffer.\r
198\r
48557c65 199 This function looks up the compression type field in the input section and\r
b98da1b1 200 applies the appropriate compression algorithm to compress the section to a\r
201 callee allocated buffer.\r
e7af83ae 202\r
b98da1b1 203 @param This Points to this instance of the\r
204 EFI_PEI_DECOMPRESS_PEI PPI.\r
205 @param CompressionSection Points to the compressed section.\r
206 @param OutputBuffer Holds the returned pointer to the decompressed\r
207 sections.\r
208 @param OutputSize Holds the returned size of the decompress\r
209 section streams.\r
e7af83ae 210\r
b98da1b1 211 @retval EFI_SUCCESS The section was decompressed successfully.\r
212 OutputBuffer contains the resulting data and\r
213 OutputSize contains the resulting size.\r
214\r
215**/\r
216EFI_STATUS\r
e7af83ae 217EFIAPI\r
b98da1b1 218Decompress (\r
219 IN CONST EFI_PEI_DECOMPRESS_PPI *This,\r
220 IN CONST EFI_COMPRESSION_SECTION *CompressionSection,\r
221 OUT VOID **OutputBuffer,\r
222 OUT UINTN *OutputSize\r
223 );\r
91d92e25 224\r
95276127 225#endif\r