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