]> git.proxmox.com Git - mirror_edk2.git/blob - EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Library/EdkIIGluePeiServicesLib.h
Add in the 1st version of ECP.
[mirror_edk2.git] / EdkCompatibilityPkg / Foundation / Library / EdkIIGlueLib / Include / Library / EdkIIGluePeiServicesLib.h
1 /*++
2
3 Copyright (c) 2004 - 2006, Intel Corporation
4 All rights reserved. This program and the accompanying materials
5 are licensed and made available under the terms and conditions of the BSD License
6 which accompanies this distribution. The full text of the license may be found at
7 http://opensource.org/licenses/bsd-license.php
8
9 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
11
12
13 Module Name:
14
15 EdkIIGluePeiServicesLib.h
16
17 Abstract:
18
19 Public header file for PEI Services Lib
20
21 --*/
22
23 #ifndef __EDKII_GLUE_PEI_SERVICES_LIB_H__
24 #define __EDKII_GLUE_PEI_SERVICES_LIB_H__
25
26 /**
27 This service enables a given PEIM to register an interface into the PEI Foundation.
28
29 @param PpiList A pointer to the list of interfaces that the caller shall install.
30
31 @retval EFI_SUCCESS The interface was successfully installed.
32 @retval EFI_INVALID_PARAMETER The PpiList pointer is NULL.
33 @retval EFI_INVALID_PARAMETER Any of the PEI PPI descriptors in the list do not have the
34 EFI_PEI_PPI_DESCRIPTOR_PPI bit set in the Flags field.
35 @retval EFI_OUT_OF_RESOURCES There is no additional space in the PPI database.
36
37 **/
38 EFI_STATUS
39 EFIAPI
40 PeiServicesInstallPpi (
41 IN EFI_PEI_PPI_DESCRIPTOR *PpiList
42 );
43
44 /**
45 This service enables PEIMs to replace an entry in the PPI database with an alternate entry.
46
47 @param OldPpi Pointer to the old PEI PPI Descriptors.
48 @param NewPpi Pointer to the new PEI PPI Descriptors.
49
50 @retval EFI_SUCCESS The interface was successfully installed.
51 @retval EFI_INVALID_PARAMETER The OldPpi or NewPpi is NULL.
52 @retval EFI_INVALID_PARAMETER Any of the PEI PPI descriptors in the list do not have the
53 EFI_PEI_PPI_DESCRIPTOR_PPI bit set in the Flags field.
54 @retval EFI_OUT_OF_RESOURCES There is no additional space in the PPI database.
55 @retval EFI_NOT_FOUND The PPI for which the reinstallation was requested has not been
56 installed.
57
58 **/
59 EFI_STATUS
60 EFIAPI
61 PeiServicesReInstallPpi (
62 IN EFI_PEI_PPI_DESCRIPTOR *OldPpi,
63 IN EFI_PEI_PPI_DESCRIPTOR *NewPpi
64 );
65
66 /**
67 This service enables PEIMs to discover a given instance of an interface.
68
69 @param Guid A pointer to the GUID whose corresponding interface needs to be
70 found.
71 @param Instance The N-th instance of the interface that is required.
72 @param PpiDescriptor A pointer to instance of the EFI_PEI_PPI_DESCRIPTOR.
73 @param Ppi A pointer to the instance of the interface.
74
75 @retval EFI_SUCCESS The interface was successfully returned.
76 @retval EFI_NOT_FOUND The PPI descriptor is not found in the database.
77
78 **/
79 EFI_STATUS
80 EFIAPI
81 PeiServicesLocatePpi (
82 IN EFI_GUID *Guid,
83 IN UINTN Instance,
84 IN OUT EFI_PEI_PPI_DESCRIPTOR **PpiDescriptor,
85 IN OUT VOID **Ppi
86 );
87
88 /**
89 This service enables PEIMs to register a given service to be invoked when another service is
90 installed or reinstalled.
91
92 @param NotifyList A pointer to the list of notification interfaces that the caller
93 shall install.
94
95 @retval EFI_SUCCESS The interface was successfully installed.
96 @retval EFI_INVALID_PARAMETER The NotifyList pointer is NULL.
97 @retval EFI_INVALID_PARAMETER Any of the PEI notify descriptors in the list do not have the
98 EFI_PEI_PPI_DESCRIPTOR_NOTIFY_TYPES bit set in the Flags field.
99 @retval EFI_OUT_OF_RESOURCES There is no additional space in the PPI database.
100
101 **/
102 EFI_STATUS
103 EFIAPI
104 PeiServicesNotifyPpi (
105 IN EFI_PEI_NOTIFY_DESCRIPTOR *NotifyList
106 );
107
108 /**
109 This service enables PEIMs to ascertain the present value of the boot mode.
110
111 @param BootMode A pointer to contain the value of the boot mode.
112
113 @retval EFI_SUCCESS The boot mode was returned successfully.
114 @retval EFI_INVALID_PARAMETER BootMode is NULL.
115
116 **/
117 EFI_STATUS
118 EFIAPI
119 PeiServicesGetBootMode (
120 IN OUT EFI_BOOT_MODE *BootMode
121 );
122
123 /**
124 This service enables PEIMs to update the boot mode variable.
125
126 @param BootMode The value of the boot mode to set.
127
128 @retval EFI_SUCCESS The value was successfully updated
129
130 **/
131 EFI_STATUS
132 EFIAPI
133 PeiServicesSetBootMode (
134 IN EFI_BOOT_MODE BootMode
135 );
136
137 /**
138 This service enables a PEIM to ascertain the address of the list of HOBs in memory.
139
140 @param HobList A pointer to the list of HOBs that the PEI Foundation will initialize.
141
142 @retval EFI_SUCCESS The list was successfully returned.
143 @retval EFI_NOT_AVAILABLE_YET The HOB list is not yet published.
144
145 **/
146 EFI_STATUS
147 EFIAPI
148 PeiServicesGetHobList (
149 IN OUT VOID **HobList
150 );
151
152 /**
153 This service enables PEIMs to create various types of HOBs.
154
155 @param Type The type of HOB to be installed.
156 @param Length The length of the HOB to be added.
157 @param Hob The address of a pointer that will contain the HOB header.
158
159 @retval EFI_SUCCESS The HOB was successfully created.
160 @retval EFI_OUT_OF_RESOURCES There is no additional space for HOB creation.
161
162 **/
163 EFI_STATUS
164 EFIAPI
165 PeiServicesCreateHob (
166 IN UINT16 Type,
167 IN UINT16 Length,
168 IN OUT VOID **Hob
169 );
170
171 #if (PI_SPECIFICATION_VERSION < 0x00010000)
172 /**
173 This service enables PEIMs to discover additional firmware volumes.
174
175 @param Instance This instance of the firmware volume to find. The value 0 is the
176 Boot Firmware Volume (BFV).
177 @param FwVolHeader Pointer to the firmware volume header of the volume to return.
178
179 @retval EFI_SUCCESS The volume was found.
180 @retval EFI_NOT_FOUND The volume was not found.
181 @retval EFI_INVALID_PARAMETER FwVolHeader is NULL.
182
183 **/
184 EFI_STATUS
185 EFIAPI
186 PeiServicesFfsFindNextVolume (
187 IN UINTN Instance,
188 IN OUT EFI_FIRMWARE_VOLUME_HEADER **FwVolHeader
189 );
190
191 /**
192 This service enables PEIMs to discover additional firmware files.
193
194 @param SearchType A filter to find files only of this type.
195 @param FwVolHeader Pointer to the firmware volume header of the volume to search.
196 This parameter must point to a valid FFS volume.
197 @param FileHeader Pointer to the current file from which to begin searching.
198
199 @retval EFI_SUCCESS The file was found.
200 @retval EFI_NOT_FOUND The file was not found.
201 @retval EFI_NOT_FOUND The header checksum was not zero.
202
203 **/
204 EFI_STATUS
205 EFIAPI
206 PeiServicesFfsFindNextFile (
207 IN EFI_FV_FILETYPE SearchType,
208 IN EFI_FIRMWARE_VOLUME_HEADER *FwVolHeader,
209 IN OUT EFI_FFS_FILE_HEADER **FileHeader
210 );
211
212 /**
213 This service enables PEIMs to discover sections of a given type within a valid FFS file.
214
215 @param SearchType The value of the section type to find.
216 @param FfsFileHeader A pointer to the file header that contains the set of sections to
217 be searched.
218 @param SectionData A pointer to the discovered section, if successful.
219
220 @retval EFI_SUCCESS The section was found.
221 @retval EFI_NOT_FOUND The section was not found.
222
223 **/
224 EFI_STATUS
225 EFIAPI
226 PeiServicesFfsFindSectionData (
227 IN EFI_SECTION_TYPE SectionType,
228 IN EFI_FFS_FILE_HEADER *FfsFileHeader,
229 IN OUT VOID **SectionData
230 );
231 #endif
232
233 /**
234 This service enables PEIMs to register the permanent memory configuration
235 that has been initialized with the PEI Foundation.
236
237 @param MemoryBegin The value of a region of installed memory.
238 @param MemoryLength The corresponding length of a region of installed memory.
239
240 @retval EFI_SUCCESS The region was successfully installed in a HOB.
241 @retval EFI_INVALID_PARAMETER MemoryBegin and MemoryLength are illegal for this system.
242 @retval EFI_OUT_OF_RESOURCES There is no additional space for HOB creation.
243
244 **/
245 EFI_STATUS
246 EFIAPI
247 PeiServicesInstallPeiMemory (
248 IN EFI_PHYSICAL_ADDRESS MemoryBegin,
249 IN UINT64 MemoryLength
250 );
251
252 /**
253 This service enables PEIMs to allocate memory after the permanent memory has been installed by a
254 PEIM.
255
256 @param MemoryType Type of memory to allocate.
257 @param Pages Number of pages to allocate.
258 @param Memory Pointer of memory allocated.
259
260 @retval EFI_SUCCESS The memory range was successfully allocated.
261 @retval EFI_INVALID_PARAMETER Type is not equal to AllocateAnyPages.
262 @retval EFI_NOT_AVAILABLE_YET Called with permanent memory not available.
263 @retval EFI_OUT_OF_RESOURCES The pages could not be allocated.
264
265 **/
266 EFI_STATUS
267 EFIAPI
268 PeiServicesAllocatePages (
269 IN EFI_MEMORY_TYPE MemoryType,
270 IN UINTN Pages,
271 IN OUT EFI_PHYSICAL_ADDRESS *Memory
272 );
273
274 /**
275 This service allocates memory from the Hand-Off Block (HOB) heap.
276
277 @param Size The number of bytes to allocate from the pool.
278 @param Buffer If the call succeeds, a pointer to a pointer to the allocate
279 buffer; undefined otherwise.
280
281 @retval EFI_SUCCESS The allocation was successful
282 @retval EFI_OUT_OF_RESOURCES There is not enough heap to allocate the requested size.
283
284 **/
285 EFI_STATUS
286 EFIAPI
287 PeiServicesAllocatePool (
288 IN UINTN Size,
289 OUT VOID **Buffer
290 );
291
292 /**
293 This service resets the entire platform, including all processors and devices, and reboots the
294 system.
295
296 @retval EFI_NOT_AVAILABLE_YET The service has not been installed yet.
297
298 **/
299 EFI_STATUS
300 EFIAPI
301 PeiServicesResetSystem (
302 VOID
303 );
304
305
306 #endif