Changeset 58466 in vbox for trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/UefiLib
- Timestamp:
- Oct 29, 2015 4:30:44 AM (9 years ago)
- Location:
- trunk/src/VBox/Devices/EFI/Firmware
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/EFI/Firmware
- Property svn:mergeinfo changed
/vendor/edk2/current merged: 103769-103776
- Property svn:mergeinfo changed
-
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/UefiLib/Console.c
r58459 r58466 3 3 4 4 Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR> 5 This program and the accompanying materials 6 are licensed and made available under the terms and conditions of the BSD License 7 which accompanies this distribution. The full text of the license may be found at 8 http://opensource.org/licenses/bsd-license.php. 9 10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 5 This program and the accompanying materials 6 are licensed and made available under the terms and conditions of the BSD License 7 which accompanies this distribution. The full text of the license may be found at 8 http://opensource.org/licenses/bsd-license.php. 9 10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 12 12 13 13 **/ … … 32 32 {(CHAR16)0x1FFF, 1}, 33 33 /* 34 * Merge the blocks and replace them with the above entry as they fall to 34 * Merge the blocks and replace them with the above entry as they fall to 35 35 * the same category and they are all narrow glyph. This will reduce search 36 36 * time and table size. The merge will omit the reserved code. … … 79 79 {(CHAR16)0x2FFF, 1}, 80 80 /* 81 * Merge the blocks and replace them with the above entry as they fall to 81 * Merge the blocks and replace them with the above entry as they fall to 82 82 * the same category and they are all narrow glyph. This will reduce search 83 83 * time and table size. The merge will omit the reserved code. … … 111 111 {(CHAR16)0x33FF, 2}, 112 112 /* 113 * Merge the blocks and replace them with the above entry as they fall to 113 * Merge the blocks and replace them with the above entry as they fall to 114 114 * the same category and they are all wide glyph. This will reduce search 115 115 * time and table size. The merge will omit the reserved code. … … 134 134 {(CHAR16)0x9FFF, 2}, 135 135 /* 136 * Merge the blocks and replace them with the above entry as they fall to 136 * Merge the blocks and replace them with the above entry as they fall to 137 137 * the same category and they are all wide glyph. This will reduce search 138 138 * time and table size. The merge will omit the reserved code. … … 140 140 * Remove the above item if below is un-commented. 141 141 * 142 {(CHAR16)0x4DFF, 0}, // Reserved. 0x3400-0x4DBF as CJK unified ideographs 142 {(CHAR16)0x4DFF, 0}, // Reserved. 0x3400-0x4DBF as CJK unified ideographs 143 143 // extension A in ver3.0. 0x3400-0x4DFF 144 144 {(CHAR16)0x9FFF, 2}, // CJK unified ideographs. 0x4E00-0x9FFF … … 156 156 {(CHAR16)0xD7FF, 2}, 157 157 /* 158 * Merge the blocks and replace them with the above entry as they fall to 158 * Merge the blocks and replace them with the above entry as they fall to 159 159 * the same category and they are all wide glyph. This will reduce search 160 160 * time and table size. The merge will omit the reserved code. … … 252 252 Computes the display length of a Null-terminated Unicode String. 253 253 254 This function computes and returns the display length of the Null-terminated 255 Unicode string specified by String. If String is NULL then 0 is returned. If 256 any of the widths of the Unicode characters in String can not be determined, 257 then 0 is returned. The display width of String can be computed by summing the 258 display widths of each Unicode character in String. Unicode characters that 259 are narrow glyphs have a width of 1, and Unicode characters that are width glyphs 254 This function computes and returns the display length of the Null-terminated 255 Unicode string specified by String. If String is NULL then 0 is returned. If 256 any of the widths of the Unicode characters in String can not be determined, 257 then 0 is returned. The display width of String can be computed by summing the 258 display widths of each Unicode character in String. Unicode characters that 259 are narrow glyphs have a width of 1, and Unicode characters that are width glyphs 260 260 have a width of 2. If String is not aligned on a 16-bit boundary, then ASSERT(). 261 261 … … 263 263 264 264 @return The display length of the Null-terminated Unicode string specified by String. 265 265 266 266 **/ 267 267 UINTN … … 293 293 294 294 /** 295 Count the storage space of a Unicode string. 295 Count the storage space of a Unicode string. 296 296 297 297 This function handles the Unicode string with NARROW_CHAR … … 304 304 @param LimitLen Whether need to limit the string length. 305 305 @param MaxWidth The max length this function supported. 306 @param Offset The max index of the string can be show out. 306 @param Offset The max index of the string can be show out. 307 307 308 308 @return Storage space for the input string. … … 376 376 377 377 /** 378 Draws a dialog box to the console output device specified by 378 Draws a dialog box to the console output device specified by 379 379 ConOut defined in the EFI_SYSTEM_TABLE and waits for a keystroke 380 from the console input device specified by ConIn defined in the 380 from the console input device specified by ConIn defined in the 381 381 EFI_SYSTEM_TABLE. 382 382 … … 385 385 386 386 @param[in] Attribute Specifies the foreground and background color of the popup. 387 @param[out] Key A pointer to the EFI_KEY value of the key that was 387 @param[out] Key A pointer to the EFI_KEY value of the key that was 388 388 pressed. This is an optional parameter that may be NULL. 389 389 If it is NULL then no wait for a keypress will be performed. 390 390 @param[in] ... The variable argument list that contains pointers to Null- 391 terminated Unicode strings to display in the dialog box. 391 terminated Unicode strings to display in the dialog box. 392 392 The variable argument list is terminated by a NULL. 393 393 … … 396 396 EFIAPI 397 397 CreatePopUp ( 398 IN UINTN Attribute, 398 IN UINTN Attribute, 399 399 OUT EFI_INPUT_KEY *Key, OPTIONAL 400 400 ... … … 418 418 419 419 // 420 // Determine the length of the longest line in the popup and the the total 420 // Determine the length of the longest line in the popup and the the total 421 421 // number of lines in the popup 422 422 // … … 444 444 // 445 445 ConOut = gST->ConOut; 446 446 447 447 // 448 448 // Save the current console cursor position and attributes … … 484 484 485 485 // 486 // Draw top of popup box 486 // Draw top of popup box 487 487 // 488 488 SetMem16 (Line, (MaxLength + 2) * 2, BOXDRAW_HORIZONTAL); -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/UefiLib/UefiDriverModel.c
r58459 r58466 8 8 which accompanies this distribution. The full text of the license may be found at 9 9 http://opensource.org/licenses/bsd-license.php. 10 10 11 11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 12 12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 13 13 14 **/ 14 **/ 15 15 16 16 … … 19 19 /** 20 20 Installs and completes the initialization of a Driver Binding Protocol instance. 21 21 22 22 Installs the Driver Binding Protocol specified by DriverBinding onto the handle 23 23 specified by DriverBindingHandle. If DriverBindingHandle is NULL, then DriverBinding 24 24 is installed onto a newly created handle. DriverBindingHandle is typically the same 25 25 as the driver's ImageHandle, but it can be different if the driver produces multiple 26 Driver Binding Protocols. 27 If DriverBinding is NULL, then ASSERT(). 26 Driver Binding Protocols. 27 If DriverBinding is NULL, then ASSERT(). 28 28 If DriverBinding can not be installed onto a handle, then ASSERT(). 29 29 … … 81 81 then the protocols are installed onto a newly created handle. DriverBindingHandle 82 82 is typically the same as the driver's ImageHandle, but it can be different if the 83 driver produces multiple Driver Binding Protocols. 84 If DriverBinding is NULL, then ASSERT(). 83 driver produces multiple Driver Binding Protocols. 84 If DriverBinding is NULL, then ASSERT(). 85 85 If the installation fails, then ASSERT(). 86 86 87 87 @param ImageHandle The image handle of the driver. 88 88 @param SystemTable The EFI System Table that was passed to the driver's entry point. … … 119 119 DriverBinding->ImageHandle = ImageHandle; 120 120 DriverBinding->DriverBindingHandle = DriverBindingHandle; 121 121 122 122 if (DriverDiagnostics == NULL || FeaturePcdGet(PcdDriverDiagnosticsDisable)) { 123 123 if (DriverConfiguration == NULL) { … … 211 211 DriverBindingHandle. If DriverBindingHandle is NULL, then the protocols are installed 212 212 onto a newly created handle. DriverBindingHandle is typically the same as the driver's 213 ImageHandle, but it can be different if the driver produces multiple Driver Binding Protocols. 214 If DriverBinding is NULL, then ASSERT(). 213 ImageHandle, but it can be different if the driver produces multiple Driver Binding Protocols. 214 If DriverBinding is NULL, then ASSERT(). 215 215 If the installation fails, then ASSERT(). 216 216 … … 300 300 optional Driver Diagnostic, and optional Driver Diagnostic 2 Protocols onto the driver's DriverBindingHandle. 301 301 DriverBindingHandle is typically the same as the driver's ImageHandle, but it can be different if the driver 302 produces multiple Driver Binding Protocols. 303 If DriverBinding is NULL, then ASSERT(). 302 produces multiple Driver Binding Protocols. 303 If DriverBinding is NULL, then ASSERT(). 304 304 If the installation fails, then ASSERT(). 305 305 … … 338 338 EFI_STATUS Status; 339 339 340 ASSERT (DriverBinding != NULL); 340 ASSERT (DriverBinding != NULL); 341 341 342 342 // … … 345 345 DriverBinding->ImageHandle = ImageHandle; 346 346 DriverBinding->DriverBindingHandle = DriverBindingHandle; 347 347 348 348 if (DriverConfiguration2 == NULL) { 349 349 if (DriverConfiguration == NULL) { -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/UefiLib/UefiLib.c
r58459 r58466 1 1 /** @file 2 The UEFI Library provides functions and macros that simplify the development of 3 UEFI Drivers and UEFI Applications. These functions and macros help manage EFI 4 events, build simple locks utilizing EFI Task Priority Levels (TPLs), install 5 EFI Driver Model related protocols, manage Unicode string tables for UEFI Drivers, 2 The UEFI Library provides functions and macros that simplify the development of 3 UEFI Drivers and UEFI Applications. These functions and macros help manage EFI 4 events, build simple locks utilizing EFI Task Priority Levels (TPLs), install 5 EFI Driver Model related protocols, manage Unicode string tables for UEFI Drivers, 6 6 and print messages on the console output and standard error devices. 7 7 … … 21 21 22 22 /** 23 Empty constructor function that is required to resolve dependencies between 23 Empty constructor function that is required to resolve dependencies between 24 24 libraries. 25 25 26 26 ** DO NOT REMOVE ** 27 27 28 28 @param ImageHandle The firmware allocated handle for the EFI image. 29 29 @param SystemTable A pointer to the EFI System Table. 30 30 31 31 @retval EFI_SUCCESS The constructor executed correctly. 32 32 … … 70 70 Retrieves a pointer to the system configuration table from the EFI System Table 71 71 based on a specified GUID. 72 72 73 73 This function searches the list of configuration tables stored in the EFI System Table 74 74 for a table with a GUID that matches TableGuid. If a match is found, then a pointer to … … 119 119 then the notification function is still executed one time. In addition, every time a protocol 120 120 of type ProtocolGuid instance is installed or reinstalled, the notification function is also 121 executed. This function returns the notification event that was created. 121 executed. This function returns the notification event that was created. 122 122 If ProtocolGuid is NULL, then ASSERT(). 123 123 If NotifyTpl is not a legal TPL value, then ASSERT(). … … 132 132 @param Registration A pointer to a memory location to receive the registration value. 133 133 This value is passed to LocateHandle() to obtain new handles that 134 have been added that support the ProtocolGuid-specified protocol. 134 have been added that support the ProtocolGuid-specified protocol. 135 135 136 136 @return The notification event that was created. … … 193 193 This function creates an event using NotifyTpl, NoifyFunction, and NotifyContext. 194 194 This event is signaled with EfiNamedEventSignal(). This provides the ability for one or more 195 listeners on the same event named by the GUID specified by Name. 195 listeners on the same event named by the GUID specified by Name. 196 196 If Name is NULL, then ASSERT(). 197 197 If NotifyTpl is not a legal TPL value, then ASSERT(). … … 201 201 @param NotifyTpl Supplies the task priority level of the event notifications. 202 202 @param NotifyFunction Supplies the function to notify when the event is signaled. 203 @param NotifyContext The context parameter to pass to NotifyFunction. 203 @param NotifyContext The context parameter to pass to NotifyFunction. 204 204 @param Registration A pointer to a memory location to receive the registration value. 205 205 … … 225 225 ASSERT (NotifyFunction != NULL); 226 226 ASSERT (NotifyTpl <= TPL_HIGH_LEVEL); 227 227 228 228 // 229 229 // Create event … … 305 305 } 306 306 307 /** 307 /** 308 308 Returns the current TPL. 309 309 310 This function returns the current TPL. There is no EFI service to directly 311 retrieve the current TPL. Instead, the RaiseTPL() function is used to raise 312 the TPL to TPL_HIGH_LEVEL. This will return the current TPL. The TPL level 313 can then immediately be restored back to the current TPL level with a call 310 This function returns the current TPL. There is no EFI service to directly 311 retrieve the current TPL. Instead, the RaiseTPL() function is used to raise 312 the TPL to TPL_HIGH_LEVEL. This will return the current TPL. The TPL level 313 can then immediately be restored back to the current TPL level with a call 314 314 to RestoreTPL(). 315 315 … … 335 335 Initializes a basic mutual exclusion lock. 336 336 337 This function initializes a basic mutual exclusion lock to the released state 338 and returns the lock. Each lock provides mutual exclusion access at its task 337 This function initializes a basic mutual exclusion lock to the released state 338 and returns the lock. Each lock provides mutual exclusion access at its task 339 339 priority level. Since there is no preemption or multiprocessor support in EFI, 340 340 acquiring the lock only consists of raising to the locks TPL. … … 367 367 Acquires ownership of a lock. 368 368 369 This function raises the system's current task priority level to the task 370 priority level of the mutual exclusion lock. Then, it places the lock in the 369 This function raises the system's current task priority level to the task 370 priority level of the mutual exclusion lock. Then, it places the lock in the 371 371 acquired state. 372 372 If Lock is NULL, then ASSERT(). … … 433 433 Releases ownership of a lock. 434 434 435 This function transitions a mutual exclusion lock from the acquired state to 436 the released state, and restores the system's task priority level to its 435 This function transitions a mutual exclusion lock from the acquired state to 436 the released state, and restores the system's task priority level to its 437 437 previous level. 438 438 If Lock is NULL, then ASSERT(). … … 468 468 is performed by evaluating if the the protocol specified by ProtocolGuid is 469 469 present on ControllerHandle and is was opened by DriverBindingHandle with an 470 attribute of EFI_OPEN_PROTOCOL_BY_DRIVER. 470 attribute of EFI_OPEN_PROTOCOL_BY_DRIVER. 471 471 If ProtocolGuid is NULL, then ASSERT(). 472 472 … … 531 531 If ProtocolGuid is NULL, then ASSERT(). 532 532 533 @param ControllerHandle A handle for a (parent) controller to test. 533 @param ControllerHandle A handle for a (parent) controller to test. 534 534 @param ChildHandle A child handle to test. 535 535 @param ProtocolGuid Supplies the protocol that the child controller 536 opens on its parent controller. 536 opens on its parent controller. 537 537 538 538 @retval EFI_SUCCESS ChildHandle is a child of the ControllerHandle. … … 593 593 is returned in UnicodeString. 594 594 595 @param Language A pointer to the ISO 639-2 language code for the 595 @param Language A pointer to the ISO 639-2 language code for the 596 596 Unicode string to look up and return. 597 @param SupportedLanguages A pointer to the set of ISO 639-2 language codes 598 that the Unicode string table supports. Language 597 @param SupportedLanguages A pointer to the set of ISO 639-2 language codes 598 that the Unicode string table supports. Language 599 599 must be a member of this set. 600 600 @param UnicodeStringTable A pointer to the table of Unicode strings. … … 602 602 that matches the language specified by Language. 603 603 604 @retval EFI_SUCCESS The Unicode string that matches the language 604 @retval EFI_SUCCESS The Unicode string that matches the language 605 605 specified by Language was found 606 in the table of Unicode strings UnicodeStringTable, 606 in the table of Unicode strings UnicodeStringTable, 607 607 and it was returned in UnicodeString. 608 608 @retval EFI_INVALID_PARAMETER Language is NULL. … … 610 610 @retval EFI_UNSUPPORTED SupportedLanguages is NULL. 611 611 @retval EFI_UNSUPPORTED UnicodeStringTable is NULL. 612 @retval EFI_UNSUPPORTED The language specified by Language is not a 612 @retval EFI_UNSUPPORTED The language specified by Language is not a 613 613 member of SupportedLanguages. 614 @retval EFI_UNSUPPORTED The language specified by Language is not 614 @retval EFI_UNSUPPORTED The language specified by Language is not 615 615 supported by UnicodeStringTable. 616 616 … … 685 685 not assumed to be Null-terminated, and only the first three 686 686 characters are used. If Iso639Language is FALSE, then this ASCII 687 string must be Null-terminated. 687 string must be Null-terminated. 688 688 @param SupportedLanguages A pointer to a Null-terminated ASCII string that contains a 689 689 set of ISO 639-2 or RFC 4646 language codes that the Unicode … … 705 705 was found in the table of Unicode strings UnicodeStringTable, and 706 706 it was returned in UnicodeString. 707 @retval EFI_INVALID_PARAMETER Language is NULL. 708 @retval EFI_INVALID_PARAMETER UnicodeString is NULL. 709 @retval EFI_UNSUPPORTED SupportedLanguages is NULL. 710 @retval EFI_UNSUPPORTED UnicodeStringTable is NULL. 711 @retval EFI_UNSUPPORTED The language specified by Language is not a member of SupportedLanguages. 707 @retval EFI_INVALID_PARAMETER Language is NULL. 708 @retval EFI_INVALID_PARAMETER UnicodeString is NULL. 709 @retval EFI_UNSUPPORTED SupportedLanguages is NULL. 710 @retval EFI_UNSUPPORTED UnicodeStringTable is NULL. 711 @retval EFI_UNSUPPORTED The language specified by Language is not a member of SupportedLanguages. 712 712 @retval EFI_UNSUPPORTED The language specified by Language is not supported by UnicodeStringTable. 713 713 … … 795 795 This function adds a Unicode string to UnicodeStringTable. 796 796 797 If Language is a member of SupportedLanguages then UnicodeString is added to 798 UnicodeStringTable. New buffers are allocated for both Language and 799 UnicodeString. The contents of Language and UnicodeString are copied into 800 these new buffers. These buffers are automatically freed when 797 If Language is a member of SupportedLanguages then UnicodeString is added to 798 UnicodeStringTable. New buffers are allocated for both Language and 799 UnicodeString. The contents of Language and UnicodeString are copied into 800 these new buffers. These buffers are automatically freed when 801 801 FreeUnicodeStringTable() is called. 802 802 803 @param Language A pointer to the ISO 639-2 language code for the Unicode 803 @param Language A pointer to the ISO 639-2 language code for the Unicode 804 804 string to add. 805 805 @param SupportedLanguages A pointer to the set of ISO 639-2 language codes … … 809 809 @param UnicodeString A pointer to the Unicode string to add. 810 810 811 @retval EFI_SUCCESS The Unicode string that matches the language 812 specified by Language was found in the table of 813 Unicode strings UnicodeStringTable, and it was 811 @retval EFI_SUCCESS The Unicode string that matches the language 812 specified by Language was found in the table of 813 Unicode strings UnicodeStringTable, and it was 814 814 returned in UnicodeString. 815 815 @retval EFI_INVALID_PARAMETER Language is NULL. … … 817 817 @retval EFI_INVALID_PARAMETER UnicodeString is an empty string. 818 818 @retval EFI_UNSUPPORTED SupportedLanguages is NULL. 819 @retval EFI_ALREADY_STARTED A Unicode string with language Language is 819 @retval EFI_ALREADY_STARTED A Unicode string with language Language is 820 820 already present in UnicodeStringTable. 821 @retval EFI_OUT_OF_RESOURCES There is not enough memory to add another 821 @retval EFI_OUT_OF_RESOURCES There is not enough memory to add another 822 822 Unicode string to UnicodeStringTable. 823 @retval EFI_UNSUPPORTED The language specified by Language is not a 823 @retval EFI_UNSUPPORTED The language specified by Language is not a 824 824 member of SupportedLanguages. 825 825 … … 984 984 @param UnicodeStringTable A pointer to the table of Unicode strings. Type EFI_UNICODE_STRING_TABLE 985 985 is defined in "Related Definitions". 986 @param UnicodeString A pointer to the Unicode string to add. 986 @param UnicodeString A pointer to the Unicode string to add. 987 987 @param Iso639Language Specifies the supported language code format. If it is TRUE, 988 988 then Language and SupportedLanguages follow ISO 639-2 language code format. … … 991 991 @retval EFI_SUCCESS The Unicode string that matches the language specified by 992 992 Language was found in the table of Unicode strings UnicodeStringTable, 993 and it was returned in UnicodeString. 994 @retval EFI_INVALID_PARAMETER Language is NULL. 995 @retval EFI_INVALID_PARAMETER UnicodeString is NULL. 996 @retval EFI_INVALID_PARAMETER UnicodeString is an empty string. 997 @retval EFI_UNSUPPORTED SupportedLanguages is NULL. 993 and it was returned in UnicodeString. 994 @retval EFI_INVALID_PARAMETER Language is NULL. 995 @retval EFI_INVALID_PARAMETER UnicodeString is NULL. 996 @retval EFI_INVALID_PARAMETER UnicodeString is an empty string. 997 @retval EFI_UNSUPPORTED SupportedLanguages is NULL. 998 998 @retval EFI_ALREADY_STARTED A Unicode string with language Language is already present in 999 UnicodeStringTable. 1000 @retval EFI_OUT_OF_RESOURCES There is not enough memory to add another Unicode string UnicodeStringTable. 999 UnicodeStringTable. 1000 @retval EFI_OUT_OF_RESOURCES There is not enough memory to add another Unicode string UnicodeStringTable. 1001 1001 @retval EFI_UNSUPPORTED The language specified by Language is not a member of SupportedLanguages. 1002 1002 … … 1082 1082 for (Index = 0; LanguageString[Index] != 0 && LanguageString[Index] != ';'; Index++); 1083 1083 1084 if (AsciiStrnCmp (Language, LanguageString, Index) == 0) { 1084 if (AsciiStrnCmp (Language, LanguageString, Index) == 0) { 1085 1085 return EFI_ALREADY_STARTED; 1086 1086 } … … 1164 1164 1165 1165 If UnicodeStringTable is NULL, then EFI_SUCCESS is returned. 1166 Otherwise, each language code, and each Unicode string in the Unicode string 1166 Otherwise, each language code, and each Unicode string in the Unicode string 1167 1167 table are freed, and EFI_SUCCESS is returned. 1168 1168 … … 1218 1218 [ATTENTION] This function will be deprecated for security reason. 1219 1219 1220 Returns a pointer to an allocated buffer that contains the contents of a 1221 variable retrieved through the UEFI Runtime Service GetVariable(). The 1220 Returns a pointer to an allocated buffer that contains the contents of a 1221 variable retrieved through the UEFI Runtime Service GetVariable(). The 1222 1222 returned buffer is allocated using AllocatePool(). The caller is responsible 1223 1223 for freeing this buffer with FreePool(). … … 1281 1281 [ATTENTION] This function will be deprecated for security reason. 1282 1282 1283 Returns a pointer to an allocated buffer that contains the contents of a 1284 variable retrieved through the UEFI Runtime Service GetVariable(). This 1283 Returns a pointer to an allocated buffer that contains the contents of a 1284 variable retrieved through the UEFI Runtime Service GetVariable(). This 1285 1285 function always uses the EFI_GLOBAL_VARIABLE GUID to retrieve variables. 1286 The returned buffer is allocated using AllocatePool(). The caller is 1286 The returned buffer is allocated using AllocatePool(). The caller is 1287 1287 responsible for freeing this buffer with FreePool(). 1288 1288 … … 1307 1307 1308 1308 /** 1309 Returns the status whether get the variable success. The function retrieves 1310 variable through the UEFI Runtime Service GetVariable(). The 1309 Returns the status whether get the variable success. The function retrieves 1310 variable through the UEFI Runtime Service GetVariable(). The 1311 1311 returned buffer is allocated using AllocatePool(). The caller is responsible 1312 1312 for freeing this buffer with FreePool(). … … 1348 1348 *Size = 0; 1349 1349 } 1350 1350 1351 1351 Status = gRT->GetVariable ((CHAR16 *) Name, (EFI_GUID *) Guid, NULL, &BufferSize, *Value); 1352 1352 if (Status != EFI_BUFFER_TOO_SMALL) { … … 1380 1380 1381 1381 /** 1382 Returns a pointer to an allocated buffer that contains the contents of a 1383 variable retrieved through the UEFI Runtime Service GetVariable(). This 1382 Returns a pointer to an allocated buffer that contains the contents of a 1383 variable retrieved through the UEFI Runtime Service GetVariable(). This 1384 1384 function always uses the EFI_GLOBAL_VARIABLE GUID to retrieve variables. 1385 The returned buffer is allocated using AllocatePool(). The caller is 1385 The returned buffer is allocated using AllocatePool(). The caller is 1386 1386 responsible for freeing this buffer with FreePool(). 1387 1387 … … 1410 1410 1411 1411 /** 1412 Returns a pointer to an allocated buffer that contains the best matching language 1413 from a set of supported languages. 1414 1415 This function supports both ISO 639-2 and RFC 4646 language codes, but language 1416 code types may not be mixed in a single call to this function. The language 1417 code returned is allocated using AllocatePool(). The caller is responsible for 1412 Returns a pointer to an allocated buffer that contains the best matching language 1413 from a set of supported languages. 1414 1415 This function supports both ISO 639-2 and RFC 4646 language codes, but language 1416 code types may not be mixed in a single call to this function. The language 1417 code returned is allocated using AllocatePool(). The caller is responsible for 1418 1418 freeing the allocated buffer using FreePool(). This function supports a variable 1419 argument list that allows the caller to pass in a prioritized list of language 1420 codes to test against all the language codes in SupportedLanguages. 1419 argument list that allows the caller to pass in a prioritized list of language 1420 codes to test against all the language codes in SupportedLanguages. 1421 1421 1422 1422 If SupportedLanguages is NULL, then ASSERT(). 1423 1423 1424 1424 @param[in] SupportedLanguages A pointer to a Null-terminated ASCII string that 1425 contains a set of language codes in the format 1425 contains a set of language codes in the format 1426 1426 specified by Iso639Language. 1427 1427 @param[in] Iso639Language If TRUE, then all language codes are assumed to be 1428 1428 in ISO 639-2 format. If FALSE, then all language 1429 1429 codes are assumed to be in RFC 4646 language format 1430 @param[in] ... A variable argument list that contains pointers to 1430 @param[in] ... A variable argument list that contains pointers to 1431 1431 Null-terminated ASCII strings that contain one or more 1432 1432 language codes in the format specified by Iso639Language. 1433 1433 The first language code from each of these language 1434 1434 code lists is used to determine if it is an exact or 1435 close match to any of the language codes in 1435 close match to any of the language codes in 1436 1436 SupportedLanguages. Close matches only apply to RFC 4646 1437 1437 language codes, and the matching algorithm from RFC 4647 1438 is used to determine if a close match is present. If 1438 is used to determine if a close match is present. If 1439 1439 an exact or close match is found, then the matching 1440 1440 language code from SupportedLanguages is returned. If 1441 1441 no matches are found, then the next variable argument 1442 parameter is evaluated. The variable argument list 1442 parameter is evaluated. The variable argument list 1443 1443 is terminated by a NULL. 1444 1444 1445 1445 @retval NULL The best matching language could not be found in SupportedLanguages. 1446 @retval NULL There are not enough resources available to return the best matching 1446 @retval NULL There are not enough resources available to return the best matching 1447 1447 language. 1448 @retval Other A pointer to a Null-terminated ASCII string that is the best matching 1448 @retval Other A pointer to a Null-terminated ASCII string that is the best matching 1449 1449 language in SupportedLanguages. 1450 1450 … … 1453 1453 EFIAPI 1454 1454 GetBestLanguage ( 1455 IN CONST CHAR8 *SupportedLanguages, 1455 IN CONST CHAR8 *SupportedLanguages, 1456 1456 IN BOOLEAN Iso639Language, 1457 1457 ... … … 1532 1532 } else { 1533 1533 // 1534 // If RFC 4646 mode, then trim Language from the right to the next '-' character 1534 // If RFC 4646 mode, then trim Language from the right to the next '-' character 1535 1535 // 1536 1536 for (LanguageLength--; LanguageLength > 0 && Language[LanguageLength] != '-'; LanguageLength--); … … 1541 1541 1542 1542 // 1543 // No matches were found 1543 // No matches were found 1544 1544 // 1545 1545 return NULL; -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/UefiLib/UefiLib.inf
r58459 r58466 2 2 # Instance of UEFI Library. 3 3 # 4 # The UEFI Library provides functions and macros that simplify the development of 5 # UEFI Drivers and UEFI Applications. These functions and macros help manage EFI 6 # events, build simple locks utilizing EFI Task Priority Levels (TPLs), install 7 # EFI Driver Model related protocols, manage Unicode string tables for UEFI Drivers, 4 # The UEFI Library provides functions and macros that simplify the development of 5 # UEFI Drivers and UEFI Applications. These functions and macros help manage EFI 6 # events, build simple locks utilizing EFI Task Priority Levels (TPLs), install 7 # EFI Driver Model related protocols, manage Unicode string tables for UEFI Drivers, 8 8 # and print messages on the console output and standard error devices. 9 9 # … … 58 58 DevicePathLib 59 59 UefiRuntimeServicesTableLib 60 60 61 61 [Guids] 62 62 gEfiEventReadyToBootGuid ## SOMETIMES_CONSUMES ## Event -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/UefiLib/UefiLibPrint.c
r48674 r58466 91 91 } 92 92 93 /** 94 Prints a formatted Unicode string to the console output device specified by 93 /** 94 Prints a formatted Unicode string to the console output device specified by 95 95 ConOut defined in the EFI_SYSTEM_TABLE. 96 96 97 This function prints a formatted Unicode string to the console output device 98 specified by ConOut in EFI_SYSTEM_TABLE and returns the number of Unicode 99 characters that printed to ConOut. If the length of the formatted Unicode 100 string is greater than PcdUefiLibMaxPrintBufferSize, then only the first 97 This function prints a formatted Unicode string to the console output device 98 specified by ConOut in EFI_SYSTEM_TABLE and returns the number of Unicode 99 characters that printed to ConOut. If the length of the formatted Unicode 100 string is greater than PcdUefiLibMaxPrintBufferSize, then only the first 101 101 PcdUefiLibMaxPrintBufferSize characters are sent to ConOut. 102 102 If Format is NULL, then ASSERT(). … … 105 105 106 106 @param Format A Null-terminated Unicode format string. 107 @param ... A Variable argument list whose contents are accessed based 107 @param ... A Variable argument list whose contents are accessed based 108 108 on the format string specified by Format. 109 109 110 110 @return The number of Unicode characters printed to ConOut. 111 111 … … 130 130 } 131 131 132 /** 133 Prints a formatted Unicode string to the console output device specified by 132 /** 133 Prints a formatted Unicode string to the console output device specified by 134 134 StdErr defined in the EFI_SYSTEM_TABLE. 135 135 136 This function prints a formatted Unicode string to the console output device 137 specified by StdErr in EFI_SYSTEM_TABLE and returns the number of Unicode 138 characters that printed to StdErr. If the length of the formatted Unicode 139 string is greater than PcdUefiLibMaxPrintBufferSize, then only the first 136 This function prints a formatted Unicode string to the console output device 137 specified by StdErr in EFI_SYSTEM_TABLE and returns the number of Unicode 138 characters that printed to StdErr. If the length of the formatted Unicode 139 string is greater than PcdUefiLibMaxPrintBufferSize, then only the first 140 140 PcdUefiLibMaxPrintBufferSize characters are sent to StdErr. 141 141 If Format is NULL, then ASSERT(). … … 144 144 145 145 @param Format A Null-terminated Unicode format string. 146 @param ... Variable argument list whose contents are accessed based 146 @param ... Variable argument list whose contents are accessed based 147 147 on the format string specified by Format. 148 148 149 149 @return The number of Unicode characters printed to StdErr. 150 150 … … 226 226 } 227 227 228 /** 229 Prints a formatted ASCII string to the console output device specified by 228 /** 229 Prints a formatted ASCII string to the console output device specified by 230 230 ConOut defined in the EFI_SYSTEM_TABLE. 231 231 232 This function prints a formatted ASCII string to the console output device 233 specified by ConOut in EFI_SYSTEM_TABLE and returns the number of ASCII 234 characters that printed to ConOut. If the length of the formatted ASCII 235 string is greater than PcdUefiLibMaxPrintBufferSize, then only the first 232 This function prints a formatted ASCII string to the console output device 233 specified by ConOut in EFI_SYSTEM_TABLE and returns the number of ASCII 234 characters that printed to ConOut. If the length of the formatted ASCII 235 string is greater than PcdUefiLibMaxPrintBufferSize, then only the first 236 236 PcdUefiLibMaxPrintBufferSize characters are sent to ConOut. 237 237 If Format is NULL, then ASSERT(). … … 239 239 240 240 @param Format A Null-terminated ASCII format string. 241 @param ... Variable argument list whose contents are accessed based 241 @param ... Variable argument list whose contents are accessed based 242 242 on the format string specified by Format. 243 243 244 244 @return The number of ASCII characters printed to ConOut. 245 245 … … 265 265 } 266 266 267 /** 268 Prints a formatted ASCII string to the console output device specified by 267 /** 268 Prints a formatted ASCII string to the console output device specified by 269 269 StdErr defined in the EFI_SYSTEM_TABLE. 270 270 271 This function prints a formatted ASCII string to the console output device 272 specified by StdErr in EFI_SYSTEM_TABLE and returns the number of ASCII 273 characters that printed to StdErr. If the length of the formatted ASCII 274 string is greater than PcdUefiLibMaxPrintBufferSize, then only the first 271 This function prints a formatted ASCII string to the console output device 272 specified by StdErr in EFI_SYSTEM_TABLE and returns the number of ASCII 273 characters that printed to StdErr. If the length of the formatted ASCII 274 string is greater than PcdUefiLibMaxPrintBufferSize, then only the first 275 275 PcdUefiLibMaxPrintBufferSize characters are sent to StdErr. 276 276 If Format is NULL, then ASSERT(). … … 278 278 279 279 @param Format A Null-terminated ASCII format string. 280 @param ... Variable argument list whose contents are accessed based 280 @param ... Variable argument list whose contents are accessed based 281 281 on the format string specified by Format. 282 282 283 283 @return The number of ASCII characters printed to ConErr. 284 284 … … 372 372 373 373 ConsoleHandle = gST->ConsoleOutHandle; 374 374 375 375 ASSERT( ConsoleHandle != NULL); 376 376 … … 554 554 555 555 /** 556 Prints a formatted Unicode string to a graphics console device specified by 556 Prints a formatted Unicode string to a graphics console device specified by 557 557 ConsoleOutputHandle defined in the EFI_SYSTEM_TABLE at the given (X,Y) coordinates. 558 558 559 This function prints a formatted Unicode string to the graphics console device 560 specified by ConsoleOutputHandle in EFI_SYSTEM_TABLE and returns the number of 561 Unicode characters displayed, not including partial characters that may be clipped 559 This function prints a formatted Unicode string to the graphics console device 560 specified by ConsoleOutputHandle in EFI_SYSTEM_TABLE and returns the number of 561 Unicode characters displayed, not including partial characters that may be clipped 562 562 by the right edge of the display. If the length of the formatted Unicode string is 563 greater than PcdUefiLibMaxPrintBufferSize, then at most the first 563 greater than PcdUefiLibMaxPrintBufferSize, then at most the first 564 564 PcdUefiLibMaxPrintBufferSize characters are printed.The EFI_HII_FONT_PROTOCOL 565 StringToImage() service is used to convert the string to a bitmap using the glyphs 566 registered with the HII database. No wrapping is performed, so any portions of the 567 string the fall outside the active display region will not be displayed. Please see 565 StringToImage() service is used to convert the string to a bitmap using the glyphs 566 registered with the HII database. No wrapping is performed, so any portions of the 567 string the fall outside the active display region will not be displayed. Please see 568 568 Section 27.2.6 of the UEFI Specification for a description of the supported string 569 569 format including the set of control codes supported by the StringToImage() service. 570 570 571 If a graphics console device is not associated with the ConsoleOutputHandle 571 If a graphics console device is not associated with the ConsoleOutputHandle 572 572 defined in the EFI_SYSTEM_TABLE then no string is printed, and 0 is returned. 573 If the EFI_HII_FONT_PROTOCOL is not present in the handle database, then no 573 If the EFI_HII_FONT_PROTOCOL is not present in the handle database, then no 574 574 string is printed, and 0 is returned. 575 575 If Format is NULL, then ASSERT(). … … 584 584 in the EFI_SYSTEM_TABLE is used. 585 585 @param BackGround The background color of the string being printed. This is 586 an optional parameter that may be NULL. If it is NULL, 586 an optional parameter that may be NULL. If it is NULL, 587 587 then the background color of the current ConOut device 588 588 in the EFI_SYSTEM_TABLE is used. 589 @param Format A Null-terminated Unicode format string. See Print Library 589 @param Format A Null-terminated Unicode format string. See Print Library 590 590 for the supported format string syntax. 591 @param ... A Variable argument list whose contents are accessed based on 592 the format string specified by Format. 591 @param ... A Variable argument list whose contents are accessed based on 592 the format string specified by Format. 593 593 594 594 @return The number of Unicode characters printed. … … 634 634 635 635 /** 636 Prints a formatted ASCII string to a graphics console device specified by 636 Prints a formatted ASCII string to a graphics console device specified by 637 637 ConsoleOutputHandle defined in the EFI_SYSTEM_TABLE at the given (X,Y) coordinates. 638 638 639 This function prints a formatted ASCII string to the graphics console device 640 specified by ConsoleOutputHandle in EFI_SYSTEM_TABLE and returns the number of 641 ASCII characters displayed, not including partial characters that may be clipped 639 This function prints a formatted ASCII string to the graphics console device 640 specified by ConsoleOutputHandle in EFI_SYSTEM_TABLE and returns the number of 641 ASCII characters displayed, not including partial characters that may be clipped 642 642 by the right edge of the display. If the length of the formatted ASCII string is 643 greater than PcdUefiLibMaxPrintBufferSize, then at most the first 643 greater than PcdUefiLibMaxPrintBufferSize, then at most the first 644 644 PcdUefiLibMaxPrintBufferSize characters are printed.The EFI_HII_FONT_PROTOCOL 645 StringToImage() service is used to convert the string to a bitmap using the glyphs 646 registered with the HII database. No wrapping is performed, so any portions of the 647 string the fall outside the active display region will not be displayed. Please see 645 StringToImage() service is used to convert the string to a bitmap using the glyphs 646 registered with the HII database. No wrapping is performed, so any portions of the 647 string the fall outside the active display region will not be displayed. Please see 648 648 Section 27.2.6 of the UEFI Specification for a description of the supported string 649 649 format including the set of control codes supported by the StringToImage() service. 650 650 651 If a graphics console device is not associated with the ConsoleOutputHandle 651 If a graphics console device is not associated with the ConsoleOutputHandle 652 652 defined in the EFI_SYSTEM_TABLE then no string is printed, and 0 is returned. 653 If the EFI_HII_FONT_PROTOCOL is not present in the handle database, then no 653 If the EFI_HII_FONT_PROTOCOL is not present in the handle database, then no 654 654 string is printed, and 0 is returned. 655 655 If Format is NULL, then ASSERT(). … … 663 663 in the EFI_SYSTEM_TABLE is used. 664 664 @param BackGround The background color of the string being printed. This is 665 an optional parameter that may be NULL. If it is NULL, 665 an optional parameter that may be NULL. If it is NULL, 666 666 then the background color of the current ConOut device 667 667 in the EFI_SYSTEM_TABLE is used. 668 @param Format A Null-terminated ASCII format string. See Print Library 668 @param Format A Null-terminated ASCII format string. See Print Library 669 669 for the supported format string syntax. 670 @param ... Variable argument list whose contents are accessed based on 671 the format string specified by Format. 670 @param ... Variable argument list whose contents are accessed based on 671 the format string specified by Format. 672 672 673 673 @return The number of ASCII characters printed. … … 711 711 } 712 712 713 /** 713 /** 714 714 Appends a formatted Unicode string to a Null-terminated Unicode string 715 716 This function appends a formatted Unicode string to the Null-terminated 715 716 This function appends a formatted Unicode string to the Null-terminated 717 717 Unicode string specified by String. String is optional and may be NULL. 718 Storage for the formatted Unicode string returned is allocated using 718 Storage for the formatted Unicode string returned is allocated using 719 719 AllocatePool(). The pointer to the appended string is returned. The caller 720 720 is responsible for freeing the returned string. 721 721 722 722 If String is not NULL and not aligned on a 16-bit boundary, then ASSERT(). 723 723 If FormatString is NULL, then ASSERT(). 724 724 If FormatString is not aligned on a 16-bit boundary, then ASSERT(). 725 725 726 726 @param[in] String A Null-terminated Unicode string. 727 727 @param[in] FormatString A Null-terminated Unicode format string. … … 729 729 730 730 @retval NULL There was not enough available memory. 731 @return Null-terminated Unicode string is that is the formatted 731 @return Null-terminated Unicode string is that is the formatted 732 732 string appended to String. 733 733 **/ … … 772 772 } 773 773 774 /** 774 /** 775 775 Appends a formatted Unicode string to a Null-terminated Unicode string 776 777 This function appends a formatted Unicode string to the Null-terminated 776 777 This function appends a formatted Unicode string to the Null-terminated 778 778 Unicode string specified by String. String is optional and may be NULL. 779 Storage for the formatted Unicode string returned is allocated using 779 Storage for the formatted Unicode string returned is allocated using 780 780 AllocatePool(). The pointer to the appended string is returned. The caller 781 781 is responsible for freeing the returned string. 782 782 783 783 If String is not NULL and not aligned on a 16-bit boundary, then ASSERT(). 784 784 If FormatString is NULL, then ASSERT(). 785 785 If FormatString is not aligned on a 16-bit boundary, then ASSERT(). 786 786 787 787 @param[in] String A Null-terminated Unicode string. 788 788 @param[in] FormatString A Null-terminated Unicode format string. 789 @param[in] ... The variable argument list whose contents are 790 accessed based on the format string specified by 789 @param[in] ... The variable argument list whose contents are 790 accessed based on the format string specified by 791 791 FormatString. 792 792 793 793 @retval NULL There was not enough available memory. 794 @return Null-terminated Unicode string is that is the formatted 794 @return Null-terminated Unicode string is that is the formatted 795 795 string appended to String. 796 796 **/ -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/UefiLib/UefiNotTiano.c
r58459 r58466 27 27 This empty function ensures that EVT_NOTIFY_SIGNAL_ALL is error 28 28 checked correctly since it is now mapped into CreateEventEx() in UEFI 2.0. 29 29 30 30 @param Event Event whose notification function is being invoked. 31 31 @param Context The pointer to the notification function's context, … … 76 76 /** 77 77 Create an EFI event in the Legacy Boot Event Group and allows 78 the caller to specify a notification function. 79 78 the caller to specify a notification function. 79 80 80 This function abstracts the creation of the Legacy Boot Event. 81 81 The Framework moved from a proprietary to UEFI 2.0 based mechanism. … … 142 142 143 143 Prior to UEFI 2.0 this was done via a non-standard UEFI extension, and this library 144 abstracts the implementation mechanism of this event from the caller. 145 This function abstracts the creation of the Ready to Boot Event. The Framework 146 moved from a proprietary to UEFI 2.0-based mechanism. This library abstracts 147 the caller from how this event is created to prevent the code form having to 144 abstracts the implementation mechanism of this event from the caller. 145 This function abstracts the creation of the Ready to Boot Event. The Framework 146 moved from a proprietary to UEFI 2.0-based mechanism. This library abstracts 147 the caller from how this event is created to prevent the code form having to 148 148 change with the version of the specification supported. 149 149 If ReadyToBootEvent is NULL, then ASSERT(). … … 171 171 /** 172 172 Create an EFI event in the Ready To Boot Event Group and allows 173 the caller to specify a notification function. 174 173 the caller to specify a notification function. 174 175 175 This function abstracts the creation of the Ready to Boot Event. 176 176 The Framework moved from a proprietary to UEFI 2.0 based mechanism. … … 236 236 /** 237 237 Create, Signal, and Close the Ready to Boot event using EfiSignalEventReadyToBoot(). 238 238 239 239 This function abstracts the signaling of the Ready to Boot Event. The Framework moved 240 240 from a proprietary to UEFI 2.0 based mechanism. This library abstracts the caller … … 286 286 287 287 /** 288 Check to see if the Firmware Volume (FV) Media Device Path is valid 289 290 The Framework FwVol Device Path changed to conform to the UEFI 2.0 specification. 288 Check to see if the Firmware Volume (FV) Media Device Path is valid 289 290 The Framework FwVol Device Path changed to conform to the UEFI 2.0 specification. 291 291 This library function abstracts validating a device path node. 292 Check the MEDIA_FW_VOL_FILEPATH_DEVICE_PATH data structure to see if it's valid. 293 If it is valid, then return the GUID file name from the device path node. Otherwise, 294 return NULL. This device path changed in the DXE CIS version 0.92 in a non back ward 295 compatible way to not conflict with the UEFI 2.0 specification. This function abstracts 292 Check the MEDIA_FW_VOL_FILEPATH_DEVICE_PATH data structure to see if it's valid. 293 If it is valid, then return the GUID file name from the device path node. Otherwise, 294 return NULL. This device path changed in the DXE CIS version 0.92 in a non back ward 295 compatible way to not conflict with the UEFI 2.0 specification. This function abstracts 296 296 the differences from the caller. 297 297 If FvDevicePathNode is NULL, then ASSERT(). … … 322 322 /** 323 323 Initialize a Firmware Volume (FV) Media Device Path node. 324 325 The Framework FwVol Device Path changed to conform to the UEFI 2.0 specification. 326 This library function abstracts initializing a device path node. 327 Initialize the MEDIA_FW_VOL_FILEPATH_DEVICE_PATH data structure. This device 328 path changed in the DXE CIS version 0.92 in a non back ward compatible way to 329 not conflict with the UEFI 2.0 specification. This function abstracts the 324 325 The Framework FwVol Device Path changed to conform to the UEFI 2.0 specification. 326 This library function abstracts initializing a device path node. 327 Initialize the MEDIA_FW_VOL_FILEPATH_DEVICE_PATH data structure. This device 328 path changed in the DXE CIS version 0.92 in a non back ward compatible way to 329 not conflict with the UEFI 2.0 specification. This function abstracts the 330 330 differences from the caller. 331 331 If FvDevicePathNode is NULL, then ASSERT(). 332 332 If NameGuid is NULL, then ASSERT(). 333 333 334 334 @param FvDevicePathNode The pointer to a FV device path node to initialize 335 335 @param NameGuid FV file name to use in FvDevicePathNode
Note:
See TracChangeset
for help on using the changeset viewer.