/** @file\r
- Generic BDS library definition, include the file and data structure\r
+ Generic BDS library definition, include the data structure and function.\r
\r
Copyright (c) 2004 - 2008, Intel Corporation. <BR>\r
All rights reserved. This program and the accompanying materials\r
#ifndef _GENERIC_BDS_LIB_H_\r
#define _GENERIC_BDS_LIB_H_\r
\r
-#include <PiDxe.h>\r
#include <Protocol/HiiDatabase.h>\r
#include <IndustryStandard/PeImage.h>\r
\r
//\r
// Constants which are variable names used to access variables\r
//\r
-#define VarLegacyDevOrder L"LegacyDevOrder"\r
+#define VAR_LEGACY_DEV_ORDER L"LegacyDevOrder"\r
\r
//\r
// Data structures and defines\r
//\r
\r
//\r
-// Bds boot relate lib functions\r
+// Bds boot related lib functions\r
//\r
/**\r
- Boot from the EFI1.1 spec defined "BootNext" variable\r
+ Boot from the UEFI spec defined "BootNext" variable.\r
\r
**/\r
VOID\r
);\r
\r
/**\r
- Process the boot option follow the EFI 1.1 specification and\r
+ Process the boot option follow the UEFI specification and\r
special treat the legacy boot option with BBS_DEVICE_PATH.\r
\r
@param Option The boot option need to be processed\r
@param DevicePath The device path which describe where to load the\r
boot image or the legcy BBS device path to boot\r
the legacy OS\r
- @param ExitDataSize Returned directly from gBS->StartImage ()\r
- @param ExitData Returned directly from gBS->StartImage ()\r
+ @param ExitDataSize The size of exit data.\r
+ @param ExitData Data returned when Boot image failed.\r
\r
- @retval EFI_SUCCESS Status from gBS->StartImage ()\r
+ @retval EFI_SUCCESS Boot from the input boot option successfully.\r
@retval EFI_NOT_FOUND If the Device Path is not found in the system\r
\r
**/\r
boot option\r
@param BdsBootOptionList The header of the link list which indexed all\r
current boot options\r
-\r
- @return VOID\r
+ @param String The description of the boot option.\r
\r
**/\r
VOID\r
\r
\r
/**\r
- Build the on flash shell boot option with the handle parsed in\r
+ Build the on flash shell boot option with the handle parsed in.\r
\r
@param Handle The handle which present the device path to create\r
on flash shell boot option\r
@param BdsBootOptionList The header of the link list which indexed all\r
current boot options\r
\r
- @return None\r
-\r
**/\r
VOID\r
EFIAPI\r
@param VendorGuid GUID part of EFI variable name\r
@param VariableSize Returns the size of the EFI variable that was read\r
\r
- @return Dynamically allocated memory that contains a copy of the EFI variable.\r
- @return Caller is responsible freeing the buffer.\r
+ @return Dynamically allocated memory that contains a copy of the EFI variable\r
+ Caller is responsible freeing the buffer.\r
@retval NULL Variable was not read\r
\r
**/\r
\r
/**\r
Build the boot#### or driver#### option from the VariableName, the\r
- build boot#### or driver#### will also be linked to BdsCommonOptionList\r
+ build boot#### or driver#### will also be linked to BdsCommonOptionList.\r
\r
@param BdsCommonOptionList The header of the boot#### or driver#### option\r
link list\r
);\r
\r
//\r
-// Bds console relate lib functions\r
+// Bds console related lib functions\r
//\r
/**\r
This function will search every simpletxt devive in current system,\r
\r
@retval EFI_SUCCESS At least one of the ConIn and ConOut device have\r
been connected success.\r
- @retval EFI_STATUS Return the status of\r
- BdsLibConnectConsoleVariable ().\r
+ @retval EFI_STATUS Return the status of BdsLibConnectConsoleVariable ().\r
\r
**/\r
EFI_STATUS\r
from the console variable ConVarName, this\r
parameter can not be multi-instance.\r
\r
- @retval EFI_UNSUPPORTED Add or remove the same device path.\r
+ @retval EFI_UNSUPPORTED The added device path is same to the removed one.\r
@retval EFI_SUCCESS Success add or remove the device path from the\r
console variable.\r
\r
);\r
\r
//\r
-// Bds device path relate lib functions\r
+// Bds device path related lib functions\r
//\r
/**\r
Function unpacks a device path data structure so that all the nodes\r
@param Single A pointer to a single-instance device path data\r
structure.\r
\r
- @retval TRUE If the Single is contained within Multi\r
- @retval FALSE The Single is not match within Multi\r
+ @retval TRUE If the Single device path is contained within Multi device path.\r
+ @retval FALSE The Single device path is not match within Multi device path.\r
\r
**/\r
BOOLEAN\r
//\r
#if defined (MDE_CPU_IPF)\r
#define EFI64_SHADOW_ALL_LEGACY_ROM() ShadowAllOptionRom ();\r
-VOID\r
-ShadowAllOptionRom();\r
#else\r
#define EFI64_SHADOW_ALL_LEGACY_ROM()\r
#endif\r
\r
+/**\r
+ Shadow all Legacy OptionRom. \r
+\r
+**/\r
+VOID\r
+EFIAPI\r
+ShadowAllOptionRom (\r
+ VOID\r
+ );\r
+\r
//\r
// BBS support macros and functions\r
//\r
#define REFRESH_LEGACY_BOOT_OPTIONS\r
#endif\r
\r
+/**\r
+ Delete all the invalid legacy boot options.\r
+\r
+ @retval EFI_SUCCESS All invalide legacy boot options are deleted.\r
+ @retval EFI_OUT_OF_RESOURCES Fail to allocate necessary memory.\r
+ @retval EFI_NOT_FOUND Fail to retrive variable of boot order.\r
+\r
+**/\r
EFI_STATUS\r
+EFIAPI\r
BdsDeleteAllInvalidLegacyBootOptions (\r
VOID\r
);\r
\r
+/**\r
+\r
+ Add the legacy boot options from BBS table if they do not exist.\r
+\r
+ @retval EFI_SUCCESS The boot options are added successfully \r
+ or they are already in boot options.\r
+\r
+**/\r
EFI_STATUS\r
+EFIAPI\r
BdsAddNonExistingLegacyBootOptions (\r
VOID\r
);\r
\r
+/**\r
+\r
+ Add the legacy boot devices from BBS table into \r
+ the legacy device boot order.\r
+\r
+ @retval EFI_SUCCESS The boot devices are added successfully.\r
+\r
+**/\r
EFI_STATUS\r
+EFIAPI\r
BdsUpdateLegacyDevOrder (\r
VOID\r
);\r
\r
+/**\r
+\r
+ Set the boot priority for BBS entries based on boot option entry and boot order.\r
+\r
+ @param Entry The boot option is to be checked for refresh BBS table.\r
+ \r
+ @retval EFI_SUCCESS The boot priority for BBS entries is refreshed successfully.\r
+\r
+**/\r
EFI_STATUS\r
+EFIAPI\r
BdsRefreshBbsTableForBoot (\r
IN BDS_COMMON_OPTION *Entry\r
);\r
\r
+/**\r
+\r
+ Delete boot option specified by OptionNumber and adjust the boot order.\r
+\r
+ @param OptionNumber The boot option to be deleted.\r
+ @param BootOrder Boot order list to be adjusted by remove this boot option.\r
+ @param BootOrderSize The size of Boot order list will be modified.\r
+ \r
+ @retval EFI_SUCCESS The boot option is deleted successfully.\r
+\r
+**/\r
EFI_STATUS\r
+EFIAPI\r
BdsDeleteBootOption (\r
IN UINTN OptionNumber,\r
IN OUT UINT16 *BootOrder,\r
@param Device SimpleFileSystem device handle\r
@param FileName File name for the image\r
@param DosHeader Pointer to dos header\r
- @param ImageHeader Pointer to image header\r
- @param OptionalHeader Pointer to optional header\r
+ @param Hdr The buffer in which to return the PE32, PE32+, or TE header.\r
\r
@retval EFI_SUCCESS Successfully get the machine type.\r
@retval EFI_NOT_FOUND The file is not found.\r
@param HardDriveDevicePath A device path which starts with a hard drive media\r
device path.\r
\r
- @retval TRUE There is a matched device path instance FALSE\r
- -There is no matched device path instance\r
+ @retval TRUE There is a matched device path instance.\r
+ @retval FALSE There is no matched device path instance.\r
\r
**/\r
BOOLEAN\r
\r
@param DevicePath Device Path to a bootable device\r
\r
- @retval NULL The device path points to an EFI bootable Media\r
@retval NULL The media on the DevicePath is not bootable\r
\r
**/\r
Check whether the Device path in a boot option point to a valide bootable device,\r
And if CheckMedia is true, check the device is ready to boot now.\r
\r
- DevPath -- the Device path in a boot option\r
- CheckMedia -- if true, check the device is ready to boot now.\r
+ @param DevPath the Device path in a boot option\r
+ @param CheckMedia if true, check the device is ready to boot now.\r
\r
- @return TRUE -- the Device path is valide\r
- @return FALSE -- the Device path is invalide .\r
+ @retval TRUE the Device path is valide\r
+ @retval FALSE the Device path is invalide .\r
\r
**/\r
BOOLEAN\r
);\r
\r
/**\r
- For a bootable Device path, return its boot type\r
+ For a bootable Device path, return its boot type.\r
\r
@param DevicePath The bootable device Path to check\r
\r
\r
\r
/**\r
- This routine register a function to adjust the different type memory page number just before booting\r
- and save the updated info into the variable for next boot to use\r
+ This routine register a function to adjust the different type memory page number\r
+ just before booting and save the updated info into the variable for next boot to use.\r
\r
**/\r
VOID\r
@param HostControllerPI Uhci (0x00) or Ehci (0x20) or Both uhci and ehci\r
(0xFF)\r
@param RemainingDevicePath a short-form device path that starts with the first\r
- element being a USB WWID or a USB Class device\r
+ element being a USB WWID or a USB Class device\r
path\r
\r
- @return EFI_INVALID_PARAMETER\r
- @return EFI_SUCCESS\r
- @return EFI_NOT_FOUND\r
+ @retval EFI_SUCCESS The specific Usb device is connected successfully.\r
+ @retval EFI_INVALID_PARAMETER Invalid HostControllerPi (not 0x00, 0x20 or 0xFF) \r
+ or RemainingDevicePath is not the USB class device path.\r
+ @retval EFI_NOT_FOUND The device specified by device path is not found.\r
\r
**/\r
EFI_STATUS\r
// The implementation of this function is provided by Platform code.\r
//\r
/**\r
- Convert Vendor device path to device name\r
+ Convert Vendor device path to device name.\r
\r
@param Str The buffer store device name\r
@param DevPath Pointer to vendor device path\r
\r
- @return When it return, the device name have been stored in *Str.\r
-\r
**/\r
VOID\r
EFIAPI\r
DevPathVendor (\r
IN OUT POOL_PRINT *Str,\r
IN VOID *DevPath\r
- )\r
-;\r
+ );\r
\r
/**\r
Concatenates a formatted unicode string to allocated pool.\r
The caller must free the resulting buffer.\r
\r
- @param Str Tracks the allocated pool, size in use, and amount of pool\r
- allocated.\r
+ @param Str Tracks the allocated pool, size in use, and amount of pool allocated.\r
@param fmt The format string\r
+ @param ... The data will be printed.\r
\r
@return Allocated buffer with the formatted string printed in it.\r
- @return The caller must free the allocated buffer. The buffer\r
- @return allocation is not packed.\r
+ The caller must free the allocated buffer.\r
+ The buffer allocation is not packed.\r
\r
**/\r
CHAR16 *\r
IN OUT POOL_PRINT *Str,\r
IN CHAR16 *fmt,\r
...\r
- )\r
-;\r
+ );\r
#endif\r
\r