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