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