2 Header file for PEI Services Library.
4 Copyright (c) 2006, Intel Corporation
5 All rights reserved. This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
13 Module Name: PeiServicesLib.h
17 #ifndef __PEI_SERVICES_LIB_H__
18 #define __PEI_SERVICES_LIB_H__
21 This service enables a given PEIM to register an interface into the PEI Foundation.
23 @param PpiList A pointer to the list of interfaces that the caller shall install.
25 @retval EFI_SUCCESS The interface was successfully installed.
26 @retval EFI_INVALID_PARAMETER The PpiList pointer is NULL.
27 @retval EFI_INVALID_PARAMETER Any of the PEI PPI descriptors in the list do not have the
28 EFI_PEI_PPI_DESCRIPTOR_PPI bit set in the Flags field.
29 @retval EFI_OUT_OF_RESOURCES There is no additional space in the PPI database.
34 PeiServicesInstallPpi (
35 IN EFI_PEI_PPI_DESCRIPTOR
*PpiList
39 This service enables PEIMs to replace an entry in the PPI database with an alternate entry.
41 @param OldPpi Pointer to the old PEI PPI Descriptors.
42 @param NewPpi Pointer to the new PEI PPI Descriptors.
44 @retval EFI_SUCCESS The interface was successfully installed.
45 @retval EFI_INVALID_PARAMETER The OldPpi or NewPpi is NULL.
46 @retval EFI_INVALID_PARAMETER Any of the PEI PPI descriptors in the list do not have the
47 EFI_PEI_PPI_DESCRIPTOR_PPI bit set in the Flags field.
48 @retval EFI_OUT_OF_RESOURCES There is no additional space in the PPI database.
49 @retval EFI_NOT_FOUND The PPI for which the reinstallation was requested has not been
55 PeiServicesReInstallPpi (
56 IN EFI_PEI_PPI_DESCRIPTOR
*OldPpi
,
57 IN EFI_PEI_PPI_DESCRIPTOR
*NewPpi
61 This service enables PEIMs to discover a given instance of an interface.
63 @param Guid A pointer to the GUID whose corresponding interface needs to be
65 @param Instance The N-th instance of the interface that is required.
66 @param PpiDescriptor A pointer to instance of the EFI_PEI_PPI_DESCRIPTOR.
67 @param Ppi A pointer to the instance of the interface.
69 @retval EFI_SUCCESS The interface was successfully returned.
70 @retval EFI_NOT_FOUND The PPI descriptor is not found in the database.
75 PeiServicesLocatePpi (
78 IN OUT EFI_PEI_PPI_DESCRIPTOR
**PpiDescriptor
,
83 This service enables PEIMs to register a given service to be invoked when another service is
84 installed or reinstalled.
86 @param NotifyList A pointer to the list of notification interfaces that the caller
89 @retval EFI_SUCCESS The interface was successfully installed.
90 @retval EFI_INVALID_PARAMETER The NotifyList pointer is NULL.
91 @retval EFI_INVALID_PARAMETER Any of the PEI notify descriptors in the list do not have the
92 EFI_PEI_PPI_DESCRIPTOR_NOTIFY_TYPES bit set in the Flags field.
93 @retval EFI_OUT_OF_RESOURCES There is no additional space in the PPI database.
98 PeiServicesNotifyPpi (
99 IN EFI_PEI_NOTIFY_DESCRIPTOR
*NotifyList
103 This service enables PEIMs to ascertain the present value of the boot mode.
105 @param BootMode A pointer to contain the value of the boot mode.
107 @retval EFI_SUCCESS The boot mode was returned successfully.
108 @retval EFI_INVALID_PARAMETER BootMode is NULL.
113 PeiServicesGetBootMode (
114 IN OUT EFI_BOOT_MODE
*BootMode
118 This service enables PEIMs to update the boot mode variable.
120 @param BootMode The value of the boot mode to set.
122 @retval EFI_SUCCESS The value was successfully updated
127 PeiServicesSetBootMode (
128 IN EFI_BOOT_MODE BootMode
132 This service enables a PEIM to ascertain the address of the list of HOBs in memory.
134 @param HobList A pointer to the list of HOBs that the PEI Foundation will initialize.
136 @retval EFI_SUCCESS The list was successfully returned.
137 @retval EFI_NOT_AVAILABLE_YET The HOB list is not yet published.
142 PeiServicesGetHobList (
143 IN OUT VOID
**HobList
147 This service enables PEIMs to create various types of HOBs.
149 @param Type The type of HOB to be installed.
150 @param Length The length of the HOB to be added.
151 @param Hob The address of a pointer that will contain the HOB header.
153 @retval EFI_SUCCESS The HOB was successfully created.
154 @retval EFI_OUT_OF_RESOURCES There is no additional space for HOB creation.
159 PeiServicesCreateHob (
166 This service enables PEIMs to discover additional firmware volumes.
168 @param Instance This instance of the firmware volume to find. The value 0 is the
169 Boot Firmware Volume (BFV).
170 @param FwVolHeader Pointer to the firmware volume header of the volume to return.
172 @retval EFI_SUCCESS The volume was found.
173 @retval EFI_NOT_FOUND The volume was not found.
174 @retval EFI_INVALID_PARAMETER FwVolHeader is NULL.
179 PeiServicesFfsFindNextVolume (
181 IN OUT EFI_FIRMWARE_VOLUME_HEADER
**FwVolHeader
185 This service enables PEIMs to discover additional firmware files.
187 @param SearchType A filter to find files only of this type.
188 @param FwVolHeader Pointer to the firmware volume header of the volume to search.
189 This parameter must point to a valid FFS volume.
190 @param FileHeader Pointer to the current file from which to begin searching.
192 @retval EFI_SUCCESS The file was found.
193 @retval EFI_NOT_FOUND The file was not found.
194 @retval EFI_NOT_FOUND The header checksum was not zero.
199 PeiServicesFfsFindNextFile (
200 IN EFI_FV_FILETYPE SearchType
,
201 IN EFI_FIRMWARE_VOLUME_HEADER
*FwVolHeader
,
202 IN OUT EFI_FFS_FILE_HEADER
**FileHeader
206 This service enables PEIMs to discover sections of a given type within a valid FFS file.
208 @param SearchType The value of the section type to find.
209 @param FfsFileHeader A pointer to the file header that contains the set of sections to
211 @param SectionData A pointer to the discovered section, if successful.
213 @retval EFI_SUCCESS The section was found.
214 @retval EFI_NOT_FOUND The section was not found.
219 PeiServicesFfsFindSectionData (
220 IN EFI_SECTION_TYPE SectionType
,
221 IN EFI_FFS_FILE_HEADER
*FfsFileHeader
,
222 IN OUT VOID
**SectionData
226 This service enables PEIMs to register the permanent memory configuration
227 that has been initialized with the PEI Foundation.
229 @param MemoryBegin The value of a region of installed memory.
230 @param MemoryLength The corresponding length of a region of installed memory.
232 @retval EFI_SUCCESS The region was successfully installed in a HOB.
233 @retval EFI_INVALID_PARAMETER MemoryBegin and MemoryLength are illegal for this system.
234 @retval EFI_OUT_OF_RESOURCES There is no additional space for HOB creation.
239 PeiServicesInstallPeiMemory (
240 IN EFI_PHYSICAL_ADDRESS MemoryBegin
,
241 IN UINT64 MemoryLength
245 This service enables PEIMs to allocate memory after the permanent memory has been installed by a
248 @param MemoryType Type of memory to allocate.
249 @param Pages Number of pages to allocate.
250 @param Memory Pointer of memory allocated.
252 @retval EFI_SUCCESS The memory range was successfully allocated.
253 @retval EFI_INVALID_PARAMETER Type is not equal to AllocateAnyPages.
254 @retval EFI_NOT_AVAILABLE_YET Called with permanent memory not available.
255 @retval EFI_OUT_OF_RESOURCES The pages could not be allocated.
260 PeiServicesAllocatePages (
261 IN EFI_MEMORY_TYPE MemoryType
,
263 IN OUT EFI_PHYSICAL_ADDRESS
*Memory
267 This service allocates memory from the Hand-Off Block (HOB) heap.
269 @param Size The number of bytes to allocate from the pool.
270 @param Buffer If the call succeeds, a pointer to a pointer to the allocate
271 buffer; undefined otherwise.
273 @retval EFI_SUCCESS The allocation was successful
274 @retval EFI_OUT_OF_RESOURCES There is not enough heap to allocate the requested size.
279 PeiServicesAllocatePool (
285 This service resets the entire platform, including all processors and devices, and reboots the
288 @retval EFI_NOT_AVAILABLE_YET The service has not been installed yet.
293 PeiServicesResetSystem (