Add UINT16/32/64 array and DSC include support.
[mirror_edk2.git] / IntelFspPkg / FspDxeIpl / DxeIpl.h
CommitLineData
c8ec22a2
JY
1/** @file\r
2\r
3 Copyright (c) 2014, Intel Corporation. All rights reserved.<BR>\r
4 This program and the accompanying materials\r
5 are licensed and made available under the terms and conditions of the BSD License\r
6 which accompanies this distribution. The full text of the license may be found at\r
7 http://opensource.org/licenses/bsd-license.php.\r
8\r
9 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
10 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
11\r
12**/\r
13\r
14#ifndef __PEI_DXEIPL_H__\r
15#define __PEI_DXEIPL_H__\r
16\r
17#include <PiPei.h>\r
18#include <Ppi/DxeIpl.h>\r
19#include <Ppi/EndOfPeiPhase.h>\r
20#include <Ppi/MemoryDiscovered.h>\r
21#include <Ppi/Decompress.h>\r
22#include <Ppi/FirmwareVolumeInfo.h>\r
23#include <Ppi/GuidedSectionExtraction.h>\r
24\r
25#include <Library/DebugLib.h>\r
26#include <Library/PeimEntryPoint.h>\r
27#include <Library/BaseLib.h>\r
28#include <Library/HobLib.h>\r
29#include <Library/PeiServicesLib.h>\r
30#include <Library/ReportStatusCodeLib.h>\r
31#include <Library/UefiDecompressLib.h>\r
32#include <Library/ExtractGuidedSectionLib.h>\r
33#include <Library/BaseMemoryLib.h>\r
34#include <Library/MemoryAllocationLib.h>\r
35#include <Library/PcdLib.h>\r
36#include <Library/FspSwitchStackLib.h>\r
37#include <Library/FspCommonLib.h>\r
38#include <Library/FspPlatformLib.h>\r
39\r
40/**\r
41 Main entry point to last PEIM.\r
42\r
43 This function finds DXE Core in the firmware volume and transfer the control to\r
44 DXE core.\r
45\r
46 @param[in] This Entry point for DXE IPL PPI.\r
47 @param[in] PeiServices General purpose services available to every PEIM.\r
48 @param[in] HobList Address to the Pei HOB list.\r
49\r
50 @return EFI_SUCCESS DXE core was successfully loaded.\r
51 @return EFI_OUT_OF_RESOURCES There are not enough resources to load DXE core.\r
52\r
53**/\r
54EFI_STATUS\r
55EFIAPI\r
56DxeLoadCore (\r
57 IN CONST EFI_DXE_IPL_PPI *This,\r
58 IN EFI_PEI_SERVICES **PeiServices,\r
59 IN EFI_PEI_HOB_POINTERS HobList\r
60 );\r
61\r
62\r
63\r
64/**\r
65 Transfers control to DxeCore.\r
66\r
67 This function performs a CPU architecture specific operations to execute\r
68 the entry point of DxeCore with the parameters of HobList.\r
69 It also installs EFI_END_OF_PEI_PPI to signal the end of PEI phase.\r
70\r
71 @param[in] DxeCoreEntryPoint The entry point of DxeCore.\r
72 @param[in] HobList The start of HobList passed to DxeCore.\r
73\r
74**/\r
75VOID\r
76HandOffToDxeCore (\r
77 IN EFI_PHYSICAL_ADDRESS DxeCoreEntryPoint,\r
78 IN EFI_PEI_HOB_POINTERS HobList\r
79 );\r
80\r
81\r
82\r
83/**\r
84 Updates the Stack HOB passed to DXE phase.\r
85\r
86 This function traverses the whole HOB list and update the stack HOB to\r
87 reflect the real stack that is used by DXE core.\r
88\r
89 @param[in] BaseAddress The lower address of stack used by DxeCore.\r
90 @param[in] Length The length of stack used by DxeCore.\r
91\r
92**/\r
93VOID\r
94UpdateStackHob (\r
95 IN EFI_PHYSICAL_ADDRESS BaseAddress,\r
96 IN UINT64 Length\r
97 );\r
98\r
99/**\r
100 The ExtractSection() function processes the input section and\r
101 returns a pointer to the section contents. If the section being\r
102 extracted does not require processing (if the section\r
103 GuidedSectionHeader.Attributes has the\r
104 EFI_GUIDED_SECTION_PROCESSING_REQUIRED field cleared), then\r
105 OutputBuffer is just updated to point to the start of the\r
106 section's contents. Otherwise, *Buffer must be allocated\r
107 from PEI permanent memory.\r
108\r
109 @param[in] This Indicates the\r
110 EFI_PEI_GUIDED_SECTION_EXTRACTION_PPI instance.\r
111 Buffer containing the input GUIDed section to be\r
112 processed. OutputBuffer OutputBuffer is\r
113 allocated from PEI permanent memory and contains\r
114 the new section stream.\r
115 @param[in] InputSection A pointer to the input buffer, which contains\r
116 the input section to be processed.\r
117 @param[out] OutputBuffer A pointer to a caller-allocated buffer, whose\r
118 size is specified by the contents of OutputSize.\r
119 @param[out] OutputSize A pointer to a caller-allocated\r
120 UINTN in which the size of *OutputBuffer\r
121 allocation is stored. If the function\r
122 returns anything other than EFI_SUCCESS,\r
123 the value of OutputSize is undefined.\r
124 @param[out] AuthenticationStatus A pointer to a caller-allocated\r
125 UINT32 that indicates the\r
126 authentication status of the\r
127 output buffer. If the input\r
128 section's GuidedSectionHeader.\r
129 Attributes field has the\r
130 EFI_GUIDED_SECTION_AUTH_STATUS_VALID\r
131 bit as clear,\r
132 AuthenticationStatus must return\r
133 zero. These bits reflect the\r
134 status of the extraction\r
135 operation. If the function\r
136 returns anything other than\r
137 EFI_SUCCESS, the value of\r
138 AuthenticationStatus is\r
139 undefined.\r
140\r
141 @retval EFI_SUCCESS The InputSection was\r
142 successfully processed and the\r
143 section contents were returned.\r
144\r
145 @retval EFI_OUT_OF_RESOURCES The system has insufficient\r
146 resources to process the request.\r
147\r
148 @retval EFI_INVALID_PARAMETER The GUID in InputSection does\r
149 not match this instance of the\r
150 GUIDed Section Extraction PPI.\r
151\r
152**/\r
153EFI_STATUS\r
154EFIAPI\r
155CustomGuidedSectionExtract (\r
156 IN CONST EFI_PEI_GUIDED_SECTION_EXTRACTION_PPI *This,\r
157 IN CONST VOID *InputSection,\r
158 OUT VOID **OutputBuffer,\r
159 OUT UINTN *OutputSize,\r
160 OUT UINT32 *AuthenticationStatus\r
161 );\r
162\r
163/**\r
164 Decompresses a section to the output buffer.\r
165\r
166 This function looks up the compression type field in the input section and\r
167 applies the appropriate compression algorithm to compress the section to a\r
168 callee allocated buffer.\r
169\r
170 @param[in] This Points to this instance of the\r
171 EFI_PEI_DECOMPRESS_PEI PPI.\r
172 @param[in] CompressionSection Points to the compressed section.\r
173 @param[out] OutputBuffer Holds the returned pointer to the decompressed\r
174 sections.\r
175 @param[out] OutputSize Holds the returned size of the decompress\r
176 section streams.\r
177\r
178 @retval EFI_SUCCESS The section was decompressed successfully.\r
179 OutputBuffer contains the resulting data and\r
180 OutputSize contains the resulting size.\r
181\r
182**/\r
183EFI_STATUS\r
184EFIAPI\r
185Decompress (\r
186 IN CONST EFI_PEI_DECOMPRESS_PPI *This,\r
187 IN CONST EFI_COMPRESSION_SECTION *CompressionSection,\r
188 OUT VOID **OutputBuffer,\r
189 OUT UINTN *OutputSize\r
190 );\r
191\r
192#endif\r