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