]> code.delx.au - refind/blobdiff - EfiLib/legacy.h
Merge commit '2ede1b8a25d32e057bcb9d246a9fd855a09bfc7c'
[refind] / EfiLib / legacy.h
index 61dba3825235470866ae4d1e35e262dad96aeb49..3384f48832171bec5b54fcd0c0b6f513c6f9dca5 100644 (file)
  *
  */
 
+#include "LegacyBios.h"
+
 #ifndef __LEGACY_H_
 #define __LEGACY_H_
 
+#define BBS_MEDIA_PRESENT        0x0800
+#define BBS_MEDIA_MAYBE_PRESENT  0x0400
+
+typedef UINT8 BBS_TYPE;
+
 #define VAR_FLAG  EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS | EFI_VARIABLE_NON_VOLATILE
 
 #pragma pack(1)
@@ -32,8 +39,18 @@ typedef struct {
 } BOOT_OPTION_BBS_MAPPING;
 #pragma pack()
 
+#pragma pack(1)
+typedef struct {
+   BBS_TYPE  BbsType;
+   ///
+   /// Length = sizeof (UINT16) + sizeof (Data)
+   ///
+   UINT16    Length;
+   UINT16    Data[1];
+} LEGACY_DEV_ORDER_ENTRY;
+#pragma pack()
+
 EFI_STATUS
-EFIAPI
 BdsAddNonExistingLegacyBootOptions (
    VOID
 );
@@ -46,25 +63,23 @@ BdsAddNonExistingLegacyBootOptions (
   @retval EFI_NOT_FOUND           Fail to retrive variable of boot order.
 **/
 EFI_STATUS
-EFIAPI
 BdsDeleteAllInvalidLegacyBootOptions (
   VOID
   );
 
-/**
-  Add the legacy boot devices from BBS table into 
-  the legacy device boot order.
+BOOLEAN
+BdsIsLegacyBootOption (
+   IN UINT8                 *BootOptionVar,
+   OUT BBS_TABLE            **BbsEntry,
+   OUT UINT16               *BbsIndex
+);
 
-  @retval EFI_SUCCESS           The boot devices are added successfully.
-  @retval EFI_NOT_FOUND         The legacy boot devices are not found.
-  @retval EFI_OUT_OF_RESOURCES  Memmory or storage is not enough.
-  @retval EFI_DEVICE_ERROR      Fail to add the legacy device boot order into EFI variable
-                                because of hardware error.
-**/
-// EFI_STATUS
-// EFIAPI
-// BdsUpdateLegacyDevOrder (
-//   VOID
-//   );
+VOID
+BdsBuildLegacyDevNameString (
+   IN  BBS_TABLE                 *CurBBSEntry,
+   IN  UINTN                     Index,
+   IN  UINTN                     BufSize,
+   OUT CHAR16                    *BootString
+);
 
 #endif
\ No newline at end of file