]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Include/Library/PeiServicesLib.h
Import Library Class from original MDE package. Also I added the EFI_PEI_CORE_ENTRY_P...
[mirror_edk2.git] / MdePkg / Include / Library / PeiServicesLib.h
CommitLineData
fb3df220 1/** @file\r
2 Header file for PEI Services Library.\r
3\r
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
9\r
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
12\r
13 Module Name: PeiServicesLib.h\r
14\r
15**/\r
16\r
17#ifndef __PEI_SERVICES_LIB_H__\r
18#define __PEI_SERVICES_LIB_H__\r
19\r
20/**\r
21 This service enables a given PEIM to register an interface into the PEI Foundation. \r
22\r
23 @param PpiList A pointer to the list of interfaces that the caller shall install.\r
24\r
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
30\r
31**/\r
32EFI_STATUS\r
33EFIAPI\r
34PeiServicesInstallPpi (\r
35 IN EFI_PEI_PPI_DESCRIPTOR *PpiList\r
36 );\r
37\r
38/**\r
39 This service enables PEIMs to replace an entry in the PPI database with an alternate entry.\r
40\r
41 @param OldPpi Pointer to the old PEI PPI Descriptors.\r
42 @param NewPpi Pointer to the new PEI PPI Descriptors.\r
43\r
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
51\r
52**/\r
53EFI_STATUS\r
54EFIAPI\r
55PeiServicesReInstallPpi (\r
56 IN EFI_PEI_PPI_DESCRIPTOR *OldPpi,\r
57 IN EFI_PEI_PPI_DESCRIPTOR *NewPpi\r
58 );\r
59\r
60/**\r
61 This service enables PEIMs to discover a given instance of an interface.\r
62\r
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
68\r
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
71\r
72**/\r
73EFI_STATUS\r
74EFIAPI\r
75PeiServicesLocatePpi (\r
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
81\r
82/**\r
83 This service enables PEIMs to register a given service to be invoked when another service is\r
84 installed or reinstalled.\r
85\r
86 @param NotifyList A pointer to the list of notification interfaces that the caller\r
87 shall install.\r
88\r
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
94\r
95**/\r
96EFI_STATUS\r
97EFIAPI\r
98PeiServicesNotifyPpi (\r
99 IN EFI_PEI_NOTIFY_DESCRIPTOR *NotifyList\r
100 );\r
101\r
102/**\r
103 This service enables PEIMs to ascertain the present value of the boot mode. \r
104\r
105 @param BootMode A pointer to contain the value of the boot mode.\r
106\r
107 @retval EFI_SUCCESS The boot mode was returned successfully.\r
108 @retval EFI_INVALID_PARAMETER BootMode is NULL.\r
109\r
110**/\r
111EFI_STATUS\r
112EFIAPI\r
113PeiServicesGetBootMode (\r
114 IN OUT EFI_BOOT_MODE *BootMode\r
115 );\r
116\r
117/**\r
118 This service enables PEIMs to update the boot mode variable. \r
119\r
120 @param BootMode The value of the boot mode to set.\r
121\r
122 @retval EFI_SUCCESS The value was successfully updated\r
123\r
124**/\r
125EFI_STATUS\r
126EFIAPI\r
127PeiServicesSetBootMode (\r
128 IN EFI_BOOT_MODE BootMode\r
129 );\r
130\r
131/**\r
132 This service enables a PEIM to ascertain the address of the list of HOBs in memory.\r
133\r
134 @param HobList A pointer to the list of HOBs that the PEI Foundation will initialize.\r
135\r
136 @retval EFI_SUCCESS The list was successfully returned.\r
137 @retval EFI_NOT_AVAILABLE_YET The HOB list is not yet published.\r
138\r
139**/\r
140EFI_STATUS\r
141EFIAPI\r
142PeiServicesGetHobList (\r
143 IN OUT VOID **HobList\r
144 );\r
145\r
146/**\r
147 This service enables PEIMs to create various types of HOBs.\r
148\r
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
152\r
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
155\r
156**/\r
157EFI_STATUS\r
158EFIAPI\r
159PeiServicesCreateHob (\r
160 IN UINT16 Type,\r
161 IN UINT16 Length,\r
162 IN OUT VOID **Hob\r
163 );\r
164\r
165/**\r
166 This service enables PEIMs to discover additional firmware volumes.\r
167\r
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
171\r
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
175\r
176**/\r
177EFI_STATUS\r
178EFIAPI\r
179PeiServicesFfsFindNextVolume (\r
180 IN UINTN Instance,\r
181 IN OUT EFI_FIRMWARE_VOLUME_HEADER **FwVolHeader\r
182 );\r
183\r
184/**\r
185 This service enables PEIMs to discover additional firmware files.\r
186\r
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
191\r
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
195\r
196**/\r
197EFI_STATUS\r
198EFIAPI\r
199PeiServicesFfsFindNextFile (\r
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
204\r
205/**\r
206 This service enables PEIMs to discover sections of a given type within a valid FFS file.\r
207\r
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
212\r
213 @retval EFI_SUCCESS The section was found.\r
214 @retval EFI_NOT_FOUND The section was not found.\r
215\r
216**/\r
217EFI_STATUS\r
218EFIAPI\r
219PeiServicesFfsFindSectionData (\r
220 IN EFI_SECTION_TYPE SectionType,\r
221 IN EFI_FFS_FILE_HEADER *FfsFileHeader,\r
222 IN OUT VOID **SectionData\r
223 );\r
224\r
225/**\r
226 This service enables PEIMs to register the permanent memory configuration\r
227 that has been initialized with the PEI Foundation.\r
228\r
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
231\r
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
235\r
236**/\r
237EFI_STATUS\r
238EFIAPI\r
239PeiServicesInstallPeiMemory (\r
240 IN EFI_PHYSICAL_ADDRESS MemoryBegin,\r
241 IN UINT64 MemoryLength\r
242 );\r
243\r
244/**\r
245 This service enables PEIMs to allocate memory after the permanent memory has been installed by a\r
246 PEIM.\r
247\r
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
251\r
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
256\r
257**/\r
258EFI_STATUS\r
259EFIAPI\r
260PeiServicesAllocatePages (\r
261 IN EFI_MEMORY_TYPE MemoryType,\r
262 IN UINTN Pages,\r
263 IN OUT EFI_PHYSICAL_ADDRESS *Memory\r
264 );\r
265\r
266/**\r
267 This service allocates memory from the Hand-Off Block (HOB) heap.\r
268\r
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
272\r
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
275\r
276**/\r
277EFI_STATUS\r
278EFIAPI\r
279PeiServicesAllocatePool (\r
280 IN UINTN Size,\r
281 OUT VOID **Buffer\r
282 );\r
283\r
284/**\r
285 This service resets the entire platform, including all processors and devices, and reboots the\r
286 system. \r
287\r
288 @retval EFI_NOT_AVAILABLE_YET The service has not been installed yet.\r
289\r
290**/\r
291EFI_STATUS\r
292EFIAPI\r
293PeiServicesResetSystem (\r
294 VOID\r
295 );\r
296\r
297\r
298#endif\r