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