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