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