2 Generic BDS library defines general interfaces for a BDS driver, including:
3 1) BDS boot policy interface.
4 2) BDS boot device connect interface.
5 3) BDS Misc interfaces for mainting boot variable, ouput string.
7 Copyright (c) 2004 - 2010, Intel Corporation. All rights reserved.<BR>
8 This program and the accompanying materials are licensed and made available under
9 the terms and conditions of the BSD License that accompanies this distribution.
10 The full text of the license may be found at
11 http://opensource.org/licenses/bsd-license.php.
13 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
14 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
18 #ifndef _GENERIC_BDS_LIB_H_
19 #define _GENERIC_BDS_LIB_H_
21 #ifdef __MAKEWITH_GNUEFI
22 #include "gnuefi-helper.h"
25 //#include <Protocol/UserManager.h>
28 /// Constants which are variable names used to access variables.
30 #define VAR_LEGACY_DEV_ORDER L"LegacyDevOrder"
33 /// Data structures and defines.
35 #define FRONT_PAGE_QUESTION_ID 0x0000
36 #define FRONT_PAGE_DATA_WIDTH 0x01
41 #define CONSOLE_OUT 0x00000001
42 #define STD_ERROR 0x00000002
43 #define CONSOLE_IN 0x00000004
44 #define CONSOLE_ALL (CONSOLE_OUT | CONSOLE_IN | STD_ERROR)
47 /// Load Option Attributes
49 #define LOAD_OPTION_ACTIVE 0x00000001
50 #define LOAD_OPTION_FORCE_RECONNECT 0x00000002
52 #define LOAD_OPTION_HIDDEN 0x00000008
53 #define LOAD_OPTION_CATEGORY 0x00001F00
55 #define LOAD_OPTION_CATEGORY_BOOT 0x00000000
56 #define LOAD_OPTION_CATEGORY_APP 0x00000100
58 #define EFI_BOOT_OPTION_SUPPORT_KEY 0x00000001
59 #define EFI_BOOT_OPTION_SUPPORT_APP 0x00000002
61 #define IS_LOAD_OPTION_TYPE(_c, _Mask) (BOOLEAN) (((_c) & (_Mask)) != 0)
64 /// Define the maximum characters that will be accepted.
67 #define MAX_CHAR_SIZE (MAX_CHAR * 2)
70 /// Define maximum characters for boot option variable "BootXXXX".
72 #define BOOT_OPTION_MAX_CHAR 10
75 // This data structure is the part of BDS_CONNECT_ENTRY
77 #ifdef __MAKEWITH_TIANO
78 #define BDS_LOAD_OPTION_SIGNATURE SIGNATURE_32 ('B', 'd', 'C', 'O')
80 #define BDS_LOAD_OPTION_SIGNATURE EFI_SIGNATURE_32 ('B', 'd', 'C', 'O')
88 EFI_DEVICE_PATH_PROTOCOL
*DevicePath
;
96 UINT32 LoadOptionsSize
;
102 EFI_DEVICE_PATH_PROTOCOL
*DevicePath
;
104 } BDS_CONSOLE_CONNECT_ENTRY
;
107 // Bds boot related lib functions
110 Boot from the UEFI spec defined "BootNext" variable.
120 Process the boot option according to the UEFI specification. The legacy boot option device path includes BBS_DEVICE_PATH.
122 @param Option The boot option to be processed.
123 @param DevicePath The device path describing where to load the
124 boot image or the legcy BBS device path to boot
126 @param ExitDataSize The size of exit data.
127 @param ExitData Data returned when Boot image failed.
129 @retval EFI_SUCCESS Boot from the input boot option succeeded.
130 @retval EFI_NOT_FOUND The Device Path is not found in the system.
135 BdsLibBootViaBootOption (
136 IN BDS_COMMON_OPTION
* Option
,
137 IN EFI_DEVICE_PATH_PROTOCOL
* DevicePath
,
138 OUT UINTN
*ExitDataSize
,
139 OUT CHAR16
**ExitData OPTIONAL
144 This function will enumerate all possible boot devices in the system, and
145 automatically create boot options for Network, Shell, Removable BlockIo,
146 and Non-BlockIo Simplefile devices.
148 BDS separates EFI boot options into six types:
149 1. Network - The boot option points to the SimpleNetworkProtocol device.
150 Bds will try to automatically create this type of boot option during enumeration.
151 2. Shell - The boot option points to internal flash shell.
152 Bds will try to automatically create this type of boot option during enumeration.
153 3. Removable BlockIo - The boot option points to a removable media
154 device, such as a USB flash drive or DVD drive.
155 These devices should contain a *removable* blockIo
156 protocol in their device handle.
157 Bds will try to automatically create this type boot option
159 4. Fixed BlockIo - The boot option points to a Fixed blockIo device,
161 These devices should contain a *fixed* blockIo
162 protocol in their device handle.
163 BDS will skip fixed blockIo devices, and not
164 automatically create boot option for them. But BDS
165 will help to delete those fixed blockIo boot options,
166 whose description rules conflict with other auto-created
168 5. Non-BlockIo Simplefile - The boot option points to a device whose handle
169 has SimpleFileSystem Protocol, but has no blockio
170 protocol. These devices do not offer blockIo
171 protocol, but BDS still can get the
172 \EFI\BOOT\boot{machinename}.EFI by SimpleFileSystem
174 6. File - The boot option points to a file. These boot options are usually
175 created by the user, either manually or with an OS loader. BDS will not delete or modify
178 This function will enumerate all possible boot devices in the system, and
179 automatically create boot options for Network, Shell, Removable BlockIo,
180 and Non-BlockIo Simplefile devices.
181 It will excute once every boot.
183 @param BdsBootOptionList The header of the linked list that indexed all
184 current boot options.
186 @retval EFI_SUCCESS Finished all the boot device enumerations and
187 created the boot option based on the boot device.
189 @retval EFI_OUT_OF_RESOURCES Failed to enumerate the boot device and create
190 the boot option list.
194 BdsLibEnumerateAllBootOption (
195 IN OUT LIST_ENTRY
*BdsBootOptionList
199 Build the boot option with the handle parsed in.
201 @param Handle The handle representing the device path for which
202 to create a boot option.
203 @param BdsBootOptionList The header of the link list that indexed all
204 current boot options.
205 @param String The description of the boot option.
210 BdsLibBuildOptionFromHandle (
211 IN EFI_HANDLE Handle
,
212 IN LIST_ENTRY
*BdsBootOptionList
,
218 Build the on flash shell boot option with the handle parsed in.
220 @param Handle The handle which present the device path to create
221 the on flash shell boot option.
222 @param BdsBootOptionList The header of the link list that indexed all
223 current boot options.
228 BdsLibBuildOptionFromShell (
229 IN EFI_HANDLE Handle
,
230 IN OUT LIST_ENTRY
*BdsBootOptionList
234 // // Bds misc lib functions
237 // Get boot mode by looking up the configuration table and parsing the HOB list.
239 // @param BootMode The boot mode from PEI handoff HOB.
241 // @retval EFI_SUCCESS Successfully got boot mode.
246 // BdsLibGetBootMode (
247 // OUT EFI_BOOT_MODE *BootMode
252 The function will go through the driver option link list, and then load and start
253 every driver to which the driver option device path points.
255 @param BdsDriverLists The header of the current driver option link list.
261 IN LIST_ENTRY
*BdsDriverLists
266 This function processes BootOrder or DriverOrder variables, by calling
268 BdsLibVariableToOption () for each UINT16 in the variables.
270 @param BdsCommonOptionList The header of the option list base on the variable
272 @param VariableName An EFI Variable name indicate the BootOrder or
275 @retval EFI_SUCCESS Successfully created the boot option or driver option
277 @retval EFI_OUT_OF_RESOURCES Failed to get the boot option or the driver option list.
281 BdsLibBuildOptionFromVar (
282 IN LIST_ENTRY
*BdsCommonOptionList
,
283 IN CHAR16
*VariableName
287 This function reads the EFI variable (VendorGuid/Name) and returns a dynamically allocated
288 buffer and the size of the buffer. If it fails, return NULL.
290 @param Name The string part of the EFI variable name.
291 @param VendorGuid The GUID part of the EFI variable name.
292 @param VariableSize Returns the size of the EFI variable that was read.
294 @return Dynamically allocated memory that contains a copy
295 of the EFI variable. The caller is responsible for
297 @retval NULL The variable was not read.
301 BdsLibGetVariableAndSize (
303 IN EFI_GUID
*VendorGuid
,
304 OUT UINTN
*VariableSize
309 This function prints a series of strings.
311 @param ConOut A pointer to EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL.
312 @param ... A variable argument list containing a series of
313 strings, the last string must be NULL.
315 @retval EFI_SUCCESS Successfully printed out the string using ConOut.
316 @retval EFI_STATUS Return the status of the ConOut->OutputString ().
321 // BdsLibOutputStrings (
322 // IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *ConOut,
327 Build the boot#### or driver#### option from the VariableName. The
328 build boot#### or driver#### will also be linked to BdsCommonOptionList.
330 @param BdsCommonOptionList The header of the boot#### or driver#### option
332 @param VariableName EFI Variable name, indicates if it is boot#### or
335 @retval BDS_COMMON_OPTION The option that was created.
336 @retval NULL Failed to get the new option.
340 BdsLibVariableToOption (
341 IN OUT LIST_ENTRY
*BdsCommonOptionList
,
342 IN CHAR16
*VariableName
347 This function creates all handles associated with the given device
348 path node. If the handle associated with one device path node cannot
349 be created, then it tries to execute the dispatch to load the missing drivers.
351 @param DevicePathToConnect The device path to be connected. Can be
352 a multi-instance device path.
354 @retval EFI_SUCCESS All handles associates with every device path node
356 @retval EFI_OUT_OF_RESOURCES Not enough resources to create new handles.
357 @retval EFI_NOT_FOUND At least one handle could not be created.
361 BdsLibConnectDevicePath (
362 IN EFI_DEVICE_PATH_PROTOCOL
*DevicePathToConnect
367 This function will connect console device based on the console
368 device variable ConIn, ConOut and ErrOut.
370 @retval EFI_SUCCESS At least one of the ConIn and ConOut devices have
372 @retval EFI_STATUS Return the status of BdsLibConnectConsoleVariable ().
377 BdsLibConnectAllDefaultConsoles (
382 This function updates the console variable based on ConVarName. It can
383 add or remove one specific console device path from the variable
385 @param ConVarName The console-related variable name: ConIn, ConOut,
387 @param CustomizedConDevicePath The console device path to be added to
388 the console variable ConVarName. Cannot be multi-instance.
389 @param ExclusiveDevicePath The console device path to be removed
390 from the console variable ConVarName. Cannot be multi-instance.
392 @retval EFI_UNSUPPORTED The added device path is the same as a removed one.
393 @retval EFI_SUCCESS Successfully added or removed the device path from the
399 BdsLibUpdateConsoleVariable (
400 IN CHAR16
*ConVarName
,
401 IN EFI_DEVICE_PATH_PROTOCOL
*CustomizedConDevicePath
,
402 IN EFI_DEVICE_PATH_PROTOCOL
*ExclusiveDevicePath
406 Connect the console device base on the variable ConVarName. If
407 ConVarName is a multi-instance device path, and at least one
408 instance connects successfully, then this function
411 @param ConVarName The console related variable name: ConIn, ConOut,
414 @retval EFI_NOT_FOUND No console devices were connected successfully
415 @retval EFI_SUCCESS Connected at least one instance of the console
416 device path based on the variable ConVarName.
421 BdsLibConnectConsoleVariable (
422 IN CHAR16
*ConVarName
426 // Bds device path related lib functions
429 Delete the instance in Multi that overlaps with Single.
431 @param Multi A pointer to a multi-instance device path data
433 @param Single A pointer to a single-instance device path data
436 @return This function removes the device path instances in Multi that overlap
437 Single, and returns the resulting device path. If there is no
438 remaining device path as a result, this function will return NULL.
441 EFI_DEVICE_PATH_PROTOCOL
*
443 BdsLibDelPartMatchInstance (
444 IN EFI_DEVICE_PATH_PROTOCOL
*Multi
,
445 IN EFI_DEVICE_PATH_PROTOCOL
*Single
449 This function compares a device path data structure to that of all the nodes of a
450 second device path instance.
452 @param Multi A pointer to a multi-instance device path data
454 @param Single A pointer to a single-instance device path data
457 @retval TRUE If the Single device path is contained within a
459 @retval FALSE The Single device path is not contained within a
465 BdsLibMatchDevicePaths (
466 IN EFI_DEVICE_PATH_PROTOCOL
*Multi
,
467 IN EFI_DEVICE_PATH_PROTOCOL
*Single
471 This function converts an input device structure to a Unicode string.
473 @param DevPath A pointer to the device path structure.
475 @return A newly allocated Unicode string that represents the device path.
481 IN EFI_DEVICE_PATH_PROTOCOL
*DevPath
484 #ifdef __MAKEWITH_TIANO
486 // Internal definitions
497 (*DEV_PATH_FUNCTION
) (
498 IN OUT POOL_PRINT
*Str
,
505 DEV_PATH_FUNCTION Function
;
506 } DEVICE_PATH_STRING_TABLE
;
509 EFI_DEVICE_PATH_PROTOCOL Header
;
511 UINT8 VendorDefinedData
[1];
512 } VENDOR_DEVICE_PATH_WITH_DATA
;
515 EFI_DEVICE_PATH_PROTOCOL Header
;
516 UINT16 NetworkProtocol
;
519 UINT16 TargetPortalGroupTag
;
520 CHAR16 TargetName
[1];
521 } ISCSI_DEVICE_PATH_WITH_NAME
;
524 // BBS support macros and functions
527 #if defined(MDE_CPU_IA32) || defined(MDE_CPU_X64)
528 #define REFRESH_LEGACY_BOOT_OPTIONS \
529 BdsDeleteAllInvalidLegacyBootOptions ();\
530 BdsAddNonExistingLegacyBootOptions (); \
531 BdsUpdateLegacyDevOrder ()
533 #define REFRESH_LEGACY_BOOT_OPTIONS
537 Delete all the invalid legacy boot options.
539 @retval EFI_SUCCESS All invalid legacy boot options are deleted.
540 @retval EFI_OUT_OF_RESOURCES Failed to allocate necessary memory.
541 @retval EFI_NOT_FOUND Failed to retrieve variable of boot order.
545 BdsDeleteAllInvalidLegacyBootOptions (
550 Add the legacy boot options from BBS table if they do not exist.
552 @retval EFI_SUCCESS The boot options were added successfully,
553 or they are already in boot options.
554 @retval EFI_NOT_FOUND No legacy boot options is found.
555 @retval EFI_OUT_OF_RESOURCE No enough memory.
556 @return Other value LegacyBoot options are not added.
559 BdsAddNonExistingLegacyBootOptions (
564 Add the legacy boot devices from BBS table into
565 the legacy device boot order.
567 @retval EFI_SUCCESS The boot devices were added successfully.
568 @retval EFI_NOT_FOUND The legacy boot devices are not found.
569 @retval EFI_OUT_OF_RESOURCES Memory or storage is not enough.
570 @retval EFI_DEVICE_ERROR Failed to add the legacy device boot order into EFI variable
571 because of a hardware error.
575 BdsUpdateLegacyDevOrder (
580 Refresh the boot priority for BBS entries based on boot option entry and boot order.
582 @param Entry The boot option is to be checked for a refreshed BBS table.
584 @retval EFI_SUCCESS The boot priority for BBS entries refreshed successfully.
585 @retval EFI_NOT_FOUND BBS entries can't be found.
586 @retval EFI_OUT_OF_RESOURCES Failed to get the legacy device boot order.
590 BdsRefreshBbsTableForBoot (
591 IN BDS_COMMON_OPTION
*Entry
595 Delete the Boot Option from EFI Variable. The Boot Order Arrray
598 @param OptionNumber The number of Boot options wanting to be deleted.
599 @param BootOrder The Boot Order array.
600 @param BootOrderSize The size of the Boot Order Array.
602 @retval EFI_SUCCESS The Boot Option Variable was found and removed.
603 @retval EFI_UNSUPPORTED The Boot Option Variable store was inaccessible.
604 @retval EFI_NOT_FOUND The Boot Option Variable was not found.
607 BdsDeleteBootOption (
608 IN UINTN OptionNumber
,
609 IN OUT UINT16
*BootOrder
,
610 IN OUT UINTN
*BootOrderSize
614 //The interface functions related to the Setup Browser Reset Reminder feature
617 Enable the setup browser reset reminder feature.
618 This routine is used in a platform tip. If the platform policy needs the feature, use the routine to enable it.
623 EnableResetReminderFeature (
628 Disable the setup browser reset reminder feature.
629 This routine is used in a platform tip. If the platform policy does not want the feature, use the routine to disable it.
634 DisableResetReminderFeature (
639 Record the info that a reset is required.
640 A module boolean variable is used to record whether a reset is required.
645 EnableResetRequired (
651 Record the info that no reset is required.
652 A module boolean variable is used to record whether a reset is required.
657 DisableResetRequired (
662 Check whether platform policy enables the reset reminder feature. The default is enabled.
667 IsResetReminderFeatureEnable (
672 Check if the user changed any option setting that needs a system reset to be effective.
682 Check whether a reset is needed, and finish the reset reminder feature.
683 If a reset is needed, pop up a menu to notice user, and finish the feature
684 according to the user selection.
695 /// Define the boot type with which to classify the boot option type.
696 /// Different boot option types could have different boot behaviors.
697 /// Use their device path node (Type + SubType) as the type value.
698 /// The boot type here can be added according to requirements.
702 /// ACPI boot type. For ACPI devices, using sub-types to distinguish devices is not allowed, so hardcode their values.
704 #define BDS_EFI_ACPI_FLOPPY_BOOT 0x0201
706 /// Message boot type
707 /// If a device path of boot option only points to a message node, the boot option is a message boot type.
709 #define BDS_EFI_MESSAGE_ATAPI_BOOT 0x0301 // Type 03; Sub-Type 01
710 #define BDS_EFI_MESSAGE_SCSI_BOOT 0x0302 // Type 03; Sub-Type 02
711 #define BDS_EFI_MESSAGE_USB_DEVICE_BOOT 0x0305 // Type 03; Sub-Type 05
712 #define BDS_EFI_MESSAGE_SATA_BOOT 0x0312 // Type 03; Sub-Type 18
713 #define BDS_EFI_MESSAGE_MAC_BOOT 0x030b // Type 03; Sub-Type 11
714 #define BDS_EFI_MESSAGE_MISC_BOOT 0x03FF
718 /// If a device path of boot option contains a media node, the boot option is media boot type.
720 #define BDS_EFI_MEDIA_HD_BOOT 0x0401 // Type 04; Sub-Type 01
721 #define BDS_EFI_MEDIA_CDROM_BOOT 0x0402 // Type 04; Sub-Type 02
724 /// If a device path of boot option contains a BBS node, the boot option is BBS boot type.
726 #define BDS_LEGACY_BBS_BOOT 0x0501 // Type 05; Sub-Type 01
728 #define BDS_EFI_UNSUPPORT 0xFFFF
731 Check whether an instance in BlockIoDevicePath has the same partition node as the HardDriveDevicePath device path.
733 @param BlockIoDevicePath Multi device path instances to check.
734 @param HardDriveDevicePath A device path starting with a hard drive media
737 @retval TRUE There is a matched device path instance.
738 @retval FALSE There is no matched device path instance.
743 MatchPartitionDevicePathNode (
744 IN EFI_DEVICE_PATH_PROTOCOL
*BlockIoDevicePath
,
745 IN HARDDRIVE_DEVICE_PATH
*HardDriveDevicePath
750 Expand a device path that starts with a hard drive media device path node to be a
751 full device path that includes the full hardware path to the device. This function enables the device to boot.
752 To avoid requiring a connect on every boot, the front match is saved in a variable (the part point
753 to the partition node. E.g. ACPI() /PCI()/ATA()/Partition() ).
754 All successful history device paths
755 that point to the front part of the partition node will be saved.
757 @param HardDriveDevicePath EFI Device Path to boot, if it starts with a hard
758 drive media device path.
759 @return A Pointer to the full device path, or NULL if a valid Hard Drive devic path
763 EFI_DEVICE_PATH_PROTOCOL
*
765 BdsExpandPartitionPartialDevicePathToFull (
766 IN HARDDRIVE_DEVICE_PATH
*HardDriveDevicePath
770 Return the bootable media handle.
771 First, check whether the device is connected.
772 Second, check whether the device path points to a device that supports SimpleFileSystemProtocol.
773 Third, detect the the default boot file in the Media, and return the removable Media handle.
775 @param DevicePath The Device Path to a bootable device.
777 @return The bootable media handle. If the media on the DevicePath is not bootable, NULL will return.
782 BdsLibGetBootableHandle (
783 IN EFI_DEVICE_PATH_PROTOCOL
*DevicePath
788 Checks whether the Device path in a boot option points to a valid bootable device, and if the device
789 is ready to boot now.
791 @param DevPath The Device path in a boot option.
792 @param CheckMedia If TRUE, check whether the device is ready to boot now.
794 @retval TRUE The Device path is valid.
795 @retval FALSE The Device path is invalid.
800 BdsLibIsValidEFIBootOptDevicePath (
801 IN EFI_DEVICE_PATH_PROTOCOL
*DevPath
,
802 IN BOOLEAN CheckMedia
806 Checks whether the Device path in a boot option points to a valid bootable device, and if the device
807 is ready to boot now.
808 If Description is not NULL and the device path points to a fixed BlockIo
809 device, this function checks whether the description conflicts with other auto-created
812 @param DevPath The Device path in a boot option.
813 @param CheckMedia If TRUE, checks if the device is ready to boot now.
814 @param Description The description of a boot option.
816 @retval TRUE The Device path is valid.
817 @retval FALSE The Device path is invalid.
822 BdsLibIsValidEFIBootOptDevicePathExt (
823 IN EFI_DEVICE_PATH_PROTOCOL
*DevPath
,
824 IN BOOLEAN CheckMedia
,
825 IN CHAR16
*Description
829 For a bootable Device path, return its boot type.
831 @param DevicePath The bootable device Path to check.
833 @retval BDS_EFI_MEDIA_HD_BOOT The given device path contains MEDIA_DEVICE_PATH type device path node,
834 whose subtype is MEDIA_HARDDRIVE_DP.
835 @retval BDS_EFI_MEDIA_CDROM_BOOT If given device path contains MEDIA_DEVICE_PATH type device path node,
836 whose subtype is MEDIA_CDROM_DP.
837 @retval BDS_EFI_ACPI_FLOPPY_BOOT A given device path contains ACPI_DEVICE_PATH type device path node,
838 whose HID is floppy device.
839 @retval BDS_EFI_MESSAGE_ATAPI_BOOT A given device path contains MESSAGING_DEVICE_PATH type device path node,
840 and its last device path node's subtype is MSG_ATAPI_DP.
841 @retval BDS_EFI_MESSAGE_SCSI_BOOT A given device path contains MESSAGING_DEVICE_PATH type device path node,
842 and its last device path node's subtype is MSG_SCSI_DP.
843 @retval BDS_EFI_MESSAGE_USB_DEVICE_BOOT A given device path contains MESSAGING_DEVICE_PATH type device path node,
844 and its last device path node's subtype is MSG_USB_DP.
845 @retval BDS_EFI_MESSAGE_MISC_BOOT The device path does not contain any media device path node, and
846 its last device path node points to a message device path node.
847 @retval BDS_LEGACY_BBS_BOOT A given device path contains BBS_DEVICE_PATH type device path node.
848 @retval BDS_EFI_UNSUPPORT An EFI Removable BlockIO device path does not point to a media and message device.
853 BdsGetBootTypeFromDevicePath (
854 IN EFI_DEVICE_PATH_PROTOCOL
*DevicePath
859 This routine registers a function to adjust the different types of memory page numbers
860 just before booting, and saves the updated info into the variable for the next boot to use.
865 BdsLibSaveMemoryTypeInformation (
870 Identify a user and, if authenticated, returns the current user profile handle.
872 @param[out] User Points to the user profile handle.
874 @retval EFI_SUCCESS The user is successfully identified, or user identification
876 @retval EFI_ACCESS_DENIED The user was not successfully identified.
881 // BdsLibUserIdentify (
882 // OUT EFI_USER_PROFILE_HANDLE *User
886 This function checks if a Fv file device path is valid, according to a file GUID. If it is invalid,
887 it tries to return the valid device path.
888 FV address maybe changes for memory layout adjust from time to time, use this funciton
889 could promise the Fv file device path is right.
891 @param DevicePath On input, the Fv file device path to check. On
892 output, the updated valid Fv file device path
893 @param FileGuid the Fv file GUID.
895 @retval EFI_INVALID_PARAMETER The input DevicePath or FileGuid is invalid.
896 @retval EFI_UNSUPPORTED The input DevicePath does not contain an Fv file
898 @retval EFI_ALREADY_STARTED The input DevicePath has pointed to the Fv file and is
900 @retval EFI_SUCCESS Successfully updated the invalid DevicePath
901 and returned the updated device path in DevicePath.
906 BdsLibUpdateFvFileDevicePath (
907 IN OUT EFI_DEVICE_PATH_PROTOCOL
** DevicePath
,
908 IN EFI_GUID
*FileGuid
913 Connect the specific USB device that matches the RemainingDevicePath,
914 and whose bus is determined by Host Controller (Uhci or Ehci).
916 @param HostControllerPI Uhci (0x00) or Ehci (0x20) or Both uhci and ehci
918 @param RemainingDevicePath A short-form device path that starts with the first
919 element being a USB WWID or a USB Class device
922 @retval EFI_SUCCESS The specific Usb device is connected successfully.
923 @retval EFI_INVALID_PARAMETER Invalid HostControllerPi (not 0x00, 0x20 or 0xFF)
924 or RemainingDevicePath is not the USB class device path.
925 @retval EFI_NOT_FOUND The device specified by device path is not found.
930 BdsLibConnectUsbDevByShortFormDP(
931 IN UINT8 HostControllerPI
,
932 IN EFI_DEVICE_PATH_PROTOCOL
*RemainingDevicePath
937 // The implementation of this function is provided by Platform code.
940 Convert Vendor device path to a device name.
942 @param Str The buffer storing device name.
943 @param DevPath The pointer to vendor device path.
948 IN OUT POOL_PRINT
*Str
,
953 Concatenates a formatted unicode string to an allocated pool.
954 The caller must free the resulting buffer.
956 @param Str Tracks the allocated pool, size in use, and amount of pool allocated.
957 @param Fmt The format string.
958 @param ... The data will be printed.
960 @return Allocated buffer with the formatted string printed in it.
961 The caller must free the allocated buffer.
962 The buffer allocation is not packed.
969 IN OUT POOL_PRINT
*Str
,
975 Use SystemTable ConOut to stop video based Simple Text Out consoles from going
976 to the video device. Put up LogoFile on every video device that is a console.
978 @param[in] LogoFile The file name of logo to display on the center of the screen.
980 @retval EFI_SUCCESS ConsoleControl has been flipped to graphics and logo displayed.
981 @retval EFI_UNSUPPORTED Logo not found.
987 IN EFI_GUID
*LogoFile
992 Use SystemTable ConOut to turn on video based Simple Text Out consoles. The
993 Simple Text Out screens will now be synced up with all non-video output devices.
995 @retval EFI_SUCCESS UGA devices are back in text mode and synced up.