]> git.proxmox.com Git - mirror_edk2.git/blobdiff - IntelFrameworkModulePkg/Include/Library/GenericBdsLib.h
Fix BDS limitation of two "EFI DVD/CDROM" options appear after plug two CD-ROM.
[mirror_edk2.git] / IntelFrameworkModulePkg / Include / Library / GenericBdsLib.h
index a57fe6c8b4447288392378e838b306230e60ca79..c1cc82de2bba23b8597287c11cd24860db4614cc 100644 (file)
@@ -15,10 +15,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #ifndef _GENERIC_BDS_LIB_H_\r
 #define _GENERIC_BDS_LIB_H_\r
 \r
-#include <Protocol/HiiDatabase.h>\r
-#include <IndustryStandard/PeImage.h>\r
-\r
-\r
 extern EFI_HANDLE mBdsImageHandle;\r
 \r
 //\r
@@ -196,18 +192,6 @@ BdsLibBuildOptionFromShell (
 //\r
 // Bds misc lib functions\r
 //\r
-/**\r
-  Return the default value for system Timeout variable.\r
-\r
-  @return Timeout value.\r
-\r
-**/\r
-UINT16\r
-EFIAPI\r
-BdsLibGetTimeout (\r
-  VOID\r
-  );\r
-\r
 /**\r
   Get boot mode by looking up configuration table and parsing HOB list\r
 \r
@@ -785,27 +769,24 @@ SetupResetReminder (
   );\r
 \r
 \r
-/**\r
-  Get the headers (dos, image, optional header) from an image\r
-\r
-  @param  Device                SimpleFileSystem device handle\r
-  @param  FileName              File name for the image\r
-  @param  DosHeader             Pointer to dos 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
-  @retval EFI_LOAD_ERROR        File is not a valid image file.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-BdsLibGetImageHeader (\r
-  IN  EFI_HANDLE                  Device,\r
-  IN  CHAR16                      *FileName,\r
-  OUT EFI_IMAGE_DOS_HEADER        *DosHeader,\r
-  OUT EFI_IMAGE_OPTIONAL_HEADER_PTR_UNION   Hdr\r
-  );\r
+//\r
+// Define the boot option default description \r
+// NOTE: This is not defined in UEFI spec.\r
+//\r
+#define DESCRIPTION_FLOPPY        L"EFI Floppy"\r
+#define DESCRIPTION_FLOPPY_NUM    L"EFI Floppy %d"\r
+#define DESCRIPTION_DVD           L"EFI DVD/CDROM"\r
+#define DESCRIPTION_DVD_NUM       L"EFI DVD/CDROM %d"\r
+#define DESCRIPTION_USB           L"EFI USB Device"\r
+#define DESCRIPTION_USB_NUM       L"EFI USB Device %d"\r
+#define DESCRIPTION_SCSI          L"EFI SCSI Device"\r
+#define DESCRIPTION_SCSI_NUM      L"EFI SCSI Device %d"\r
+#define DESCRIPTION_MISC          L"EFI Misc Device"\r
+#define DESCRIPTION_MISC_NUM      L"EFI Misc Device %d"\r
+#define DESCRIPTION_NETWORK       L"EFI Network"\r
+#define DESCRIPTION_NETWORK_NUM   L"EFI Network %d"       \r
+#define DESCRIPTION_NON_BLOCK     L"EFI Non-Block Boot Device"\r
+#define DESCRIPTION_NON_BLOCK_NUM L"EFI Non-Block Boot Device %d"\r
 \r
 //\r
 // Define the boot type which to classify the boot option type\r
@@ -824,6 +805,7 @@ BdsLibGetImageHeader (
 #define  BDS_EFI_MESSAGE_ATAPI_BOOT       0x0301 // Type 03; Sub-Type 01\r
 #define  BDS_EFI_MESSAGE_SCSI_BOOT        0x0302 // Type 03; Sub-Type 02\r
 #define  BDS_EFI_MESSAGE_USB_DEVICE_BOOT  0x0305 // Type 03; Sub-Type 05\r
+#define  BDS_EFI_MESSAGE_SATA_BOOT        0x0318 // Type 03; Sub-Type 18\r
 #define  BDS_EFI_MESSAGE_MISC_BOOT        0x03FF\r
 //\r
 // Media boot type\r
@@ -920,7 +902,30 @@ BdsLibIsValidEFIBootOptDevicePath (
   IN EFI_DEVICE_PATH_PROTOCOL     *DevPath,\r
   IN BOOLEAN                      CheckMedia\r
   );\r
-  \r
+\r
+/**\r
+  Check whether the Device path in a boot option point to a valid bootable device,\r
+  And if CheckMedia is true, check the device is ready to boot now.\r
+  If Description is not NULL and the device path point to a fixed BlockIo\r
+  device, check the description whether conflict with other auto-created\r
+  boot options.\r
+\r
+  @param  DevPath     the Device path in a boot option\r
+  @param  CheckMedia  if true, check the device is ready to boot now.\r
+  @param  Description the description in a boot option\r
+\r
+  @retval TRUE        the Device path  is valid\r
+  @retval FALSE       the Device path  is invalid .\r
+\r
+**/\r
+BOOLEAN\r
+EFIAPI\r
+BdsLibIsValidEFIBootOptDevicePathExt (\r
+  IN EFI_DEVICE_PATH_PROTOCOL     *DevPath,\r
+  IN BOOLEAN                      CheckMedia,\r
+  IN CHAR16                       *Description\r
+  );\r
+\r
 /**\r
   For a bootable Device path, return its boot type.\r
 \r
@@ -1027,7 +1032,6 @@ BdsLibConnectUsbDevByShortFormDP(
 \r
 **/\r
 VOID\r
-EFIAPI\r
 DevPathVendor (\r
   IN OUT POOL_PRINT       *Str,\r
   IN VOID                 *DevPath\r