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