]>
Commit | Line | Data |
---|---|---|
3eb9473e | 1 | /*++\r |
2 | \r | |
3e99020d | 3 | Copyright (c) 2004 - 2010, Intel Corporation. All rights reserved.<BR>\r |
2c7e5c2f | 4 | This program and the accompanying materials \r |
3eb9473e | 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 | EdkIIGlueUefiLib.h\r | |
16 | \r | |
17 | Abstract: \r | |
18 | \r | |
19 | Public header file for UEFI Lib\r | |
20 | \r | |
21 | --*/\r | |
22 | \r | |
23 | #ifndef __EDKII_GLUE_UEFI_LIB_H__\r | |
24 | #define __EDKII_GLUE_UEFI_LIB_H__\r | |
25 | \r | |
26 | \r | |
27 | #define EfiInitializeLock(_LOCK, _PRIORITY) GlueEfiInitializeLock(_LOCK, _PRIORITY)\r | |
28 | #define EfiAcquireLock(_LOCK) GlueEfiAcquireLock(_LOCK)\r | |
29 | #define EfiAcquireLockOrFail(_LOCK) GlueEfiAcquireLockOrFail(_LOCK)\r | |
30 | #define EfiReleaseLock(_LOCK) GlueEfiReleaseLock(_LOCK)\r | |
31 | #define GetGlyphWidth(_UNICODECHAR) GlueGetGlyphWidth(_UNICODECHAR)\r | |
32 | #define EfiCreateEventLegacyBoot(_LEGACYBOOT) GlueEfiCreateEventLegacyBoot(_LEGACYBOOT)\r | |
33 | #define EfiCreateEventReadyToBoot(_READYTOBOOTEVENT) GlueEfiCreateEventReadyToBoot(_READYTOBOOTEVENT)\r | |
34 | #define EfiGetNameGuidFromFwVolDevicePathNode(_FVDEVICEPATHNODE) GlueEfiGetNameGuidFromFwVolDevicePathNode(_FVDEVICEPATHNODE)\r | |
35 | #define EfiInitializeFwVolDevicepathNode(_FVDEVICEPATHNODE, _NAMEGUID) GlueEfiInitializeFwVolDevicepathNode(_FVDEVICEPATHNODE, _NAMEGUID)\r | |
36 | \r | |
37 | \r | |
38 | //\r | |
39 | // EFI Lock Status\r | |
40 | //\r | |
41 | typedef enum {\r | |
42 | EfiLockUninitialized = 0,\r | |
43 | EfiLockReleased = 1,\r | |
44 | EfiLockAcquired = 2\r | |
45 | } EFI_LOCK_STATE;\r | |
46 | \r | |
47 | \r | |
48 | /**\r | |
49 | This function searches the list of configuration tables stored in the EFI System \r | |
50 | Table for a table with a GUID that matches TableGuid. If a match is found, \r | |
51 | then a pointer to the configuration table is returned in Table, and EFI_SUCCESS \r | |
52 | is returned. If a matching GUID is not found, then EFI_NOT_FOUND is returned.\r | |
53 | \r | |
54 | @param TableGuid Pointer to table's GUID type..\r | |
55 | @param Table Pointer to the table associated with TableGuid in the EFI System Table.\r | |
56 | \r | |
57 | @retval EFI_SUCCESS A configuration table matching TableGuid was found.\r | |
58 | @retval EFI_NOT_FOUND A configuration table matching TableGuid could not be found.\r | |
59 | \r | |
60 | **/\r | |
61 | EFI_STATUS\r | |
62 | EFIAPI\r | |
63 | EfiGetSystemConfigurationTable ( \r | |
64 | IN EFI_GUID *TableGuid,\r | |
65 | OUT VOID **Table\r | |
66 | );\r | |
67 | \r | |
68 | /**\r | |
69 | This function causes the notification function to be executed for every protocol \r | |
70 | of type ProtocolGuid instance that exists in the system when this function is \r | |
71 | invoked. In addition, every time a protocol of type ProtocolGuid instance is \r | |
72 | installed or reinstalled, the notification function is also executed.\r | |
73 | \r | |
74 | @param ProtocolGuid Supplies GUID of the protocol upon whose installation the event is fired.\r | |
75 | @param NotifyTpl Supplies the task priority level of the event notifications.\r | |
76 | @param NotifyFunction Supplies the function to notify when the event is signaled.\r | |
77 | @param NotifyContext The context parameter to pass to NotifyFunction.\r | |
78 | @param Registration A pointer to a memory location to receive the registration value.\r | |
79 | \r | |
80 | @return The notification event that was created. \r | |
81 | \r | |
82 | **/\r | |
83 | EFI_EVENT\r | |
84 | EFIAPI\r | |
85 | EfiCreateProtocolNotifyEvent(\r | |
86 | IN EFI_GUID *ProtocolGuid,\r | |
87 | IN EFI_TPL NotifyTpl,\r | |
88 | IN EFI_EVENT_NOTIFY NotifyFunction,\r | |
89 | IN VOID *NotifyContext, OPTIONAL\r | |
90 | OUT VOID **Registration\r | |
91 | );\r | |
92 | \r | |
93 | /**\r | |
94 | This function creates an event using NotifyTpl, NoifyFunction, and NotifyContext.\r | |
95 | This event is signaled with EfiNamedEventSignal(). This provide the ability for \r | |
96 | one or more listeners on the same event named by the GUID specified by Name.\r | |
97 | \r | |
98 | @param Name Supplies GUID name of the event.\r | |
99 | @param NotifyTpl Supplies the task priority level of the event notifications.\r | |
100 | @param NotifyFunction Supplies the function to notify when the event is signaled.\r | |
101 | @param NotifyContext The context parameter to pass to NotifyFunction. \r | |
102 | @param Registration A pointer to a memory location to receive the registration value.\r | |
103 | \r | |
104 | @retval EFI_SUCCESS A named event was created.\r | |
105 | @retval EFI_OUT_OF_RESOURCES There are not enough resource to create the named event.\r | |
106 | \r | |
107 | **/\r | |
108 | EFI_STATUS\r | |
109 | EFIAPI\r | |
110 | EfiNamedEventListen (\r | |
111 | IN CONST EFI_GUID *Name,\r | |
112 | IN EFI_TPL NotifyTpl,\r | |
113 | IN EFI_EVENT_NOTIFY NotifyFunction,\r | |
114 | IN CONST VOID *NotifyContext, OPTIONAL\r | |
115 | OUT VOID *Registration OPTIONAL\r | |
116 | );\r | |
117 | \r | |
118 | /**\r | |
119 | This function signals the named event specified by Name. The named event must \r | |
120 | have been created with EfiNamedEventListen().\r | |
121 | \r | |
122 | @param Name Supplies GUID name of the event.\r | |
123 | \r | |
124 | @retval EFI_SUCCESS A named event was signaled.\r | |
125 | @retval EFI_OUT_OF_RESOURCES There are not enough resource to signal the named event.\r | |
126 | \r | |
127 | **/\r | |
128 | EFI_STATUS\r | |
129 | EFIAPI\r | |
130 | EfiNamedEventSignal (\r | |
131 | IN CONST EFI_GUID *Name\r | |
132 | );\r | |
133 | \r | |
134 | /** \r | |
135 | Returns the current TPL.\r | |
136 | \r | |
137 | This function returns the current TPL. There is no EFI service to directly \r | |
138 | retrieve the current TPL. Instead, the RaiseTPL() function is used to raise \r | |
139 | the TPL to TPL_HIGH_LEVEL. This will return the current TPL. The TPL level \r | |
140 | can then immediately be restored back to the current TPL level with a call \r | |
141 | to RestoreTPL().\r | |
142 | \r | |
143 | @param VOID\r | |
144 | \r | |
145 | @retvale EFI_TPL The current TPL.\r | |
146 | \r | |
147 | **/\r | |
148 | EFI_TPL\r | |
149 | EFIAPI\r | |
150 | EfiGetCurrentTpl (\r | |
151 | VOID\r | |
152 | );\r | |
153 | \r | |
154 | /**\r | |
155 | This function initializes a basic mutual exclusion lock to the released state \r | |
156 | and returns the lock. Each lock provides mutual exclusion access at its task \r | |
157 | priority level. Since there is no preemption or multiprocessor support in EFI,\r | |
158 | acquiring the lock only consists of raising to the locks TPL.\r | |
159 | \r | |
160 | @param Lock A pointer to the lock data structure to initialize.\r | |
161 | @param Priority EFI TPL associated with the lock.\r | |
162 | \r | |
163 | @return The lock.\r | |
164 | \r | |
165 | **/\r | |
166 | EFI_LOCK *\r | |
167 | EFIAPI\r | |
168 | GlueEfiInitializeLock (\r | |
169 | IN OUT EFI_LOCK *Lock,\r | |
170 | IN EFI_TPL Priority\r | |
171 | );\r | |
172 | \r | |
173 | /**\r | |
174 | This macro initializes the contents of a basic mutual exclusion lock to the \r | |
175 | released state. Each lock provides mutual exclusion access at its task \r | |
176 | priority level. Since there is no preemption or multiprocessor support in EFI,\r | |
177 | acquiring the lock only consists of raising to the locks TPL.\r | |
178 | \r | |
179 | @param Lock A pointer to the lock data structure to initialize.\r | |
180 | @param Priority The task priority level of the lock.\r | |
181 | \r | |
182 | @return The lock.\r | |
183 | \r | |
184 | **/\r | |
185 | #ifdef EFI_INITIALIZE_LOCK_VARIABLE\r | |
186 | #undef EFI_INITIALIZE_LOCK_VARIABLE\r | |
187 | #endif\r | |
188 | \r | |
189 | #define EFI_INITIALIZE_LOCK_VARIABLE(Priority) \\r | |
190 | {Priority, EFI_TPL_APPLICATION, EfiLockReleased }\r | |
191 | \r | |
192 | \r | |
193 | /**\r | |
194 | \r | |
195 | Macro that calls DebugAssert() if an EFI_LOCK structure is not in the locked state.\r | |
196 | \r | |
197 | If the DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit of PcdDebugProperyMask is set, \r | |
198 | then this macro evaluates the EFI_LOCK structure specified by Lock. If Lock \r | |
199 | is not in the locked state, then DebugAssert() is called passing in the source \r | |
200 | filename, source line number, and Lock.\r | |
201 | \r | |
202 | If Lock is NULL, then ASSERT().\r | |
203 | \r | |
204 | @param LockParameter A pointer to the lock to acquire.\r | |
205 | \r | |
206 | **/\r | |
207 | #ifdef ASSERT_LOCKED\r | |
208 | #undef ASSERT_LOCKED\r | |
209 | #endif\r | |
210 | \r | |
211 | #define ASSERT_LOCKED(LockParameter) \\r | |
212 | do { \\r | |
213 | if (DebugAssertEnabled ()) { \\r | |
214 | ASSERT (LockParameter != NULL); \\r | |
215 | if ((LockParameter)->Lock != EfiLockAcquired) { \\r | |
216 | _ASSERT (LockParameter not locked); \\r | |
217 | } \\r | |
218 | } \\r | |
219 | } while (FALSE)\r | |
220 | \r | |
221 | \r | |
222 | /**\r | |
223 | This function raises the system's current task priority level to the task \r | |
224 | priority level of the mutual exclusion lock. Then, it places the lock in the \r | |
225 | acquired state.\r | |
226 | \r | |
227 | @param Priority The task priority level of the lock.\r | |
228 | \r | |
229 | **/\r | |
230 | VOID\r | |
231 | EFIAPI\r | |
232 | GlueEfiAcquireLock (\r | |
233 | IN EFI_LOCK *Lock\r | |
234 | );\r | |
235 | \r | |
236 | /**\r | |
237 | This function raises the system's current task priority level to the task \r | |
238 | priority level of the mutual exclusion lock. Then, it attempts to place the \r | |
239 | lock in the acquired state.\r | |
240 | \r | |
241 | @param Lock A pointer to the lock to acquire.\r | |
242 | \r | |
243 | @retval EFI_SUCCESS The lock was acquired.\r | |
244 | @retval EFI_ACCESS_DENIED The lock could not be acquired because it is already owned.\r | |
245 | \r | |
246 | **/\r | |
247 | EFI_STATUS\r | |
248 | EFIAPI\r | |
249 | GlueEfiAcquireLockOrFail (\r | |
250 | IN EFI_LOCK *Lock\r | |
251 | );\r | |
252 | \r | |
253 | /**\r | |
254 | This function transitions a mutual exclusion lock from the acquired state to \r | |
255 | the released state, and restores the system's task priority level to its \r | |
256 | previous level.\r | |
257 | \r | |
258 | @param Lock A pointer to the lock to release.\r | |
259 | \r | |
260 | **/\r | |
261 | VOID\r | |
262 | EFIAPI\r | |
263 | GlueEfiReleaseLock (\r | |
264 | IN EFI_LOCK *Lock\r | |
265 | );\r | |
266 | \r | |
267 | /**\r | |
268 | Tests whether a controller handle is being managed by a specific driver.\r | |
269 | \r | |
270 | This function tests whether the driver specified by DriverBindingHandle is\r | |
271 | currently managing the controller specified by ControllerHandle. This test\r | |
272 | is performed by evaluating if the the protocol specified by ProtocolGuid is\r | |
273 | present on ControllerHandle and is was opened by DriverBindingHandle with an\r | |
274 | attribute of EFI_OPEN_PROTOCOL_BY_DRIVER. \r | |
275 | If ProtocolGuid is NULL, then ASSERT().\r | |
276 | \r | |
277 | @param ControllerHandle A handle for a controller to test.\r | |
278 | @param DriverBindingHandle Specifies the driver binding handle for the\r | |
279 | driver.\r | |
280 | @param ProtocolGuid Specifies the protocol that the driver specified\r | |
281 | by DriverBindingHandle opens in its Start()\r | |
282 | function.\r | |
283 | \r | |
284 | @retval EFI_SUCCESS ControllerHandle is managed by the driver\r | |
285 | specifed by DriverBindingHandle.\r | |
286 | @retval EFI_UNSUPPORTED ControllerHandle is not managed by the driver\r | |
287 | specifed by DriverBindingHandle.\r | |
288 | \r | |
289 | **/\r | |
290 | EFI_STATUS\r | |
291 | EFIAPI\r | |
292 | EfiTestManagedDevice (\r | |
293 | IN CONST EFI_HANDLE ControllerHandle,\r | |
294 | IN CONST EFI_HANDLE DriverBindingHandle,\r | |
295 | IN CONST EFI_GUID *ProtocolGuid\r | |
296 | );\r | |
297 | \r | |
298 | /**\r | |
299 | Tests whether a child handle is a child device of the controller.\r | |
300 | \r | |
301 | This function tests whether ChildHandle is one of the children of\r | |
302 | ControllerHandle. This test is performed by checking to see if the protocol\r | |
303 | specified by ProtocolGuid is present on ControllerHandle and opened by\r | |
304 | ChildHandle with an attribute of EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER.\r | |
305 | If ProtocolGuid is NULL, then ASSERT().\r | |
306 | \r | |
307 | @param ControllerHandle A handle for a (parent) controller to test. \r | |
308 | @param ChildHandle A child handle to test.\r | |
309 | @param ConsumsedGuid Supplies the protocol that the child controller\r | |
310 | opens on its parent controller. \r | |
311 | \r | |
312 | @retval EFI_SUCCESS ChildHandle is a child of the ControllerHandle.\r | |
313 | @retval EFI_UNSUPPORTED ChildHandle is not a child of the\r | |
314 | ControllerHandle.\r | |
315 | \r | |
316 | **/\r | |
317 | EFI_STATUS\r | |
318 | EFIAPI\r | |
319 | EfiTestChildHandle (\r | |
320 | IN CONST EFI_HANDLE ControllerHandle,\r | |
321 | IN CONST EFI_HANDLE ChildHandle,\r | |
322 | IN CONST EFI_GUID *ProtocolGuid\r | |
323 | );\r | |
324 | \r | |
325 | /**\r | |
326 | This function looks up a Unicode string in UnicodeStringTable. If Language is \r | |
327 | a member of SupportedLanguages and a Unicode string is found in UnicodeStringTable\r | |
328 | that matches the language code specified by Language, then it is returned in \r | |
329 | UnicodeString.\r | |
330 | \r | |
331 | @param Language A pointer to the ISO 639-2 language code for the \r | |
332 | Unicode string to look up and return.\r | |
333 | @param SupportedLanguages A pointer to the set of ISO 639-2 language codes \r | |
334 | that the Unicode string table supports. Language \r | |
335 | must be a member of this set.\r | |
336 | @param UnicodeStringTable A pointer to the table of Unicode strings.\r | |
337 | @param UnicodeString A pointer to the Unicode string from UnicodeStringTable\r | |
338 | that matches the language specified by Language.\r | |
339 | \r | |
340 | @retval EFI_SUCCESS The Unicode string that matches the language \r | |
341 | specified by Language was found\r | |
342 | in the table of Unicoide strings UnicodeStringTable, \r | |
343 | and it was returned in UnicodeString.\r | |
344 | @retval EFI_INVALID_PARAMETER Language is NULL.\r | |
345 | @retval EFI_INVALID_PARAMETER UnicodeString is NULL.\r | |
346 | @retval EFI_UNSUPPORTED SupportedLanguages is NULL.\r | |
347 | @retval EFI_UNSUPPORTED UnicodeStringTable is NULL.\r | |
348 | @retval EFI_UNSUPPORTED The language specified by Language is not a \r | |
349 | member of SupportedLanguages.\r | |
350 | @retval EFI_UNSUPPORTED The language specified by Language is not \r | |
351 | supported by UnicodeStringTable.\r | |
352 | \r | |
353 | **/\r | |
354 | EFI_STATUS\r | |
355 | EFIAPI\r | |
356 | LookupUnicodeString (\r | |
357 | IN CONST CHAR8 *Language,\r | |
358 | IN CONST CHAR8 *SupportedLanguages,\r | |
359 | IN CONST EFI_UNICODE_STRING_TABLE *UnicodeStringTable,\r | |
360 | OUT CHAR16 **UnicodeString\r | |
361 | );\r | |
362 | \r | |
363 | /**\r | |
364 | This function adds a Unicode string to UnicodeStringTable.\r | |
365 | If Language is a member of SupportedLanguages then UnicodeString is added to \r | |
366 | UnicodeStringTable. New buffers are allocated for both Language and \r | |
367 | UnicodeString. The contents of Language and UnicodeString are copied into \r | |
368 | these new buffers. These buffers are automatically freed when \r | |
369 | FreeUnicodeStringTable() is called.\r | |
370 | \r | |
371 | @param Language A pointer to the ISO 639-2 language code for the Unicode \r | |
372 | string to add.\r | |
373 | @param SupportedLanguages A pointer to the set of ISO 639-2 language codes\r | |
374 | that the Unicode string table supports.\r | |
375 | Language must be a member of this set.\r | |
376 | @param UnicodeStringTable A pointer to the table of Unicode strings.\r | |
377 | @param UnicodeString A pointer to the Unicode string to add.\r | |
378 | \r | |
379 | @retval EFI_SUCCESS The Unicode string that matches the language \r | |
380 | specified by Language was found in the table of \r | |
381 | Unicode strings UnicodeStringTable, and it was \r | |
382 | returned in UnicodeString.\r | |
383 | @retval EFI_INVALID_PARAMETER Language is NULL.\r | |
384 | @retval EFI_INVALID_PARAMETER UnicodeString is NULL.\r | |
385 | @retval EFI_INVALID_PARAMETER UnicodeString is an empty string.\r | |
386 | @retval EFI_UNSUPPORTED SupportedLanguages is NULL.\r | |
387 | @retval EFI_ALREADY_STARTED A Unicode string with language Language is \r | |
388 | already present in UnicodeStringTable.\r | |
389 | @retval EFI_OUT_OF_RESOURCES There is not enough memory to add another \r | |
390 | Unicode string to UnicodeStringTable.\r | |
391 | @retval EFI_UNSUPPORTED The language specified by Language is not a \r | |
392 | member of SupportedLanguages.\r | |
393 | \r | |
394 | **/\r | |
395 | EFI_STATUS\r | |
396 | EFIAPI\r | |
397 | AddUnicodeString (\r | |
398 | IN CONST CHAR8 *Language,\r | |
399 | IN CONST CHAR8 *SupportedLanguages,\r | |
400 | IN EFI_UNICODE_STRING_TABLE **UnicodeStringTable,\r | |
401 | IN CONST CHAR16 *UnicodeString\r | |
402 | );\r | |
403 | \r | |
404 | /**\r | |
405 | This function frees the table of Unicode strings in UnicodeStringTable.\r | |
406 | If UnicodeStringTable is NULL, then EFI_SUCCESS is returned.\r | |
407 | Otherwise, each language code, and each Unicode string in the Unicode string \r | |
408 | table are freed, and EFI_SUCCESS is returned.\r | |
409 | \r | |
410 | @param UnicodeStringTable A pointer to the table of Unicode strings.\r | |
411 | \r | |
412 | @retval EFI_SUCCESS The Unicode string table was freed.\r | |
413 | \r | |
414 | **/\r | |
415 | EFI_STATUS\r | |
416 | EFIAPI\r | |
417 | FreeUnicodeStringTable (\r | |
418 | IN EFI_UNICODE_STRING_TABLE *UnicodeStringTable\r | |
419 | );\r | |
420 | \r | |
421 | /**\r | |
422 | This function computes and returns the width of the Unicode character \r | |
423 | specified by UnicodeChar.\r | |
424 | \r | |
425 | @param UnicodeChar A Unicode character.\r | |
426 | \r | |
427 | @retval 0 The width if UnicodeChar could not be determined.\r | |
428 | @retval 1 UnicodeChar is a narrow glyph.\r | |
429 | @retval 2 UnicodeChar is a wide glyph.\r | |
430 | \r | |
431 | **/\r | |
432 | UINTN\r | |
433 | EFIAPI\r | |
434 | GlueGetGlyphWidth (\r | |
435 | IN CHAR16 UnicodeChar\r | |
436 | );\r | |
437 | \r | |
438 | /**\r | |
439 | This function computes and returns the display length of\r | |
440 | the Null-terminated Unicode string specified by String.\r | |
441 | If String is NULL, then 0 is returned.\r | |
442 | If any of the widths of the Unicode characters in String\r | |
443 | can not be determined, then 0 is returned.\r | |
444 | \r | |
445 | @param String A pointer to a Null-terminated Unicode string.\r | |
446 | \r | |
447 | @return The display length of the Null-terminated Unicode string specified by String.\r | |
448 | \r | |
449 | **/\r | |
450 | UINTN\r | |
451 | EFIAPI\r | |
452 | UnicodeStringDisplayLength (\r | |
453 | IN CONST CHAR16 *String\r | |
454 | );\r | |
455 | \r | |
456 | //\r | |
457 | // Functions that abstract early Framework contamination of UEFI.\r | |
458 | //\r | |
459 | /**\r | |
460 | Signal a Ready to Boot Event. \r | |
461 | \r | |
462 | Create a Ready to Boot Event. Signal it and close it. This causes other \r | |
463 | events of the same event group to be signaled in other modules. \r | |
464 | \r | |
465 | **/\r | |
466 | VOID\r | |
467 | EFIAPI\r | |
468 | EfiSignalEventReadyToBoot (\r | |
469 | VOID\r | |
470 | );\r | |
471 | \r | |
472 | /**\r | |
473 | Signal a Legacy Boot Event. \r | |
474 | \r | |
475 | Create a legacy Boot Event. Signal it and close it. This causes other \r | |
476 | events of the same event group to be signaled in other modules. \r | |
477 | \r | |
478 | **/\r | |
479 | VOID\r | |
480 | EFIAPI\r | |
481 | EfiSignalEventLegacyBoot (\r | |
482 | VOID\r | |
483 | );\r | |
484 | \r | |
485 | /**\r | |
486 | Create a Legacy Boot Event. \r | |
487 | \r | |
488 | Tiano extended the CreateEvent Type enum to add a legacy boot event type. \r | |
489 | This was bad as Tiano did not own the enum. In UEFI 2.0 CreateEventEx was\r | |
490 | added and now it's possible to not voilate the UEFI specification by \r | |
491 | declaring a GUID for the legacy boot event class. This library supports\r | |
492 | the EDK/EFI 1.10 form and EDK II/UEFI 2.0 form and allows common code to \r | |
493 | work both ways.\r | |
494 | \r | |
495 | @param LegacyBootEvent Returns the EFI event returned from gBS->CreateEvent(Ex).\r | |
496 | \r | |
497 | @retval EFI_SUCCESS Event was created.\r | |
498 | @retval Other Event was not created.\r | |
499 | \r | |
500 | **/\r | |
501 | EFI_STATUS\r | |
502 | EFIAPI\r | |
503 | GlueEfiCreateEventLegacyBoot (\r | |
504 | OUT EFI_EVENT *LegacyBootEvent\r | |
505 | );\r | |
506 | \r | |
507 | /**\r | |
508 | Create an EFI event in the Legacy Boot Event Group and allows\r | |
509 | the caller to specify a notification function. \r | |
510 | \r | |
511 | This function abstracts the creation of the Legacy Boot Event.\r | |
512 | The Framework moved from a proprietary to UEFI 2.0 based mechanism.\r | |
513 | This library abstracts the caller from how this event is created to prevent\r | |
514 | to code form having to change with the version of the specification supported.\r | |
515 | If LegacyBootEvent is NULL, then ASSERT().\r | |
516 | \r | |
517 | @param NotifyTpl The task priority level of the event.\r | |
518 | @param NotifyFunction The notification function to call when the event is signaled.\r | |
519 | @param NotifyContext The content to pass to NotifyFunction when the event is signaled.\r | |
520 | @param LegacyBootEvent Returns the EFI event returned from gBS->CreateEvent(Ex).\r | |
521 | \r | |
522 | @retval EFI_SUCCESS Event was created.\r | |
523 | @retval Other Event was not created.\r | |
524 | \r | |
525 | **/\r | |
526 | EFI_STATUS\r | |
527 | EFIAPI\r | |
528 | EfiCreateEventLegacyBootEx (\r | |
529 | IN EFI_TPL NotifyTpl,\r | |
530 | IN EFI_EVENT_NOTIFY NotifyFunction, OPTIONAL\r | |
531 | IN VOID *NotifyContext, OPTIONAL\r | |
532 | OUT EFI_EVENT *LegacyBootEvent\r | |
533 | );\r | |
534 | \r | |
535 | /**\r | |
536 | Create a Read to Boot Event. \r | |
537 | \r | |
538 | Tiano extended the CreateEvent Type enum to add a ready to boot event type. \r | |
539 | This was bad as Tiano did not own the enum. In UEFI 2.0 CreateEventEx was\r | |
540 | added and now it's possible to not voilate the UEFI specification and use \r | |
541 | the ready to boot event class defined in UEFI 2.0. This library supports\r | |
542 | the EDK/EFI 1.10 form and EDKII/UEFI 2.0 form and allows common code to \r | |
543 | work both ways.\r | |
544 | \r | |
545 | @param LegacyBootEvent Returns the EFI event returned from gBS->CreateEvent(Ex).\r | |
546 | \r | |
547 | @retval EFI_SUCCESS Event was created.\r | |
548 | @retval Other Event was not created.\r | |
549 | \r | |
550 | **/\r | |
551 | EFI_STATUS\r | |
552 | EFIAPI\r | |
553 | GlueEfiCreateEventReadyToBoot (\r | |
554 | OUT EFI_EVENT *ReadyToBootEvent\r | |
555 | );\r | |
556 | \r | |
557 | /**\r | |
558 | Create an EFI event in the Ready To Boot Event Group and allows\r | |
559 | the caller to specify a notification function. \r | |
560 | \r | |
561 | This function abstracts the creation of the Ready to Boot Event.\r | |
562 | The Framework moved from a proprietary to UEFI 2.0 based mechanism.\r | |
563 | This library abstracts the caller from how this event is created to prevent\r | |
564 | to code form having to change with the version of the specification supported.\r | |
565 | If ReadyToBootEvent is NULL, then ASSERT().\r | |
566 | \r | |
567 | @param NotifyTpl The task priority level of the event.\r | |
568 | @param NotifyFunction The notification function to call when the event is signaled.\r | |
569 | @param NotifyContext The content to pass to NotifyFunction when the event is signaled.\r | |
570 | @param LegacyBootEvent Returns the EFI event returned from gBS->CreateEvent(Ex).\r | |
571 | \r | |
572 | @retval EFI_SUCCESS Event was created.\r | |
573 | @retval Other Event was not created.\r | |
574 | \r | |
575 | **/\r | |
576 | EFI_STATUS\r | |
577 | EFIAPI\r | |
578 | EfiCreateEventReadyToBootEx (\r | |
579 | IN EFI_TPL NotifyTpl,\r | |
580 | IN EFI_EVENT_NOTIFY NotifyFunction, OPTIONAL\r | |
581 | IN VOID *NotifyContext, OPTIONAL\r | |
582 | OUT EFI_EVENT *ReadyToBootEvent\r | |
583 | );\r | |
584 | \r | |
585 | /**\r | |
586 | Initialize a Firmware Volume (FV) Media Device Path node.\r | |
587 | \r | |
3eb9473e | 588 | @param FvDevicePathNode Pointer to a FV device path node to initialize\r |
589 | @param NameGuid FV file name to use in FvDevicePathNode\r | |
590 | \r | |
591 | **/\r | |
592 | VOID\r | |
593 | EFIAPI\r | |
594 | GlueEfiInitializeFwVolDevicepathNode (\r | |
595 | IN OUT MEDIA_FW_VOL_FILEPATH_DEVICE_PATH *FvDevicePathNode,\r | |
596 | IN CONST EFI_GUID *NameGuid\r | |
597 | );\r | |
598 | \r | |
599 | /**\r | |
600 | Check to see if the Firmware Volume (FV) Media Device Path is valid \r | |
601 | \r | |
3eb9473e | 602 | @param FvDevicePathNode Pointer to FV device path to check.\r |
603 | \r | |
604 | @retval NULL FvDevicePathNode is not valid.\r | |
605 | @retval Other FvDevicePathNode is valid and pointer to NameGuid was returned.\r | |
606 | \r | |
607 | **/\r | |
608 | EFI_GUID *\r | |
609 | EFIAPI\r | |
610 | GlueEfiGetNameGuidFromFwVolDevicePathNode (\r | |
611 | IN CONST MEDIA_FW_VOL_FILEPATH_DEVICE_PATH *FvDevicePathNode\r | |
612 | );\r | |
613 | \r | |
614 | /** \r | |
615 | Prints a formatted Unicode string to the console output device specified by \r | |
616 | ConOut defined in the EFI_SYSTEM_TABLE.\r | |
617 | \r | |
618 | This function prints a formatted Unicode string to the console output device \r | |
619 | specified by ConOut in EFI_SYSTEM_TABLE and returns the number of Unicode \r | |
620 | characters that printed to ConOut. If the length of the formatted Unicode \r | |
621 | string is greater than PcdUefiLibMaxPrintBufferSize, then only the first \r | |
622 | PcdUefiLibMaxPrintBufferSize characters are sent to ConOut.\r | |
623 | \r | |
624 | @param Format Null-terminated Unicode format string.\r | |
625 | @param ... VARARG list consumed to process Format.\r | |
626 | If Format is NULL, then ASSERT().\r | |
627 | If Format is not aligned on a 16-bit boundary, then ASSERT().\r | |
628 | \r | |
629 | **/\r | |
630 | UINTN\r | |
631 | EFIAPI\r | |
632 | Print (\r | |
633 | IN CONST CHAR16 *Format,\r | |
634 | ...\r | |
635 | );\r | |
636 | \r | |
637 | /** \r | |
638 | Prints a formatted Unicode string to the console output device specified by \r | |
639 | StdErr defined in the EFI_SYSTEM_TABLE.\r | |
640 | \r | |
641 | This function prints a formatted Unicode string to the console output device \r | |
642 | specified by StdErr in EFI_SYSTEM_TABLE and returns the number of Unicode \r | |
643 | characters that printed to StdErr. If the length of the formatted Unicode \r | |
644 | string is greater than PcdUefiLibMaxPrintBufferSize, then only the first \r | |
645 | PcdUefiLibMaxPrintBufferSize characters are sent to StdErr.\r | |
646 | \r | |
647 | @param Format Null-terminated Unicode format string.\r | |
648 | @param ... VARARG list consumed to process Format.\r | |
649 | If Format is NULL, then ASSERT().\r | |
650 | If Format is not aligned on a 16-bit boundary, then ASSERT().\r | |
651 | \r | |
652 | **/\r | |
653 | UINTN\r | |
654 | EFIAPI\r | |
655 | ErrorPrint (\r | |
656 | IN CONST CHAR16 *Format,\r | |
657 | ...\r | |
658 | );\r | |
659 | \r | |
660 | /** \r | |
661 | Prints a formatted ASCII string to the console output device specified by \r | |
662 | ConOut defined in the EFI_SYSTEM_TABLE.\r | |
663 | \r | |
664 | This function prints a formatted ASCII string to the console output device \r | |
665 | specified by ConOut in EFI_SYSTEM_TABLE and returns the number of ASCII \r | |
666 | characters that printed to ConOut. If the length of the formatted ASCII \r | |
667 | string is greater than PcdUefiLibMaxPrintBufferSize, then only the first \r | |
668 | PcdUefiLibMaxPrintBufferSize characters are sent to ConOut.\r | |
669 | \r | |
670 | @param Format Null-terminated ASCII format string.\r | |
671 | @param ... VARARG list consumed to process Format.\r | |
672 | If Format is NULL, then ASSERT().\r | |
673 | If Format is not aligned on a 16-bit boundary, then ASSERT().\r | |
674 | \r | |
675 | **/\r | |
676 | UINTN\r | |
677 | EFIAPI\r | |
678 | AsciiPrint (\r | |
679 | IN CONST CHAR8 *Format,\r | |
680 | ...\r | |
681 | );\r | |
682 | \r | |
683 | /** \r | |
684 | Prints a formatted ASCII string to the console output device specified by \r | |
685 | StdErr defined in the EFI_SYSTEM_TABLE.\r | |
686 | \r | |
687 | This function prints a formatted ASCII string to the console output device \r | |
688 | specified by StdErr in EFI_SYSTEM_TABLE and returns the number of ASCII \r | |
689 | characters that printed to StdErr. If the length of the formatted ASCII \r | |
690 | string is greater than PcdUefiLibMaxPrintBufferSize, then only the first \r | |
691 | PcdUefiLibMaxPrintBufferSize characters are sent to StdErr.\r | |
692 | \r | |
693 | @param Format Null-terminated ASCII format string.\r | |
694 | @param ... VARARG list consumed to process Format.\r | |
695 | If Format is NULL, then ASSERT().\r | |
696 | If Format is not aligned on a 16-bit boundary, then ASSERT().\r | |
697 | \r | |
698 | **/\r | |
699 | UINTN\r | |
700 | EFIAPI\r | |
701 | AsciiErrorPrint (\r | |
702 | IN CONST CHAR8 *Format,\r | |
703 | ...\r | |
704 | );\r | |
705 | \r | |
706 | #endif\r |