]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Include/Library/UefiLib.h
Remove unused declarations from the UEFI Runtime Library for:
[mirror_edk2.git] / MdePkg / Include / Library / UefiLib.h
CommitLineData
fb3df220 1/** @file\r
50a64e5b 2 Provides library functions for common UEFI operations. Only available to DXE\r
3 and UEFI module types.\r
4\r
e500088c 5 The UEFI Library provides functions and macros that simplify the development of \r
6 UEFI Drivers and UEFI Applications. These functions and macros help manage EFI \r
7 events, build simple locks utilizing EFI Task Priority Levels (TPLs), install \r
8 EFI Driver Model related protocols, manage Unicode string tables for UEFI Drivers, \r
9 and print messages on the console output and standard error devices.\r
fb3df220 10\r
cf8ae2f6 11Copyright (c) 2006 - 2008, Intel Corporation<BR>\r
50a64e5b 12All rights reserved. This program and the accompanying materials\r
13are licensed and made available under the terms and conditions of the BSD License\r
14which accompanies this distribution. The full text of the license may be found at\r
15http://opensource.org/licenses/bsd-license.php\r
fb3df220 16\r
50a64e5b 17THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
18WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
fb3df220 19\r
20**/\r
21\r
22#ifndef __UEFI_LIB_H__\r
23#define __UEFI_LIB_H__\r
24\r
c7d265a9 25#include <Protocol/DriverBinding.h>\r
26#include <Protocol/DriverConfiguration.h>\r
27#include <Protocol/ComponentName.h>\r
28#include <Protocol/ComponentName2.h>\r
29#include <Protocol/DriverDiagnostics.h>\r
30#include <Protocol/DriverDiagnostics2.h>\r
b3154720 31#include <Protocol/GraphicsOutput.h>\r
c7d265a9 32\r
52ca0d98 33#include <Library/BaseLib.h>\r
34\r
fc30687f 35///\r
36/// Unicode String Table\r
37///\r
fb3df220 38typedef struct {\r
39 CHAR8 *Language;\r
40 CHAR16 *UnicodeString;\r
41} EFI_UNICODE_STRING_TABLE;\r
42\r
fc30687f 43///\r
44/// EFI Lock Status\r
45///\r
fb3df220 46typedef enum {\r
47 EfiLockUninitialized = 0,\r
48 EfiLockReleased = 1,\r
49 EfiLockAcquired = 2\r
50} EFI_LOCK_STATE;\r
51\r
fc30687f 52///\r
53/// EFI Lock \r
54///\r
fb3df220 55typedef struct {\r
56 EFI_TPL Tpl;\r
57 EFI_TPL OwnerTpl;\r
58 EFI_LOCK_STATE Lock;\r
59} EFI_LOCK;\r
60\r
61\r
52ca0d98 62/**\r
63 Macro that returns the number of 100 ns units for a specified number of microseconds.\r
64 Useful for managing EFI timer events.\r
65\r
66 @param Microseconds Number of microseonds.\r
67\r
68 @return The number of 100 ns units equivalent to the number of microseconds specified\r
69 by Microseconds.\r
70\r
71**/\r
72#define EFI_TIMER_PERIOD_MICROSECONDS(Microseconds) MultU64x32((UINT64)(Microseconds), 10)\r
73\r
74\r
75/**\r
76 Macro that returns the number of 100 ns units for a specified number of milliseoconds.\r
77 Useful for managing EFI timer events.\r
78\r
79 @param Milliseconds Number of milliseconds.\r
80\r
81 @return The number of 100 ns units equivalent to the number of milliseconds specified\r
82 by Milliseconds.\r
83\r
84**/\r
85#define EFI_TIMER_PERIOD_MILLISECONDS(Milliseconds) MultU64x32((UINT64)(Milliseconds), 10000)\r
86\r
87\r
88/**\r
89 Macro that returns the number of 100 ns units for a specified number of seoconds.\r
90 Useful for managing EFI timer events.\r
91\r
92 @param Seconds Number of seconds.\r
93\r
94 @return The number of 100 ns units equivalent to the number of seconds specified\r
95 by Seconds.\r
96\r
97**/\r
98#define EFI_TIMER_PERIOD_SECONDS(Seconds) MultU64x32((UINT64)(Seconds), 10000000)\r
99\r
100\r
fb3df220 101/**\r
1d37ab9f 102 Retrieves a pointer to the system configuration table from the EFI System Table\r
103 based on a specified GUID.\r
104 \r
105 This function searches the list of configuration tables stored in the EFI System Table\r
106 for a table with a GUID that matches TableGuid. If a match is found, then a pointer to\r
107 the configuration table is returned in Table., and EFI_SUCCESS is returned. If a matching GUID\r
108 is not found, then EFI_NOT_FOUND is returned.\r
109 If TableGuid is NULL, then ASSERT().\r
110 If Table is NULL, then ASSERT().\r
fb3df220 111\r
112 @param TableGuid Pointer to table's GUID type..\r
113 @param Table Pointer to the table associated with TableGuid in the EFI System Table.\r
114\r
115 @retval EFI_SUCCESS A configuration table matching TableGuid was found.\r
116 @retval EFI_NOT_FOUND A configuration table matching TableGuid could not be found.\r
117\r
118**/\r
119EFI_STATUS\r
120EFIAPI\r
121EfiGetSystemConfigurationTable ( \r
122 IN EFI_GUID *TableGuid,\r
123 OUT VOID **Table\r
124 );\r
125\r
126/**\r
1d37ab9f 127 Creates and returns a notification event and registers that event with all the protocol\r
128 instances specified by ProtocolGuid.\r
129\r
130 This function causes the notification function to be executed for every protocol of type\r
131 ProtocolGuid instance that exists in the system when this function is invoked.\r
132 In addition, every time a protocol of type ProtocolGuid instance is installed or reinstalled,\r
133 the notification function is also executed. This function returns the notification event\r
134 that was created. \r
135 If ProtocolGuid is NULL, then ASSERT().\r
136 If NotifyTpl is not a legal TPL value, then ASSERT().\r
137 If NotifyFunction is NULL, then ASSERT().\r
138 If Registration is NULL, then ASSERT().\r
fb3df220 139\r
140 @param ProtocolGuid Supplies GUID of the protocol upon whose installation the event is fired.\r
141 @param NotifyTpl Supplies the task priority level of the event notifications.\r
142 @param NotifyFunction Supplies the function to notify when the event is signaled.\r
143 @param NotifyContext The context parameter to pass to NotifyFunction.\r
144 @param Registration A pointer to a memory location to receive the registration value.\r
1d37ab9f 145 This value is passed to LocateHandle() to obtain new handles that\r
146 have been added that support the ProtocolGuid-specified protocol. \r
fb3df220 147\r
1d37ab9f 148 @return The notification event that was created.\r
fb3df220 149\r
150**/\r
151EFI_EVENT\r
152EFIAPI\r
153EfiCreateProtocolNotifyEvent(\r
154 IN EFI_GUID *ProtocolGuid,\r
155 IN EFI_TPL NotifyTpl,\r
156 IN EFI_EVENT_NOTIFY NotifyFunction,\r
157 IN VOID *NotifyContext, OPTIONAL\r
158 OUT VOID **Registration\r
159 );\r
160\r
161/**\r
1d37ab9f 162 Creates a named event that can be signaled with EfiNamedEventSignal().\r
163\r
fb3df220 164 This function creates an event using NotifyTpl, NoifyFunction, and NotifyContext.\r
1d37ab9f 165 This event is signaled with EfiNamedEventSignal(). This provides the ability for one or more\r
166 listeners on the same event named by the GUID specified by Name. \r
167 If Name is NULL, then ASSERT().\r
168 If NotifyTpl is not a legal TPL value, then ASSERT().\r
169 If NotifyFunction is NULL, then ASSERT().\r
fb3df220 170\r
171 @param Name Supplies GUID name of the event.\r
172 @param NotifyTpl Supplies the task priority level of the event notifications.\r
173 @param NotifyFunction Supplies the function to notify when the event is signaled.\r
174 @param NotifyContext The context parameter to pass to NotifyFunction. \r
175 @param Registration A pointer to a memory location to receive the registration value.\r
176\r
177 @retval EFI_SUCCESS A named event was created.\r
178 @retval EFI_OUT_OF_RESOURCES There are not enough resource to create the named event.\r
179\r
180**/\r
181EFI_STATUS\r
182EFIAPI\r
183EfiNamedEventListen (\r
184 IN CONST EFI_GUID *Name,\r
185 IN EFI_TPL NotifyTpl,\r
186 IN EFI_EVENT_NOTIFY NotifyFunction,\r
187 IN CONST VOID *NotifyContext, OPTIONAL\r
188 OUT VOID *Registration OPTIONAL\r
189 );\r
190\r
191/**\r
1d37ab9f 192 Signals a named event created with EfiNamedEventListen().\r
193\r
194 This function signals the named event specified by Name. The named event must have been\r
195 created with EfiNamedEventListen().\r
196 If Name is NULL, then ASSERT().\r
fb3df220 197\r
198 @param Name Supplies GUID name of the event.\r
199\r
200 @retval EFI_SUCCESS A named event was signaled.\r
201 @retval EFI_OUT_OF_RESOURCES There are not enough resource to signal the named event.\r
202\r
203**/\r
204EFI_STATUS\r
205EFIAPI\r
206EfiNamedEventSignal (\r
207 IN CONST EFI_GUID *Name\r
208 );\r
209\r
210/** \r
211 Returns the current TPL.\r
212\r
213 This function returns the current TPL. There is no EFI service to directly \r
214 retrieve the current TPL. Instead, the RaiseTPL() function is used to raise \r
215 the TPL to TPL_HIGH_LEVEL. This will return the current TPL. The TPL level \r
216 can then immediately be restored back to the current TPL level with a call \r
217 to RestoreTPL().\r
218\r
01aef47b 219 @return The current TPL.\r
fb3df220 220\r
221**/\r
222EFI_TPL\r
223EFIAPI\r
224EfiGetCurrentTpl (\r
225 VOID\r
226 );\r
227\r
228/**\r
1d37ab9f 229 Initializes a basic mutual exclusion lock.\r
230\r
fb3df220 231 This function initializes a basic mutual exclusion lock to the released state \r
232 and returns the lock. Each lock provides mutual exclusion access at its task \r
233 priority level. Since there is no preemption or multiprocessor support in EFI,\r
234 acquiring the lock only consists of raising to the locks TPL.\r
1d37ab9f 235 If Lock is NULL, then ASSERT().\r
236 If Priority is not a valid TPL value, then ASSERT().\r
fb3df220 237\r
238 @param Lock A pointer to the lock data structure to initialize.\r
239 @param Priority EFI TPL associated with the lock.\r
240\r
241 @return The lock.\r
242\r
243**/\r
244EFI_LOCK *\r
245EFIAPI\r
246EfiInitializeLock (\r
247 IN OUT EFI_LOCK *Lock,\r
248 IN EFI_TPL Priority\r
249 );\r
250\r
251/**\r
cf8ae2f6 252 Initializes a basic mutual exclusion lock.\r
253\r
fb3df220 254 This macro initializes the contents of a basic mutual exclusion lock to the \r
255 released state. Each lock provides mutual exclusion access at its task \r
256 priority level. Since there is no preemption or multiprocessor support in EFI,\r
257 acquiring the lock only consists of raising to the locks TPL.\r
258\r
fb3df220 259 @param Priority The task priority level of the lock.\r
260\r
261 @return The lock.\r
262\r
263**/\r
264#define EFI_INITIALIZE_LOCK_VARIABLE(Priority) \\r
50615d1f 265 {Priority, TPL_APPLICATION, EfiLockReleased }\r
fb3df220 266\r
267\r
268/**\r
fb3df220 269 Macro that calls DebugAssert() if an EFI_LOCK structure is not in the locked state.\r
270\r
271 If the DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit of PcdDebugProperyMask is set, \r
272 then this macro evaluates the EFI_LOCK structure specified by Lock. If Lock \r
273 is not in the locked state, then DebugAssert() is called passing in the source \r
274 filename, source line number, and Lock.\r
fb3df220 275 If Lock is NULL, then ASSERT().\r
276\r
277 @param LockParameter A pointer to the lock to acquire.\r
278\r
279**/\r
280#define ASSERT_LOCKED(LockParameter) \\r
281 do { \\r
282 if (DebugAssertEnabled ()) { \\r
283 ASSERT (LockParameter != NULL); \\r
284 if ((LockParameter)->Lock != EfiLockAcquired) { \\r
285 _ASSERT (LockParameter not locked); \\r
286 } \\r
287 } \\r
288 } while (FALSE)\r
289\r
290\r
291/**\r
1d37ab9f 292 Acquires ownership of a lock.\r
293\r
fb3df220 294 This function raises the system's current task priority level to the task \r
295 priority level of the mutual exclusion lock. Then, it places the lock in the \r
296 acquired state.\r
1d37ab9f 297 If Lock is NULL, then ASSERT().\r
298 If Lock is not initialized, then ASSERT().\r
299 If Lock is already in the acquired state, then ASSERT().\r
fb3df220 300\r
01aef47b 301 @param Lock A pointer to the lock to acquire.\r
fb3df220 302\r
303**/\r
304VOID\r
305EFIAPI\r
306EfiAcquireLock (\r
307 IN EFI_LOCK *Lock\r
308 );\r
309\r
310/**\r
cf8ae2f6 311 Acquires ownership of a lock.\r
1d37ab9f 312\r
cf8ae2f6 313 This function raises the system's current task priority level to the task priority\r
314 level of the mutual exclusion lock. Then, it attempts to place the lock in the acquired state.\r
315 If the lock is already in the acquired state, then EFI_ACCESS_DENIED is returned.\r
316 Otherwise, EFI_SUCCESS is returned.\r
1d37ab9f 317 If Lock is NULL, then ASSERT().\r
318 If Lock is not initialized, then ASSERT().\r
fb3df220 319\r
320 @param Lock A pointer to the lock to acquire.\r
321\r
322 @retval EFI_SUCCESS The lock was acquired.\r
323 @retval EFI_ACCESS_DENIED The lock could not be acquired because it is already owned.\r
324\r
325**/\r
326EFI_STATUS\r
327EFIAPI\r
328EfiAcquireLockOrFail (\r
329 IN EFI_LOCK *Lock\r
330 );\r
331\r
332/**\r
1d37ab9f 333 Releases ownership of a lock.\r
334\r
fb3df220 335 This function transitions a mutual exclusion lock from the acquired state to \r
336 the released state, and restores the system's task priority level to its \r
337 previous level.\r
1d37ab9f 338 If Lock is NULL, then ASSERT().\r
339 If Lock is not initialized, then ASSERT().\r
340 If Lock is already in the released state, then ASSERT().\r
fb3df220 341\r
342 @param Lock A pointer to the lock to release.\r
343\r
344**/\r
345VOID\r
346EFIAPI\r
347EfiReleaseLock (\r
348 IN EFI_LOCK *Lock\r
349 );\r
350\r
0c9d7395 351/**\r
352 Tests whether a controller handle is being managed by a specific driver.\r
353\r
fb3df220 354 This function tests whether the driver specified by DriverBindingHandle is\r
355 currently managing the controller specified by ControllerHandle. This test\r
356 is performed by evaluating if the the protocol specified by ProtocolGuid is\r
357 present on ControllerHandle and is was opened by DriverBindingHandle with an\r
358 attribute of EFI_OPEN_PROTOCOL_BY_DRIVER. \r
359 If ProtocolGuid is NULL, then ASSERT().\r
0c9d7395 360\r
361 @param ControllerHandle A handle for a controller to test.\r
362 @param DriverBindingHandle Specifies the driver binding handle for the\r
363 driver.\r
364 @param ProtocolGuid Specifies the protocol that the driver specified\r
365 by DriverBindingHandle opens in its Start()\r
366 function.\r
367\r
368 @retval EFI_SUCCESS ControllerHandle is managed by the driver\r
369 specifed by DriverBindingHandle.\r
370 @retval EFI_UNSUPPORTED ControllerHandle is not managed by the driver\r
371 specifed by DriverBindingHandle.\r
372\r
fb3df220 373**/\r
374EFI_STATUS\r
375EFIAPI\r
376EfiTestManagedDevice (\r
377 IN CONST EFI_HANDLE ControllerHandle,\r
378 IN CONST EFI_HANDLE DriverBindingHandle,\r
379 IN CONST EFI_GUID *ProtocolGuid\r
380 );\r
381\r
0c9d7395 382/**\r
383 Tests whether a child handle is a child device of the controller.\r
384\r
fb3df220 385 This function tests whether ChildHandle is one of the children of\r
386 ControllerHandle. This test is performed by checking to see if the protocol\r
387 specified by ProtocolGuid is present on ControllerHandle and opened by\r
388 ChildHandle with an attribute of EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER.\r
389 If ProtocolGuid is NULL, then ASSERT().\r
0c9d7395 390\r
391 @param ControllerHandle A handle for a (parent) controller to test. \r
392 @param ChildHandle A child handle to test.\r
01aef47b 393 @param ProtocolGuid Supplies the protocol that the child controller\r
0c9d7395 394 opens on its parent controller. \r
395\r
396 @retval EFI_SUCCESS ChildHandle is a child of the ControllerHandle.\r
397 @retval EFI_UNSUPPORTED ChildHandle is not a child of the\r
398 ControllerHandle.\r
399\r
fb3df220 400**/\r
401EFI_STATUS\r
402EFIAPI\r
403EfiTestChildHandle (\r
404 IN CONST EFI_HANDLE ControllerHandle,\r
405 IN CONST EFI_HANDLE ChildHandle,\r
406 IN CONST EFI_GUID *ProtocolGuid\r
407 );\r
408\r
409/**\r
1d37ab9f 410 This function looks up a Unicode string in UnicodeStringTable.\r
411\r
cf8ae2f6 412 If Language is a member of SupportedLanguages and a Unicode string is found in\r
1d37ab9f 413 UnicodeStringTable that matches the language code specified by Language, then it\r
414 is returned in UnicodeString.\r
fb3df220 415\r
416 @param Language A pointer to the ISO 639-2 language code for the \r
417 Unicode string to look up and return.\r
418 @param SupportedLanguages A pointer to the set of ISO 639-2 language codes \r
419 that the Unicode string table supports. Language \r
420 must be a member of this set.\r
421 @param UnicodeStringTable A pointer to the table of Unicode strings.\r
422 @param UnicodeString A pointer to the Unicode string from UnicodeStringTable\r
423 that matches the language specified by Language.\r
424\r
425 @retval EFI_SUCCESS The Unicode string that matches the language \r
426 specified by Language was found\r
427 in the table of Unicoide strings UnicodeStringTable, \r
428 and it was returned in UnicodeString.\r
429 @retval EFI_INVALID_PARAMETER Language is NULL.\r
430 @retval EFI_INVALID_PARAMETER UnicodeString is NULL.\r
431 @retval EFI_UNSUPPORTED SupportedLanguages is NULL.\r
432 @retval EFI_UNSUPPORTED UnicodeStringTable is NULL.\r
433 @retval EFI_UNSUPPORTED The language specified by Language is not a \r
434 member of SupportedLanguages.\r
435 @retval EFI_UNSUPPORTED The language specified by Language is not \r
436 supported by UnicodeStringTable.\r
437\r
438**/\r
439EFI_STATUS\r
440EFIAPI\r
441LookupUnicodeString (\r
442 IN CONST CHAR8 *Language,\r
443 IN CONST CHAR8 *SupportedLanguages,\r
444 IN CONST EFI_UNICODE_STRING_TABLE *UnicodeStringTable,\r
445 OUT CHAR16 **UnicodeString\r
446 );\r
447\r
a73480f6 448/**\r
449 This function looks up a Unicode string in UnicodeStringTable.\r
1d37ab9f 450\r
cf8ae2f6 451 If Language is a member of SupportedLanguages and a Unicode string is found in\r
452 UnicodeStringTable that matches the language code specified by Language, then\r
453 it is returned in UnicodeString.\r
454\r
455 @param Language A pointer to an ASCII string containing the ISO 639-2 or the\r
456 RFC 4646 language code for the Unicode string to look up and\r
457 return. If Iso639Language is TRUE, then this ASCII string is\r
458 not assumed to be Null-terminated, and only the first three\r
459 chacters are used. If Iso639Language is FALSE, then this ASCII\r
460 string must be Null-terminated. \r
461 @param SupportedLanguages A pointer to a Null-terminated ASCII string that contains a\r
462 set of ISO 639-2 or RFC 4646 language codes that the Unicode\r
463 string table supports. Language must be a member of this set.\r
464 If Iso639Language is TRUE, then this string contains one or more\r
465 ISO 639-2 language codes with no separator characters. If Iso639Language\r
466 is FALSE, then is string contains one or more RFC 4646 language\r
467 codes separated by ';'.\r
468 @param UnicodeStringTable A pointer to the table of Unicode strings. Type EFI_UNICODE_STRING_TABLE\r
469 is defined in "Related Definitions".\r
470 @param UnicodeString A pointer to the Null-terminated Unicode string from UnicodeStringTable\r
471 that matches the language specified by Language.\r
472 @param Iso639Language Specifies the supported language code format. If it is TRUE, then\r
473 Language and SupportedLanguages follow ISO 639-2 language code format.\r
474 Otherwise, they follow RFC 4646 language code format.\r
475\r
476\r
477 @retval EFI_SUCCESS The Unicode string that matches the language specified by Language\r
478 was found in the table of Unicode strings UnicodeStringTable, and\r
479 it was returned in UnicodeString.\r
1d37ab9f 480 @retval EFI_INVALID_PARAMETER Language is NULL. \r
481 @retval EFI_INVALID_PARAMETER UnicodeString is NULL. \r
482 @retval EFI_UNSUPPORTED SupportedLanguages is NULL. \r
483 @retval EFI_UNSUPPORTED UnicodeStringTable is NULL. \r
cf8ae2f6 484 @retval EFI_UNSUPPORTED The language specified by Language is not a member of SupportedLanguages. \r
485 @retval EFI_UNSUPPORTED The language specified by Language is not supported by UnicodeStringTable.\r
a73480f6 486\r
487**/\r
488EFI_STATUS\r
489EFIAPI\r
490LookupUnicodeString2 (\r
491 IN CONST CHAR8 *Language,\r
492 IN CONST CHAR8 *SupportedLanguages,\r
493 IN CONST EFI_UNICODE_STRING_TABLE *UnicodeStringTable,\r
494 OUT CHAR16 **UnicodeString,\r
495 IN BOOLEAN Iso639Language\r
ed66e1bc 496 );\r
a73480f6 497\r
fb3df220 498/**\r
499 This function adds a Unicode string to UnicodeStringTable.\r
1d37ab9f 500\r
fb3df220 501 If Language is a member of SupportedLanguages then UnicodeString is added to \r
502 UnicodeStringTable. New buffers are allocated for both Language and \r
503 UnicodeString. The contents of Language and UnicodeString are copied into \r
504 these new buffers. These buffers are automatically freed when \r
505 FreeUnicodeStringTable() is called.\r
506\r
507 @param Language A pointer to the ISO 639-2 language code for the Unicode \r
508 string to add.\r
509 @param SupportedLanguages A pointer to the set of ISO 639-2 language codes\r
510 that the Unicode string table supports.\r
511 Language must be a member of this set.\r
512 @param UnicodeStringTable A pointer to the table of Unicode strings.\r
513 @param UnicodeString A pointer to the Unicode string to add.\r
514\r
515 @retval EFI_SUCCESS The Unicode string that matches the language \r
516 specified by Language was found in the table of \r
517 Unicode strings UnicodeStringTable, and it was \r
518 returned in UnicodeString.\r
519 @retval EFI_INVALID_PARAMETER Language is NULL.\r
520 @retval EFI_INVALID_PARAMETER UnicodeString is NULL.\r
521 @retval EFI_INVALID_PARAMETER UnicodeString is an empty string.\r
522 @retval EFI_UNSUPPORTED SupportedLanguages is NULL.\r
523 @retval EFI_ALREADY_STARTED A Unicode string with language Language is \r
524 already present in UnicodeStringTable.\r
525 @retval EFI_OUT_OF_RESOURCES There is not enough memory to add another \r
526 Unicode string to UnicodeStringTable.\r
527 @retval EFI_UNSUPPORTED The language specified by Language is not a \r
528 member of SupportedLanguages.\r
529\r
530**/\r
531EFI_STATUS\r
532EFIAPI\r
533AddUnicodeString (\r
534 IN CONST CHAR8 *Language,\r
535 IN CONST CHAR8 *SupportedLanguages,\r
536 IN EFI_UNICODE_STRING_TABLE **UnicodeStringTable,\r
537 IN CONST CHAR16 *UnicodeString\r
538 );\r
539\r
a73480f6 540/**\r
cf8ae2f6 541 This function adds the Null-terminated Unicode string specified by UnicodeString\r
542 to UnicodeStringTable.\r
543\r
544 If Language is a member of SupportedLanguages then UnicodeString is added to\r
545 UnicodeStringTable. New buffers are allocated for both Language and UnicodeString.\r
546 The contents of Language and UnicodeString are copied into these new buffers.\r
547 These buffers are automatically freed when EfiLibFreeUnicodeStringTable() is called.\r
548\r
549 @param Language A pointer to an ASCII string containing the ISO 639-2 or\r
550 the RFC 4646 language code for the Unicode string to add.\r
551 If Iso639Language is TRUE, then this ASCII string is not\r
552 assumed to be Null-terminated, and only the first three\r
553 chacters are used. If Iso639Language is FALSE, then this\r
554 ASCII string must be Null-terminated.\r
555 @param SupportedLanguages A pointer to a Null-terminated ASCII string that contains\r
556 a set of ISO 639-2 or RFC 4646 language codes that the Unicode\r
557 string table supports. Language must be a member of this set.\r
558 If Iso639Language is TRUE, then this string contains one or more\r
559 ISO 639-2 language codes with no separator characters.\r
560 If Iso639Language is FALSE, then is string contains one or more\r
561 RFC 4646 language codes separated by ';'.\r
562 @param UnicodeStringTable A pointer to the table of Unicode strings. Type EFI_UNICODE_STRING_TABLE\r
563 is defined in "Related Definitions".\r
564 @param UnicodeString A pointer to the Unicode string to add. \r
565 @param Iso639Language Specifies the supported language code format. If it is TRUE,\r
566 then Language and SupportedLanguages follow ISO 639-2 language code format.\r
567 Otherwise, they follow RFC 4646 language code format.\r
568\r
569 @retval EFI_SUCCESS The Unicode string that matches the language specified by\r
570 Language was found in the table of Unicode strings UnicodeStringTable,\r
571 and it was returned in UnicodeString. \r
572 @retval EFI_INVALID_PARAMETER Language is NULL. \r
573 @retval EFI_INVALID_PARAMETER UnicodeString is NULL. \r
574 @retval EFI_INVALID_PARAMETER UnicodeString is an empty string. \r
575 @retval EFI_UNSUPPORTED SupportedLanguages is NULL. \r
576 @retval EFI_ALREADY_STARTED A Unicode string with language Language is already present in\r
577 UnicodeStringTable. \r
578 @retval EFI_OUT_OF_RESOURCES There is not enough memory to add another Unicode string UnicodeStringTable. \r
579 @retval EFI_UNSUPPORTED The language specified by Language is not a member of SupportedLanguages.\r
a73480f6 580\r
581**/\r
582EFI_STATUS\r
583EFIAPI\r
584AddUnicodeString2 (\r
585 IN CONST CHAR8 *Language,\r
586 IN CONST CHAR8 *SupportedLanguages,\r
587 IN EFI_UNICODE_STRING_TABLE **UnicodeStringTable,\r
588 IN CONST CHAR16 *UnicodeString,\r
589 IN BOOLEAN Iso639Language\r
ed66e1bc 590 );\r
a73480f6 591\r
fb3df220 592/**\r
593 This function frees the table of Unicode strings in UnicodeStringTable.\r
1d37ab9f 594\r
fb3df220 595 If UnicodeStringTable is NULL, then EFI_SUCCESS is returned.\r
596 Otherwise, each language code, and each Unicode string in the Unicode string \r
597 table are freed, and EFI_SUCCESS is returned.\r
598\r
599 @param UnicodeStringTable A pointer to the table of Unicode strings.\r
600\r
601 @retval EFI_SUCCESS The Unicode string table was freed.\r
602\r
603**/\r
604EFI_STATUS\r
605EFIAPI\r
606FreeUnicodeStringTable (\r
607 IN EFI_UNICODE_STRING_TABLE *UnicodeStringTable\r
608 );\r
609\r
610/**\r
cf8ae2f6 611 Retrieves the width of a Unicode character.\r
612\r
613 This function computes and returns the width of the Unicode character specified\r
614 by UnicodeChar.\r
fb3df220 615\r
616 @param UnicodeChar A Unicode character.\r
617\r
618 @retval 0 The width if UnicodeChar could not be determined.\r
619 @retval 1 UnicodeChar is a narrow glyph.\r
620 @retval 2 UnicodeChar is a wide glyph.\r
621\r
622**/\r
623UINTN\r
624EFIAPI\r
625GetGlyphWidth (\r
626 IN CHAR16 UnicodeChar\r
627 );\r
628\r
629/**\r
1d37ab9f 630 Computes the display length of a Null-terminated Unicode String.\r
631\r
cf8ae2f6 632 This function computes and returns the display length of the Null-terminated Unicode\r
633 string specified by String. If String is NULL then 0 is returned. If any of the widths\r
634 of the Unicode characters in String can not be determined, then 0 is returned. The display\r
635 width of String can be computed by summing the display widths of each Unicode character\r
636 in String. Unicode characters that are narrow glyphs have a width of 1, and Unicode\r
637 characters that are width glyphs have a width of 2. \r
638 If String is not aligned on a 16-bit boundary, then ASSERT().\r
fb3df220 639\r
640 @param String A pointer to a Null-terminated Unicode string.\r
641\r
642 @return The display length of the Null-terminated Unicode string specified by String.\r
643 \r
644**/\r
645UINTN\r
646EFIAPI\r
647UnicodeStringDisplayLength (\r
648 IN CONST CHAR16 *String\r
649 );\r
650\r
651//\r
652// Functions that abstract early Framework contamination of UEFI.\r
653//\r
654/**\r
1d37ab9f 655 Create, Signal, and Close the Ready to Boot event using EfiSignalEventReadyToBoot().\r
fb3df220 656 \r
1d37ab9f 657 This function abstracts the signaling of the Ready to Boot Event. The Framework moved\r
cf8ae2f6 658 from a proprietary to UEFI 2.0 based mechanism. This library abstracts the caller\r
659 from how this event is created to prevent to code form having to change with the\r
660 version of the specification supported.\r
fb3df220 661\r
662**/\r
663VOID\r
664EFIAPI\r
665EfiSignalEventReadyToBoot (\r
666 VOID\r
667 );\r
668\r
669/**\r
1d37ab9f 670 Create, Signal, and Close the Ready to Boot event using EfiSignalEventLegacyBoot().\r
671\r
672 This function abstracts the signaling of the Legacy Boot Event. The Framework moved from\r
673 a proprietary to UEFI 2.0 based mechanism. This library abstracts the caller from how\r
674 this event is created to prevent to code form having to change with the version of the\r
675 specification supported.\r
fb3df220 676\r
677**/\r
678VOID\r
679EFIAPI\r
680EfiSignalEventLegacyBoot (\r
681 VOID\r
682 );\r
683\r
684/**\r
cf8ae2f6 685 Creates an EFI event in the Legacy Boot Event Group.\r
686\r
687 Prior to UEFI 2.0 this was done via a non blessed UEFI extensions and this library\r
688 abstracts the implementation mechanism of this event from the caller. This function\r
689 abstracts the creation of the Legacy Boot Event. The Framework moved from a proprietary\r
690 to UEFI 2.0 based mechanism. This library abstracts the caller from how this event\r
691 is created to prevent to code form having to change with the version of the\r
692 specification supported.\r
7f1eba7b 693 If LegacyBootEvent is NULL, then ASSERT().\r
fb3df220 694\r
695 @param LegacyBootEvent Returns the EFI event returned from gBS->CreateEvent(Ex).\r
696\r
697 @retval EFI_SUCCESS Event was created.\r
698 @retval Other Event was not created.\r
699\r
700**/\r
701EFI_STATUS\r
702EFIAPI\r
703EfiCreateEventLegacyBoot (\r
704 OUT EFI_EVENT *LegacyBootEvent\r
705 );\r
706\r
707/**\r
708 Create an EFI event in the Legacy Boot Event Group and allows\r
709 the caller to specify a notification function. \r
710 \r
711 This function abstracts the creation of the Legacy Boot Event.\r
712 The Framework moved from a proprietary to UEFI 2.0 based mechanism.\r
713 This library abstracts the caller from how this event is created to prevent\r
714 to code form having to change with the version of the specification supported.\r
715 If LegacyBootEvent is NULL, then ASSERT().\r
716\r
717 @param NotifyTpl The task priority level of the event.\r
718 @param NotifyFunction The notification function to call when the event is signaled.\r
719 @param NotifyContext The content to pass to NotifyFunction when the event is signaled.\r
720 @param LegacyBootEvent Returns the EFI event returned from gBS->CreateEvent(Ex).\r
721\r
722 @retval EFI_SUCCESS Event was created.\r
723 @retval Other Event was not created.\r
724\r
725**/\r
726EFI_STATUS\r
727EFIAPI\r
728EfiCreateEventLegacyBootEx (\r
729 IN EFI_TPL NotifyTpl,\r
730 IN EFI_EVENT_NOTIFY NotifyFunction, OPTIONAL\r
731 IN VOID *NotifyContext, OPTIONAL\r
732 OUT EFI_EVENT *LegacyBootEvent\r
733 );\r
734\r
735/**\r
cf8ae2f6 736 Create an EFI event in the Ready To Boot Event Group.\r
737\r
738 Prior to UEFI 2.0 this was done via a non-standard UEFI extension, and this library\r
739 abstracts the implementation mechanism of this event from the caller. \r
7f1eba7b 740 This function abstracts the creation of the Ready to Boot Event. The Framework \r
741 moved from a proprietary to UEFI 2.0-based mechanism. This library abstracts \r
742 the caller from how this event is created to prevent the code form having to \r
743 change with the version of the specification supported.\r
744 If ReadyToBootEvent is NULL, then ASSERT().\r
fb3df220 745\r
01aef47b 746 @param ReadyToBootEvent Returns the EFI event returned from gBS->CreateEvent(Ex).\r
fb3df220 747\r
748 @retval EFI_SUCCESS Event was created.\r
749 @retval Other Event was not created.\r
750\r
751**/\r
752EFI_STATUS\r
753EFIAPI\r
754EfiCreateEventReadyToBoot (\r
755 OUT EFI_EVENT *ReadyToBootEvent\r
756 );\r
757\r
758/**\r
759 Create an EFI event in the Ready To Boot Event Group and allows\r
760 the caller to specify a notification function. \r
761 \r
762 This function abstracts the creation of the Ready to Boot Event.\r
763 The Framework moved from a proprietary to UEFI 2.0 based mechanism.\r
764 This library abstracts the caller from how this event is created to prevent\r
765 to code form having to change with the version of the specification supported.\r
766 If ReadyToBootEvent is NULL, then ASSERT().\r
767\r
768 @param NotifyTpl The task priority level of the event.\r
769 @param NotifyFunction The notification function to call when the event is signaled.\r
770 @param NotifyContext The content to pass to NotifyFunction when the event is signaled.\r
01aef47b 771 @param ReadyToBootEvent Returns the EFI event returned from gBS->CreateEvent(Ex).\r
fb3df220 772\r
773 @retval EFI_SUCCESS Event was created.\r
774 @retval Other Event was not created.\r
775\r
776**/\r
777EFI_STATUS\r
778EFIAPI\r
779EfiCreateEventReadyToBootEx (\r
780 IN EFI_TPL NotifyTpl,\r
781 IN EFI_EVENT_NOTIFY NotifyFunction, OPTIONAL\r
782 IN VOID *NotifyContext, OPTIONAL\r
783 OUT EFI_EVENT *ReadyToBootEvent\r
784 );\r
785\r
786/**\r
787 Initialize a Firmware Volume (FV) Media Device Path node.\r
788 \r
7f1eba7b 789 The Framework FwVol Device Path changed to conform to the UEFI 2.0 specification. \r
1d37ab9f 790 This library function abstracts initializing a device path node. \r
7f1eba7b 791 Initialize the MEDIA_FW_VOL_FILEPATH_DEVICE_PATH data structure. This device \r
792 path changed in the DXE CIS version 0.92 in a non back ward compatible way to \r
793 not conflict with the UEFI 2.0 specification. This function abstracts the \r
794 differences from the caller.\r
7f1eba7b 795 If FvDevicePathNode is NULL, then ASSERT().\r
796 If NameGuid is NULL, then ASSERT().\r
797 \r
fb3df220 798 @param FvDevicePathNode Pointer to a FV device path node to initialize\r
799 @param NameGuid FV file name to use in FvDevicePathNode\r
800\r
801**/\r
802VOID\r
803EFIAPI\r
804EfiInitializeFwVolDevicepathNode (\r
805 IN OUT MEDIA_FW_VOL_FILEPATH_DEVICE_PATH *FvDevicePathNode,\r
806 IN CONST EFI_GUID *NameGuid\r
807 );\r
808\r
809/**\r
810 Check to see if the Firmware Volume (FV) Media Device Path is valid \r
811 \r
7f1eba7b 812 The Framework FwVol Device Path changed to conform to the UEFI 2.0 specification. \r
813 This library function abstracts validating a device path node.\r
7f1eba7b 814 Check the MEDIA_FW_VOL_FILEPATH_DEVICE_PATH data structure to see if it's valid. \r
815 If it is valid, then return the GUID file name from the device path node. Otherwise, \r
816 return NULL. This device path changed in the DXE CIS version 0.92 in a non back ward \r
817 compatible way to not conflict with the UEFI 2.0 specification. This function abstracts \r
818 the differences from the caller.\r
819 If FvDevicePathNode is NULL, then ASSERT().\r
fb3df220 820\r
821 @param FvDevicePathNode Pointer to FV device path to check.\r
822\r
823 @retval NULL FvDevicePathNode is not valid.\r
824 @retval Other FvDevicePathNode is valid and pointer to NameGuid was returned.\r
825\r
826**/\r
827EFI_GUID *\r
828EFIAPI\r
829EfiGetNameGuidFromFwVolDevicePathNode (\r
830 IN CONST MEDIA_FW_VOL_FILEPATH_DEVICE_PATH *FvDevicePathNode\r
831 );\r
832\r
833/** \r
834 Prints a formatted Unicode string to the console output device specified by \r
835 ConOut defined in the EFI_SYSTEM_TABLE.\r
836\r
837 This function prints a formatted Unicode string to the console output device \r
838 specified by ConOut in EFI_SYSTEM_TABLE and returns the number of Unicode \r
839 characters that printed to ConOut. If the length of the formatted Unicode \r
840 string is greater than PcdUefiLibMaxPrintBufferSize, then only the first \r
841 PcdUefiLibMaxPrintBufferSize characters are sent to ConOut.\r
1d37ab9f 842 If Format is NULL, then ASSERT().\r
843 If Format is not aligned on a 16-bit boundary, then ASSERT().\r
fb3df220 844\r
845 @param Format Null-terminated Unicode format string.\r
285010e7 846 @param ... Variable argument list whose contents are accessed based \r
847 on the format string specified by Format.\r
9199040c 848 \r
849 @return Number of Unicode characters printed to ConOut.\r
fb3df220 850\r
851**/\r
852UINTN\r
853EFIAPI\r
854Print (\r
855 IN CONST CHAR16 *Format,\r
856 ...\r
857 );\r
858\r
859/** \r
860 Prints a formatted Unicode string to the console output device specified by \r
861 StdErr defined in the EFI_SYSTEM_TABLE.\r
862\r
863 This function prints a formatted Unicode string to the console output device \r
864 specified by StdErr in EFI_SYSTEM_TABLE and returns the number of Unicode \r
865 characters that printed to StdErr. If the length of the formatted Unicode \r
866 string is greater than PcdUefiLibMaxPrintBufferSize, then only the first \r
867 PcdUefiLibMaxPrintBufferSize characters are sent to StdErr.\r
1d37ab9f 868 If Format is NULL, then ASSERT().\r
869 If Format is not aligned on a 16-bit boundary, then ASSERT().\r
fb3df220 870\r
871 @param Format Null-terminated Unicode format string.\r
285010e7 872 @param ... Variable argument list whose contents are accessed based \r
873 on the format string specified by Format.\r
9199040c 874 \r
875 @return Number of Unicode characters printed to StdErr.\r
fb3df220 876\r
877**/\r
878UINTN\r
879EFIAPI\r
880ErrorPrint (\r
881 IN CONST CHAR16 *Format,\r
882 ...\r
883 );\r
884\r
885/** \r
886 Prints a formatted ASCII string to the console output device specified by \r
887 ConOut defined in the EFI_SYSTEM_TABLE.\r
888\r
889 This function prints a formatted ASCII string to the console output device \r
890 specified by ConOut in EFI_SYSTEM_TABLE and returns the number of ASCII \r
891 characters that printed to ConOut. If the length of the formatted ASCII \r
892 string is greater than PcdUefiLibMaxPrintBufferSize, then only the first \r
893 PcdUefiLibMaxPrintBufferSize characters are sent to ConOut.\r
1d37ab9f 894 If Format is NULL, then ASSERT().\r
fb3df220 895\r
896 @param Format Null-terminated ASCII format string.\r
285010e7 897 @param ... Variable argument list whose contents are accessed based \r
898 on the format string specified by Format.\r
9199040c 899 \r
900 @return Number of ASCII characters printed to ConOut.\r
fb3df220 901\r
902**/\r
903UINTN\r
904EFIAPI\r
905AsciiPrint (\r
906 IN CONST CHAR8 *Format,\r
907 ...\r
908 );\r
909\r
910/** \r
911 Prints a formatted ASCII string to the console output device specified by \r
912 StdErr defined in the EFI_SYSTEM_TABLE.\r
913\r
914 This function prints a formatted ASCII string to the console output device \r
915 specified by StdErr in EFI_SYSTEM_TABLE and returns the number of ASCII \r
916 characters that printed to StdErr. If the length of the formatted ASCII \r
917 string is greater than PcdUefiLibMaxPrintBufferSize, then only the first \r
918 PcdUefiLibMaxPrintBufferSize characters are sent to StdErr.\r
1d37ab9f 919 If Format is NULL, then ASSERT().\r
fb3df220 920\r
921 @param Format Null-terminated ASCII format string.\r
285010e7 922 @param ... Variable argument list whose contents are accessed based \r
923 on the format string specified by Format.\r
9199040c 924 \r
925 @return Number of ASCII characters printed to ConErr.\r
fb3df220 926\r
927**/\r
928UINTN\r
929EFIAPI\r
930AsciiErrorPrint (\r
931 IN CONST CHAR8 *Format,\r
932 ...\r
933 );\r
934\r
b3154720 935/**\r
936 Prints a formatted Unicode string to a graphics console device specified by \r
937 ConsoleOutputHandle defined in the EFI_SYSTEM_TABLE at the given (X,Y) coordinates.\r
938\r
939 This function prints a formatted Unicode string to the graphics console device \r
940 specified by ConsoleOutputHandle in EFI_SYSTEM_TABLE and returns the number of \r
941 Unicode characters printed. If the length of the formatted Unicode string is\r
942 greater than PcdUefiLibMaxPrintBufferSize, then only the first \r
943 PcdUefiLibMaxPrintBufferSize characters are printed. The EFI_HII_FONT_PROTOCOL\r
944 is used to convert the string to a bitmap using the glyphs registered with the \r
945 HII database. No wrapping is performed, so any portions of the string the fall\r
946 outside the active display region will not be displayed.\r
947\r
948 If a graphics console device is not associated with the ConsoleOutputHandle \r
949 defined in the EFI_SYSTEM_TABLE then no string is printed, and 0 is returned.\r
950 If the EFI_HII_FONT_PROTOCOL is not present in the handle database, then no \r
951 string is printed, and 0 is returned.\r
952 If Format is NULL, then ASSERT().\r
953 If Format is not aligned on a 16-bit boundary, then ASSERT().\r
954\r
955 @param X X coordinate to print the string.\r
956 @param Y Y coordinate to print the string.\r
957 @param ForeGround The forground color of the string being printed. This is\r
958 an optional parameter that may be NULL. If it is NULL,\r
959 then the foreground color of the current ConOut device\r
960 in the EFI_SYSTEM_TABLE is used.\r
961 @param BackGround The background color of the string being printed. This is\r
962 an optional parameter that may be NULL. If it is NULL, \r
963 then the background color of the current ConOut device\r
964 in the EFI_SYSTEM_TABLE is used.\r
965 @param Format Null-terminated Unicode format string. See Print Library \r
966 for the supported format string syntax.\r
967 @param ... Variable argument list whose contents are accessed based on \r
968 the format string specified by Format. \r
969\r
970 @return The number of Unicode characters printed.\r
971\r
972**/\r
973UINTN\r
974EFIAPI\r
975PrintXY (\r
976 IN UINTN X,\r
977 IN UINTN Y,\r
978 IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL *ForeGround, OPTIONAL\r
979 IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL *BackGround, OPTIONAL\r
980 IN CONST CHAR16 *Format,\r
981 ...\r
982 );\r
983\r
984/**\r
985 Prints a formatted ASCII string to a graphics console device specified by \r
986 ConsoleOutputHandle defined in the EFI_SYSTEM_TABLE at the given (X,Y) coordinates.\r
987\r
988 This function prints a formatted ASCII string to the graphics console device \r
989 specified by ConsoleOutputHandle in EFI_SYSTEM_TABLE and returns the number of \r
990 ASCII characters printed. If the length of the formatted ASCII string is\r
991 greater than PcdUefiLibMaxPrintBufferSize, then only the first \r
992 PcdUefiLibMaxPrintBufferSize characters are printed. The EFI_HII_FONT_PROTOCOL\r
993 is used to convert the string to a bitmap using the glyphs registered with the \r
994 HII database. No wrapping is performed, so any portions of the string the fall\r
995 outside the active display region will not be displayed.\r
996\r
997 If a graphics console device is not associated with the ConsoleOutputHandle \r
998 defined in the EFI_SYSTEM_TABLE then no string is printed, and 0 is returned.\r
999 If the EFI_HII_FONT_PROTOCOL is not present in the handle database, then no \r
1000 string is printed, and 0 is returned.\r
1001 If Format is NULL, then ASSERT().\r
b3154720 1002\r
1003 @param X X coordinate to print the string.\r
1004 @param Y Y coordinate to print the string.\r
1005 @param ForeGround The forground color of the string being printed. This is\r
1006 an optional parameter that may be NULL. If it is NULL,\r
1007 then the foreground color of the current ConOut device\r
1008 in the EFI_SYSTEM_TABLE is used.\r
1009 @param BackGround The background color of the string being printed. This is\r
1010 an optional parameter that may be NULL. If it is NULL, \r
1011 then the background color of the current ConOut device\r
1012 in the EFI_SYSTEM_TABLE is used.\r
1013 @param Format Null-terminated ASCII format string. See Print Library \r
1014 for the supported format string syntax.\r
1015 @param ... Variable argument list whose contents are accessed based on \r
1016 the format string specified by Format. \r
1017\r
1018 @return The number of ASCII characters printed.\r
1019\r
1020**/\r
1021UINTN\r
1022EFIAPI\r
1023AsciiPrintXY (\r
1024 IN UINTN X,\r
1025 IN UINTN Y,\r
1026 IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL *ForeGround, OPTIONAL\r
1027 IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL *BackGround, OPTIONAL\r
1028 IN CONST CHAR8 *Format,\r
1029 ...\r
1030 );\r
1031\r
c7d265a9 1032/**\r
cf8ae2f6 1033 Installs and completes the initialization of a Driver Binding Protocol instance.\r
1034 \r
1035 Installs the Driver Binding Protocol specified by DriverBinding onto the handle\r
1036 specified by DriverBindingHandle. If DriverBindingHandle is NULL, then DriverBinding\r
1037 is installed onto a newly created handle. DriverBindingHandle is typically the same\r
1038 as the driver's ImageHandle, but it can be different if the driver produces multiple\r
1039 Driver Binding Protocols. \r
1040 If DriverBinding is NULL, then ASSERT(). \r
1041 If DriverBinding can not be installed onto a handle, then ASSERT().\r
1042\r
1043 @param ImageHandle The image handle of the driver.\r
1044 @param SystemTable The EFI System Table that was passed to the driver's entry point.\r
1045 @param DriverBinding A Driver Binding Protocol instance that this driver is producing.\r
1046 @param DriverBindingHandle The handle that DriverBinding is to be installed onto. If this\r
1047 parameter is NULL, then a new handle is created.\r
1048\r
1049 @retval EFI_SUCCESS The protocol installation is completed successfully.\r
1050 @retval EFI_OUT_OF_RESOURCES There was not enough system resources to install the protocol.\r
1051 @retval Others Status from gBS->InstallMultipleProtocolInterfaces().\r
c7d265a9 1052\r
1053**/\r
1054EFI_STATUS\r
1055EFIAPI\r
1056EfiLibInstallDriverBinding (\r
1057 IN CONST EFI_HANDLE ImageHandle,\r
1058 IN CONST EFI_SYSTEM_TABLE *SystemTable,\r
1059 IN EFI_DRIVER_BINDING_PROTOCOL *DriverBinding,\r
1060 IN EFI_HANDLE DriverBindingHandle\r
1061 );\r
1062\r
c7d265a9 1063\r
f662c194 1064/**\r
cf8ae2f6 1065 Installs and completes the initialization of a Driver Binding Protocol instance and\r
1066 optionally installs the Component Name, Driver Configuration and Driver Diagnostics Protocols.\r
1067\r
1068 Initializes a driver by installing the Driver Binding Protocol together with the\r
1069 optional Component Name, optional Driver Configure and optional Driver Diagnostic\r
1070 Protocols onto the driver's DriverBindingHandle. If DriverBindingHandle is NULL,\r
1071 then the protocols are installed onto a newly created handle. DriverBindingHandle\r
1072 is typically the same as the driver's ImageHandle, but it can be different if the\r
1073 driver produces multiple Driver Binding Protocols. \r
1074 If DriverBinding is NULL, then ASSERT(). \r
1075 If the installation fails, then ASSERT().\r
1076 \r
1077 @param ImageHandle The image handle of the driver.\r
1078 @param SystemTable The EFI System Table that was passed to the driver's entry point.\r
1079 @param DriverBinding A Driver Binding Protocol instance that this driver is producing.\r
1080 @param DriverBindingHandle The handle that DriverBinding is to be installed onto. If this\r
1081 parameter is NULL, then a new handle is created.\r
1082 @param ComponentName A Component Name Protocol instance that this driver is producing.\r
1083 @param DriverConfiguration A Driver Configuration Protocol instance that this driver is producing.\r
1084 @param DriverDiagnostics A Driver Diagnostics Protocol instance that this driver is producing.\r
1085\r
1086 @retval EFI_SUCCESS The protocol installation is completed successfully.\r
1087 @retval EFI_OUT_OF_RESOURCES There was not enough memory in pool to install all the protocols.\r
c7d265a9 1088\r
1089**/\r
1090EFI_STATUS\r
1091EFIAPI\r
1092EfiLibInstallAllDriverProtocols (\r
1093 IN CONST EFI_HANDLE ImageHandle,\r
1094 IN CONST EFI_SYSTEM_TABLE *SystemTable,\r
1095 IN EFI_DRIVER_BINDING_PROTOCOL *DriverBinding,\r
1096 IN EFI_HANDLE DriverBindingHandle,\r
1097 IN CONST EFI_COMPONENT_NAME_PROTOCOL *ComponentName, OPTIONAL\r
1098 IN CONST EFI_DRIVER_CONFIGURATION_PROTOCOL *DriverConfiguration, OPTIONAL\r
1099 IN CONST EFI_DRIVER_DIAGNOSTICS_PROTOCOL *DriverDiagnostics OPTIONAL\r
1100 );\r
1101\r
1102\r
f662c194 1103\r
c7d265a9 1104/**\r
cf8ae2f6 1105 Installs Driver Binding Protocol with optional Component Name and Component Name 2 Protocols.\r
1106\r
1107 Initializes a driver by installing the Driver Binding Protocol together with the\r
1108 optional Component Name and optional Component Name 2 protocols onto the driver's\r
1109 DriverBindingHandle. If DriverBindingHandle is NULL, then the protocols are installed\r
1110 onto a newly created handle. DriverBindingHandle is typically the same as the driver's\r
1111 ImageHandle, but it can be different if the driver produces multiple Driver Binding Protocols. \r
1112 If DriverBinding is NULL, then ASSERT(). \r
1113 If the installation fails, then ASSERT().\r
1114\r
1115 @param ImageHandle The image handle of the driver.\r
1116 @param SystemTable The EFI System Table that was passed to the driver's entry point.\r
1117 @param DriverBinding A Driver Binding Protocol instance that this driver is producing.\r
1118 @param DriverBindingHandle The handle that DriverBinding is to be installed onto. If this\r
1119 parameter is NULL, then a new handle is created.\r
1120 @param ComponentName A Component Name Protocol instance that this driver is producing.\r
1121 @param ComponentName2 A Component Name 2 Protocol instance that this driver is producing.\r
1122\r
1123 @retval EFI_SUCCESS The protocol installation is completed successfully.\r
1124 @retval EFI_OUT_OF_RESOURCES There was not enough memory in pool to install all the protocols.\r
f662c194 1125\r
1126**/\r
1127EFI_STATUS\r
1128EFIAPI\r
1129EfiLibInstallDriverBindingComponentName2 (\r
1130 IN CONST EFI_HANDLE ImageHandle,\r
1131 IN CONST EFI_SYSTEM_TABLE *SystemTable,\r
1132 IN EFI_DRIVER_BINDING_PROTOCOL *DriverBinding,\r
1133 IN EFI_HANDLE DriverBindingHandle,\r
1134 IN CONST EFI_COMPONENT_NAME_PROTOCOL *ComponentName, OPTIONAL\r
1135 IN CONST EFI_COMPONENT_NAME2_PROTOCOL *ComponentName2 OPTIONAL\r
1136 );\r
1137\r
1138\r
1139/**\r
cf8ae2f6 1140 Installs Driver Binding Protocol with optional Component Name, Component Name 2, Driver\r
1141 Configuration, Driver Configuration 2, Driver Diagnostics, and Driver Diagnostics 2 Protocols.\r
1142\r
1143 Initializes a driver by installing the Driver Binding Protocol together with the optional\r
1144 Component Name, optional Component Name 2, optional Driver Configuration, optional Driver\r
1145 Configuration 2, optional Driver Diagnostic, and optional Driver Diagnostic 2 Protocols\r
1146 onto the driver's DriverBindingHandle. DriverBindingHandle is typically the same as the\r
1147 driver's ImageHandle, but it can be different if the driver produces multiple Driver Binding Protocols. \r
1148 If DriverBinding is NULL, then ASSERT(). \r
1149 If the installation fails, then ASSERT(). \r
1150\r
1151 @param ImageHandle The image handle of the driver.\r
1152 @param SystemTable The EFI System Table that was passed to the driver's entry point.\r
1153 @param DriverBinding A Driver Binding Protocol instance that this driver is producing.\r
1154 @param DriverBindingHandle The handle that DriverBinding is to be installe onto. If this\r
1155 parameter is NULL, then a new handle is created.\r
1156 @param ComponentName A Component Name Protocol instance that this driver is producing.\r
1157 @param ComponentName2 A Component Name 2 Protocol instance that this driver is producing.\r
1158 @param DriverConfiguration A Driver Configuration Protocol instance that this driver is producing.\r
1159 @param DriverConfiguration2 A Driver Configuration Protocol 2 instance that this driver is producing.\r
1160 @param DriverDiagnostics A Driver Diagnostics Protocol instance that this driver is producing.\r
1161 @param DriverDiagnostics2 A Driver Diagnostics Protocol 2 instance that this driver is producing.\r
1162\r
1163 @retval EFI_SUCCESS The protocol installation is completed successfully.\r
1164 @retval EFI_OUT_OF_RESOURCES There was not enough memory in pool to install all the protocols.\r
c7d265a9 1165\r
1166**/\r
1167EFI_STATUS\r
1168EFIAPI\r
1169EfiLibInstallAllDriverProtocols2 (\r
1170 IN CONST EFI_HANDLE ImageHandle,\r
1171 IN CONST EFI_SYSTEM_TABLE *SystemTable,\r
1172 IN EFI_DRIVER_BINDING_PROTOCOL *DriverBinding,\r
1173 IN EFI_HANDLE DriverBindingHandle,\r
def220c4 1174 IN CONST EFI_COMPONENT_NAME_PROTOCOL *ComponentName, OPTIONAL\r
1175 IN CONST EFI_COMPONENT_NAME2_PROTOCOL *ComponentName2, OPTIONAL\r
1176 IN CONST EFI_DRIVER_CONFIGURATION_PROTOCOL *DriverConfiguration, OPTIONAL\r
1177 IN CONST EFI_DRIVER_CONFIGURATION_PROTOCOL *DriverConfiguration2, OPTIONAL\r
1178 IN CONST EFI_DRIVER_DIAGNOSTICS_PROTOCOL *DriverDiagnostics, OPTIONAL\r
1179 IN CONST EFI_DRIVER_DIAGNOSTICS2_PROTOCOL *DriverDiagnostics2 OPTIONAL\r
c7d265a9 1180 );\r
1181\r
fb3df220 1182#endif\r