]> git.proxmox.com Git - mirror_edk2.git/blob - IntelFspPkg/FspDxeIpl/DxeIpl.h
DynamicTablesPkg: GTDT updates for ACPI 6.3
[mirror_edk2.git] / IntelFspPkg / FspDxeIpl / DxeIpl.h
1 /** @file
2
3 Copyright (c) 2014, Intel Corporation. All rights reserved.<BR>
4 SPDX-License-Identifier: BSD-2-Clause-Patent
5
6 **/
7
8 #ifndef __PEI_DXEIPL_H__
9 #define __PEI_DXEIPL_H__
10
11 #include <PiPei.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>
18
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>
33
34 /**
35 Main entry point to last PEIM.
36
37 This function finds DXE Core in the firmware volume and transfer the control to
38 DXE core.
39
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.
43
44 @return EFI_SUCCESS DXE core was successfully loaded.
45 @return EFI_OUT_OF_RESOURCES There are not enough resources to load DXE core.
46
47 **/
48 EFI_STATUS
49 EFIAPI
50 DxeLoadCore (
51 IN CONST EFI_DXE_IPL_PPI *This,
52 IN EFI_PEI_SERVICES **PeiServices,
53 IN EFI_PEI_HOB_POINTERS HobList
54 );
55
56
57
58 /**
59 Transfers control to DxeCore.
60
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.
64
65 @param[in] DxeCoreEntryPoint The entry point of DxeCore.
66 @param[in] HobList The start of HobList passed to DxeCore.
67
68 **/
69 VOID
70 HandOffToDxeCore (
71 IN EFI_PHYSICAL_ADDRESS DxeCoreEntryPoint,
72 IN EFI_PEI_HOB_POINTERS HobList
73 );
74
75
76
77 /**
78 Updates the Stack HOB passed to DXE phase.
79
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.
82
83 @param[in] BaseAddress The lower address of stack used by DxeCore.
84 @param[in] Length The length of stack used by DxeCore.
85
86 **/
87 VOID
88 UpdateStackHob (
89 IN EFI_PHYSICAL_ADDRESS BaseAddress,
90 IN UINT64 Length
91 );
92
93 /**
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.
102
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
125 bit as clear,
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
133 undefined.
134
135 @retval EFI_SUCCESS The InputSection was
136 successfully processed and the
137 section contents were returned.
138
139 @retval EFI_OUT_OF_RESOURCES The system has insufficient
140 resources to process the request.
141
142 @retval EFI_INVALID_PARAMETER The GUID in InputSection does
143 not match this instance of the
144 GUIDed Section Extraction PPI.
145
146 **/
147 EFI_STATUS
148 EFIAPI
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
155 );
156
157 /**
158 Decompresses a section to the output buffer.
159
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.
163
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
168 sections.
169 @param[out] OutputSize Holds the returned size of the decompress
170 section streams.
171
172 @retval EFI_SUCCESS The section was decompressed successfully.
173 OutputBuffer contains the resulting data and
174 OutputSize contains the resulting size.
175
176 **/
177 EFI_STATUS
178 EFIAPI
179 Decompress (
180 IN CONST EFI_PEI_DECOMPRESS_PPI *This,
181 IN CONST EFI_COMPRESSION_SECTION *CompressionSection,
182 OUT VOID **OutputBuffer,
183 OUT UINTN *OutputSize
184 );
185
186 #endif