mirror of https://github.com/acidanthera/audk.git
Refine BdsDxe driver and GenericBdsLib library so that the GenericBdsLib doesn't depend on the BdsDxe implementation.
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Eric Dong <eric.dong@intel.com> git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13418 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
38fcd0270f
commit
16e5944abd
File diff suppressed because it is too large
Load Diff
|
@ -701,21 +701,9 @@ BdsLibVariableToOption (
|
||||||
+ (UINT16) (CharToUint (VariableName[NumOff+2]) * 0x10)
|
+ (UINT16) (CharToUint (VariableName[NumOff+2]) * 0x10)
|
||||||
+ (UINT16) (CharToUint (VariableName[NumOff+3]) * 0x1);
|
+ (UINT16) (CharToUint (VariableName[NumOff+3]) * 0x1);
|
||||||
}
|
}
|
||||||
//
|
InsertTailList (BdsCommonOptionList, &Option->Link);
|
||||||
// Insert active entry to BdsDeviceList
|
|
||||||
//
|
|
||||||
if ((Option->Attribute & LOAD_OPTION_ACTIVE) == LOAD_OPTION_ACTIVE) {
|
|
||||||
InsertTailList (BdsCommonOptionList, &Option->Link);
|
|
||||||
FreePool (Variable);
|
|
||||||
return Option;
|
|
||||||
}
|
|
||||||
|
|
||||||
FreePool (Variable);
|
FreePool (Variable);
|
||||||
FreePool (Option->Description);
|
return Option;
|
||||||
FreePool (Option->DevicePath);
|
|
||||||
FreePool (Option->LoadOptions);
|
|
||||||
FreePool (Option);
|
|
||||||
return NULL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -51,6 +51,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||||
#include <Guid/BdsLibHii.h>
|
#include <Guid/BdsLibHii.h>
|
||||||
#include <Guid/HdBootVariable.h>
|
#include <Guid/HdBootVariable.h>
|
||||||
#include <Guid/LastEnumLang.h>
|
#include <Guid/LastEnumLang.h>
|
||||||
|
#include <Guid/LegacyDevOrder.h>
|
||||||
|
|
||||||
#include <Library/PrintLib.h>
|
#include <Library/PrintLib.h>
|
||||||
#include <Library/DebugLib.h>
|
#include <Library/DebugLib.h>
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1,7 +1,7 @@
|
||||||
/** @file
|
/** @file
|
||||||
declares interface functions
|
declares interface functions
|
||||||
|
|
||||||
Copyright (c) 2004 - 2008, Intel Corporation. All rights reserved.<BR>
|
Copyright (c) 2004 - 2012, Intel Corporation. All rights reserved.<BR>
|
||||||
This program and the accompanying materials
|
This program and the accompanying materials
|
||||||
are licensed and made available under the terms and conditions of the BSD License
|
are licensed and made available under the terms and conditions of the BSD License
|
||||||
which accompanies this distribution. The full text of the license may be found at
|
which accompanies this distribution. The full text of the license may be found at
|
||||||
|
@ -50,14 +50,10 @@ BdsBuildLegacyDevNameString (
|
||||||
2. Input = [Efi1 Efi0 CdRom1 Harddisk0 Harddisk1 Harddisk2 CdRom0 CdRom2]
|
2. Input = [Efi1 Efi0 CdRom1 Harddisk0 Harddisk1 Harddisk2 CdRom0 CdRom2]
|
||||||
Assuming [Efi1 Efi0 CdRom1 Harddisk0] is ordered properly
|
Assuming [Efi1 Efi0 CdRom1 Harddisk0] is ordered properly
|
||||||
Output = [Efi1 Efi0 CdRom1 CdRom0 CdRom2 Harddisk0 Harddisk1 Harddisk2]
|
Output = [Efi1 Efi0 CdRom1 CdRom0 CdRom2 Harddisk0 Harddisk1 Harddisk2]
|
||||||
|
|
||||||
@param BootOption Pointer to buffer containing Boot Option Numbers
|
|
||||||
@param BootOptionCount Count of the Boot Option Numbers
|
|
||||||
**/
|
**/
|
||||||
VOID
|
VOID
|
||||||
GroupMultipleLegacyBootOption4SameType (
|
GroupMultipleLegacyBootOption4SameType (
|
||||||
UINT16 *BootOption,
|
VOID
|
||||||
UINTN BootOptionCount
|
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -66,25 +62,21 @@ GroupMultipleLegacyBootOption4SameType (
|
||||||
The routine re-orders the Boot Option in BootOption array according to
|
The routine re-orders the Boot Option in BootOption array according to
|
||||||
the order specified by DevOrder.
|
the order specified by DevOrder.
|
||||||
|
|
||||||
@param BootOption Pointer to buffer containing the Boot Option Numbers
|
|
||||||
@param BootOptionCount Count of the Boot Option Numbers
|
|
||||||
@param DevOrder Pointer to buffer containing the BBS Index,
|
@param DevOrder Pointer to buffer containing the BBS Index,
|
||||||
high 8-bit value 0xFF indicating a disabled boot option
|
high 8-bit value 0xFF indicating a disabled boot option
|
||||||
@param DevOrderCount Count of the BBS Index
|
@param DevOrderCount Count of the BBS Index
|
||||||
@param EnBootOption Pointer to buffer receiving the enabled Boot Option Numbers
|
@param EnBootOption Callee allocated buffer containing the enabled Boot Option Numbers
|
||||||
@param EnBootOptionCount Count of the enabled Boot Option Numbers
|
@param EnBootOptionCount Count of the enabled Boot Option Numbers
|
||||||
@param DisBootOption Pointer to buffer receiving the disabled Boot Option Numbers
|
@param DisBootOption Callee allocated buffer containing the disabled Boot Option Numbers
|
||||||
@param DisBootOptionCount Count of the disabled Boot Option Numbers
|
@param DisBootOptionCount Count of the disabled Boot Option Numbers
|
||||||
**/
|
**/
|
||||||
VOID
|
VOID
|
||||||
OrderLegacyBootOption4SameType (
|
OrderLegacyBootOption4SameType (
|
||||||
UINT16 *BootOption,
|
|
||||||
UINTN BootOptionCount,
|
|
||||||
UINT16 *DevOrder,
|
UINT16 *DevOrder,
|
||||||
UINTN DevOrderCount,
|
UINTN DevOrderCount,
|
||||||
UINT16 *EnBootOption,
|
UINT16 **EnBootOption,
|
||||||
UINTN *EnBootOptionCount,
|
UINTN *EnBootOptionCount,
|
||||||
UINT16 *DisBootOption,
|
UINT16 **DisBootOption,
|
||||||
UINTN *DisBootOptionCount
|
UINTN *DisBootOptionCount
|
||||||
);
|
);
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/** @file
|
/** @file
|
||||||
Utility routines used by boot maintenance modules.
|
Utility routines used by boot maintenance modules.
|
||||||
|
|
||||||
Copyright (c) 2004 - 2009, Intel Corporation. All rights reserved.<BR>
|
Copyright (c) 2004 - 2012, Intel Corporation. All rights reserved.<BR>
|
||||||
This program and the accompanying materials
|
This program and the accompanying materials
|
||||||
are licensed and made available under the terms and conditions of the BSD License
|
are licensed and made available under the terms and conditions of the BSD License
|
||||||
which accompanies this distribution. The full text of the license may be found at
|
which accompanies this distribution. The full text of the license may be found at
|
||||||
|
@ -14,36 +14,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||||
|
|
||||||
#include "BootMaint.h"
|
#include "BootMaint.h"
|
||||||
|
|
||||||
/**
|
|
||||||
|
|
||||||
Find the first instance of this Protocol
|
|
||||||
in the system and return it's interface.
|
|
||||||
|
|
||||||
|
|
||||||
@param ProtocolGuid Provides the protocol to search for
|
|
||||||
@param Interface On return, a pointer to the first interface
|
|
||||||
that matches ProtocolGuid
|
|
||||||
|
|
||||||
@retval EFI_SUCCESS A protocol instance matching ProtocolGuid was found
|
|
||||||
@retval EFI_NOT_FOUND No protocol instances were found that match ProtocolGuid
|
|
||||||
|
|
||||||
**/
|
|
||||||
EFI_STATUS
|
|
||||||
EfiLibLocateProtocol (
|
|
||||||
IN EFI_GUID *ProtocolGuid,
|
|
||||||
OUT VOID **Interface
|
|
||||||
)
|
|
||||||
{
|
|
||||||
EFI_STATUS Status;
|
|
||||||
|
|
||||||
Status = gBS->LocateProtocol (
|
|
||||||
ProtocolGuid,
|
|
||||||
NULL,
|
|
||||||
(VOID **) Interface
|
|
||||||
);
|
|
||||||
return Status;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
||||||
Function opens and returns a file handle to the root directory of a volume.
|
Function opens and returns a file handle to the root directory of a volume.
|
||||||
|
@ -201,7 +171,13 @@ EfiLibDeleteVariable (
|
||||||
//
|
//
|
||||||
// Delete variable from Storage
|
// Delete variable from Storage
|
||||||
//
|
//
|
||||||
Status = gRT->SetVariable (VarName, VarGuid, VAR_FLAG, 0, NULL);
|
Status = gRT->SetVariable (
|
||||||
|
VarName,
|
||||||
|
VarGuid,
|
||||||
|
EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS | EFI_VARIABLE_NON_VOLATILE,
|
||||||
|
0,
|
||||||
|
NULL
|
||||||
|
);
|
||||||
ASSERT (!EFI_ERROR (Status));
|
ASSERT (!EFI_ERROR (Status));
|
||||||
FreePool (VarBuf);
|
FreePool (VarBuf);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/** @file
|
/** @file
|
||||||
The functions for Boot Maintainence Main menu.
|
The functions for Boot Maintainence Main menu.
|
||||||
|
|
||||||
Copyright (c) 2004 - 2011, Intel Corporation. All rights reserved.<BR>
|
Copyright (c) 2004 - 2012, Intel Corporation. All rights reserved.<BR>
|
||||||
This program and the accompanying materials
|
This program and the accompanying materials
|
||||||
are licensed and made available under the terms and conditions of the BSD License
|
are licensed and made available under the terms and conditions of the BSD License
|
||||||
which accompanies this distribution. The full text of the license may be found at
|
which accompanies this distribution. The full text of the license may be found at
|
||||||
|
@ -1016,7 +1016,7 @@ InitializeBM (
|
||||||
UpdateTerminalPage (BmmCallbackInfo);
|
UpdateTerminalPage (BmmCallbackInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
Status = EfiLibLocateProtocol (&gEfiLegacyBiosProtocolGuid, (VOID **) &LegacyBios);
|
Status = gBS->LocateProtocol (&gEfiLegacyBiosProtocolGuid, NULL, (VOID **) &LegacyBios);
|
||||||
if (!EFI_ERROR (Status)) {
|
if (!EFI_ERROR (Status)) {
|
||||||
RefreshUpdateData ();
|
RefreshUpdateData ();
|
||||||
mStartLabel->Number = FORM_BOOT_LEGACY_DEVICE_ID;
|
mStartLabel->Number = FORM_BOOT_LEGACY_DEVICE_ID;
|
||||||
|
@ -1327,6 +1327,11 @@ BdsStartBootMaint (
|
||||||
//
|
//
|
||||||
BdsLibEnumerateAllBootOption (&BdsBootOptionList);
|
BdsLibEnumerateAllBootOption (&BdsBootOptionList);
|
||||||
|
|
||||||
|
//
|
||||||
|
// Group the legacy boot options for the same device type
|
||||||
|
//
|
||||||
|
GroupMultipleLegacyBootOption4SameType ();
|
||||||
|
|
||||||
//
|
//
|
||||||
// Init the BMM
|
// Init the BMM
|
||||||
//
|
//
|
||||||
|
@ -1404,60 +1409,3 @@ FormSetDispatcher (
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
Deletete the Boot Option from EFI Variable. The Boot Order Arrray
|
|
||||||
is also updated.
|
|
||||||
|
|
||||||
@param OptionNumber The number of Boot option want to be deleted.
|
|
||||||
@param BootOrder The Boot Order array.
|
|
||||||
@param BootOrderSize The size of the Boot Order Array.
|
|
||||||
|
|
||||||
@retval EFI_SUCCESS The Boot Option Variable was found and removed
|
|
||||||
@retval EFI_UNSUPPORTED The Boot Option Variable store was inaccessible
|
|
||||||
@retval EFI_NOT_FOUND The Boot Option Variable was not found
|
|
||||||
**/
|
|
||||||
EFI_STATUS
|
|
||||||
EFIAPI
|
|
||||||
BdsDeleteBootOption (
|
|
||||||
IN UINTN OptionNumber,
|
|
||||||
IN OUT UINT16 *BootOrder,
|
|
||||||
IN OUT UINTN *BootOrderSize
|
|
||||||
)
|
|
||||||
{
|
|
||||||
UINT16 BootOption[100];
|
|
||||||
UINTN Index;
|
|
||||||
EFI_STATUS Status;
|
|
||||||
UINTN Index2Del;
|
|
||||||
|
|
||||||
Status = EFI_SUCCESS;
|
|
||||||
Index2Del = 0;
|
|
||||||
|
|
||||||
UnicodeSPrint (BootOption, sizeof (BootOption), L"Boot%04x", OptionNumber);
|
|
||||||
Status = EfiLibDeleteVariable (BootOption, &gEfiGlobalVariableGuid);
|
|
||||||
|
|
||||||
//
|
|
||||||
// adjust boot order array
|
|
||||||
//
|
|
||||||
for (Index = 0; Index < *BootOrderSize / sizeof (UINT16); Index++) {
|
|
||||||
if (BootOrder[Index] == OptionNumber) {
|
|
||||||
Index2Del = Index;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (Index != *BootOrderSize / sizeof (UINT16)) {
|
|
||||||
for (Index = 0; Index < *BootOrderSize / sizeof (UINT16) - 1; Index++) {
|
|
||||||
if (Index >= Index2Del) {
|
|
||||||
BootOrder[Index] = BootOrder[Index + 1];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
*BootOrderSize -= sizeof (UINT16);
|
|
||||||
}
|
|
||||||
|
|
||||||
return Status;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/** @file
|
/** @file
|
||||||
Header file for boot maintenance module.
|
Header file for boot maintenance module.
|
||||||
|
|
||||||
Copyright (c) 2004 - 2011, Intel Corporation. All rights reserved.<BR>
|
Copyright (c) 2004 - 2012, Intel Corporation. All rights reserved.<BR>
|
||||||
This program and the accompanying materials
|
This program and the accompanying materials
|
||||||
are licensed and made available under the terms and conditions of the BSD License
|
are licensed and made available under the terms and conditions of the BSD License
|
||||||
which accompanies this distribution. The full text of the license may be found at
|
which accompanies this distribution. The full text of the license may be found at
|
||||||
|
@ -39,11 +39,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||||
#define STR_NET_HELP L"NET Drive #%02x"
|
#define STR_NET_HELP L"NET Drive #%02x"
|
||||||
#define STR_BEV_HELP L"BEV Drive #%02x"
|
#define STR_BEV_HELP L"BEV Drive #%02x"
|
||||||
|
|
||||||
//
|
|
||||||
// Variable created with this flag will be "Efi:...."
|
|
||||||
//
|
|
||||||
#define VAR_FLAG EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS | EFI_VARIABLE_NON_VOLATILE
|
|
||||||
|
|
||||||
extern CHAR16 mFileExplorerStorageName[];
|
extern CHAR16 mFileExplorerStorageName[];
|
||||||
extern CHAR16 mBootMaintStorageName[];
|
extern CHAR16 mBootMaintStorageName[];
|
||||||
//
|
//
|
||||||
|
@ -238,18 +233,6 @@ typedef struct {
|
||||||
UINT16 StringToken;
|
UINT16 StringToken;
|
||||||
} COM_ATTR;
|
} COM_ATTR;
|
||||||
|
|
||||||
#pragma pack(1)
|
|
||||||
///
|
|
||||||
/// For each legacy boot option in BBS table, a corresponding Boot#### variables is created.
|
|
||||||
/// The structure saves the mapping relationship between #### and the index in the BBS table.
|
|
||||||
///
|
|
||||||
typedef struct {
|
|
||||||
UINT16 BootOptionNumber;
|
|
||||||
UINT16 BbsIndex;
|
|
||||||
UINT16 BbsType;
|
|
||||||
} BOOT_OPTION_BBS_MAPPING;
|
|
||||||
#pragma pack()
|
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
UINT64 BaudRate;
|
UINT64 BaudRate;
|
||||||
UINT8 DataBits;
|
UINT8 DataBits;
|
||||||
|
@ -1160,23 +1143,6 @@ EfiLibFileInfo (
|
||||||
IN EFI_FILE_HANDLE FHand
|
IN EFI_FILE_HANDLE FHand
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
|
||||||
Find the first instance of this Protocol in the system and return it's interface.
|
|
||||||
|
|
||||||
@param ProtocolGuid Provides the protocol to search for
|
|
||||||
@param Interface On return, a pointer to the first interface
|
|
||||||
that matches ProtocolGuid
|
|
||||||
|
|
||||||
@retval EFI_SUCCESS A protocol instance matching ProtocolGuid was found
|
|
||||||
@retval EFI_NOT_FOUND No protocol instances were found that match ProtocolGuid
|
|
||||||
|
|
||||||
**/
|
|
||||||
EFI_STATUS
|
|
||||||
EfiLibLocateProtocol (
|
|
||||||
IN EFI_GUID *ProtocolGuid,
|
|
||||||
OUT VOID **Interface
|
|
||||||
);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Adjusts the size of a previously allocated buffer.
|
Adjusts the size of a previously allocated buffer.
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/** @file
|
/** @file
|
||||||
Variable operation that will be used by bootmaint
|
Variable operation that will be used by bootmaint
|
||||||
|
|
||||||
Copyright (c) 2004 - 2011, Intel Corporation. All rights reserved.<BR>
|
Copyright (c) 2004 - 2012, Intel Corporation. All rights reserved.<BR>
|
||||||
This program and the accompanying materials
|
This program and the accompanying materials
|
||||||
are licensed and made available under the terms and conditions of the BSD License
|
are licensed and made available under the terms and conditions of the BSD License
|
||||||
which accompanies this distribution. The full text of the license may be found at
|
which accompanies this distribution. The full text of the license may be found at
|
||||||
|
@ -161,7 +161,7 @@ Var_ChangeBootOrder (
|
||||||
Status = gRT->SetVariable (
|
Status = gRT->SetVariable (
|
||||||
L"BootOrder",
|
L"BootOrder",
|
||||||
&gEfiGlobalVariableGuid,
|
&gEfiGlobalVariableGuid,
|
||||||
VAR_FLAG,
|
EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS | EFI_VARIABLE_NON_VOLATILE,
|
||||||
BootOrderListSize * sizeof (UINT16),
|
BootOrderListSize * sizeof (UINT16),
|
||||||
BootOrderList
|
BootOrderList
|
||||||
);
|
);
|
||||||
|
@ -299,7 +299,7 @@ Var_ChangeDriverOrder (
|
||||||
Status = gRT->SetVariable (
|
Status = gRT->SetVariable (
|
||||||
L"DriverOrder",
|
L"DriverOrder",
|
||||||
&gEfiGlobalVariableGuid,
|
&gEfiGlobalVariableGuid,
|
||||||
VAR_FLAG,
|
EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS | EFI_VARIABLE_NON_VOLATILE,
|
||||||
DriverOrderListSize * sizeof (UINT16),
|
DriverOrderListSize * sizeof (UINT16),
|
||||||
DriverOrderList
|
DriverOrderList
|
||||||
);
|
);
|
||||||
|
@ -334,7 +334,7 @@ Var_UpdateAllConsoleOption (
|
||||||
Status = gRT->SetVariable (
|
Status = gRT->SetVariable (
|
||||||
L"ConOut",
|
L"ConOut",
|
||||||
&gEfiGlobalVariableGuid,
|
&gEfiGlobalVariableGuid,
|
||||||
VAR_FLAG,
|
EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS | EFI_VARIABLE_NON_VOLATILE,
|
||||||
GetDevicePathSize (OutDevicePath),
|
GetDevicePathSize (OutDevicePath),
|
||||||
OutDevicePath
|
OutDevicePath
|
||||||
);
|
);
|
||||||
|
@ -346,7 +346,7 @@ Var_UpdateAllConsoleOption (
|
||||||
Status = gRT->SetVariable (
|
Status = gRT->SetVariable (
|
||||||
L"ConIn",
|
L"ConIn",
|
||||||
&gEfiGlobalVariableGuid,
|
&gEfiGlobalVariableGuid,
|
||||||
VAR_FLAG,
|
EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS | EFI_VARIABLE_NON_VOLATILE,
|
||||||
GetDevicePathSize (InpDevicePath),
|
GetDevicePathSize (InpDevicePath),
|
||||||
InpDevicePath
|
InpDevicePath
|
||||||
);
|
);
|
||||||
|
@ -358,7 +358,7 @@ Var_UpdateAllConsoleOption (
|
||||||
Status = gRT->SetVariable (
|
Status = gRT->SetVariable (
|
||||||
L"ErrOut",
|
L"ErrOut",
|
||||||
&gEfiGlobalVariableGuid,
|
&gEfiGlobalVariableGuid,
|
||||||
VAR_FLAG,
|
EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS | EFI_VARIABLE_NON_VOLATILE,
|
||||||
GetDevicePathSize (ErrDevicePath),
|
GetDevicePathSize (ErrDevicePath),
|
||||||
ErrDevicePath
|
ErrDevicePath
|
||||||
);
|
);
|
||||||
|
@ -461,7 +461,7 @@ Var_UpdateConsoleOption (
|
||||||
Status = gRT->SetVariable (
|
Status = gRT->SetVariable (
|
||||||
ConsoleName,
|
ConsoleName,
|
||||||
&gEfiGlobalVariableGuid,
|
&gEfiGlobalVariableGuid,
|
||||||
VAR_FLAG,
|
EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS | EFI_VARIABLE_NON_VOLATILE,
|
||||||
GetDevicePathSize (ConDevicePath),
|
GetDevicePathSize (ConDevicePath),
|
||||||
ConDevicePath
|
ConDevicePath
|
||||||
);
|
);
|
||||||
|
@ -663,7 +663,7 @@ Var_UpdateDriverOption (
|
||||||
Status = gRT->SetVariable (
|
Status = gRT->SetVariable (
|
||||||
DriverString,
|
DriverString,
|
||||||
&gEfiGlobalVariableGuid,
|
&gEfiGlobalVariableGuid,
|
||||||
VAR_FLAG,
|
EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS | EFI_VARIABLE_NON_VOLATILE,
|
||||||
BufferSize,
|
BufferSize,
|
||||||
Buffer
|
Buffer
|
||||||
);
|
);
|
||||||
|
@ -684,7 +684,7 @@ Var_UpdateDriverOption (
|
||||||
Status = gRT->SetVariable (
|
Status = gRT->SetVariable (
|
||||||
L"DriverOrder",
|
L"DriverOrder",
|
||||||
&gEfiGlobalVariableGuid,
|
&gEfiGlobalVariableGuid,
|
||||||
VAR_FLAG,
|
EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS | EFI_VARIABLE_NON_VOLATILE,
|
||||||
DriverOrderListSize + sizeof (UINT16),
|
DriverOrderListSize + sizeof (UINT16),
|
||||||
NewDriverOrderList
|
NewDriverOrderList
|
||||||
);
|
);
|
||||||
|
@ -831,7 +831,7 @@ Var_UpdateBootOption (
|
||||||
Status = gRT->SetVariable (
|
Status = gRT->SetVariable (
|
||||||
BootString,
|
BootString,
|
||||||
&gEfiGlobalVariableGuid,
|
&gEfiGlobalVariableGuid,
|
||||||
VAR_FLAG,
|
EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS | EFI_VARIABLE_NON_VOLATILE,
|
||||||
BufferSize,
|
BufferSize,
|
||||||
Buffer
|
Buffer
|
||||||
);
|
);
|
||||||
|
@ -855,7 +855,7 @@ Var_UpdateBootOption (
|
||||||
Status = gRT->SetVariable (
|
Status = gRT->SetVariable (
|
||||||
L"BootOrder",
|
L"BootOrder",
|
||||||
&gEfiGlobalVariableGuid,
|
&gEfiGlobalVariableGuid,
|
||||||
VAR_FLAG,
|
EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS | EFI_VARIABLE_NON_VOLATILE,
|
||||||
BootOrderListSize + sizeof (UINT16),
|
BootOrderListSize + sizeof (UINT16),
|
||||||
NewBootOrderList
|
NewBootOrderList
|
||||||
);
|
);
|
||||||
|
@ -920,7 +920,7 @@ Var_UpdateBootNext (
|
||||||
Status = gRT->SetVariable (
|
Status = gRT->SetVariable (
|
||||||
L"BootNext",
|
L"BootNext",
|
||||||
&gEfiGlobalVariableGuid,
|
&gEfiGlobalVariableGuid,
|
||||||
VAR_FLAG,
|
EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS | EFI_VARIABLE_NON_VOLATILE,
|
||||||
sizeof (UINT16),
|
sizeof (UINT16),
|
||||||
&NewMenuEntry->OptionNumber
|
&NewMenuEntry->OptionNumber
|
||||||
);
|
);
|
||||||
|
@ -980,20 +980,17 @@ Var_UpdateBootOrder (
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
GroupMultipleLegacyBootOption4SameType (
|
|
||||||
BootOrderList,
|
|
||||||
BootOrderListSize / sizeof (UINT16)
|
|
||||||
);
|
|
||||||
|
|
||||||
Status = gRT->SetVariable (
|
Status = gRT->SetVariable (
|
||||||
L"BootOrder",
|
L"BootOrder",
|
||||||
&gEfiGlobalVariableGuid,
|
&gEfiGlobalVariableGuid,
|
||||||
VAR_FLAG,
|
EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS | EFI_VARIABLE_NON_VOLATILE,
|
||||||
BootOrderListSize,
|
BootOrderListSize,
|
||||||
BootOrderList
|
BootOrderList
|
||||||
);
|
);
|
||||||
FreePool (BootOrderList);
|
FreePool (BootOrderList);
|
||||||
|
|
||||||
|
GroupMultipleLegacyBootOption4SameType ();
|
||||||
|
|
||||||
BOpt_FreeMenu (&BootOptionMenu);
|
BOpt_FreeMenu (&BootOptionMenu);
|
||||||
BOpt_GetBootOptions (CallbackData);
|
BOpt_GetBootOptions (CallbackData);
|
||||||
|
|
||||||
|
@ -1057,7 +1054,7 @@ Var_UpdateDriverOrder (
|
||||||
Status = gRT->SetVariable (
|
Status = gRT->SetVariable (
|
||||||
L"DriverOrder",
|
L"DriverOrder",
|
||||||
&gEfiGlobalVariableGuid,
|
&gEfiGlobalVariableGuid,
|
||||||
VAR_FLAG,
|
EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS | EFI_VARIABLE_NON_VOLATILE,
|
||||||
DriverOrderListSize,
|
DriverOrderListSize,
|
||||||
NewDriverOrderList
|
NewDriverOrderList
|
||||||
);
|
);
|
||||||
|
@ -1108,7 +1105,6 @@ Var_UpdateBBSOption (
|
||||||
UINTN EnBootOptionCount;
|
UINTN EnBootOptionCount;
|
||||||
UINT16 *DisBootOption;
|
UINT16 *DisBootOption;
|
||||||
UINTN DisBootOptionCount;
|
UINTN DisBootOptionCount;
|
||||||
UINT16 *BootOrder;
|
|
||||||
|
|
||||||
DisMap = NULL;
|
DisMap = NULL;
|
||||||
NewOrder = NULL;
|
NewOrder = NULL;
|
||||||
|
@ -1219,7 +1215,7 @@ Var_UpdateBBSOption (
|
||||||
Status = gRT->SetVariable (
|
Status = gRT->SetVariable (
|
||||||
VAR_LEGACY_DEV_ORDER,
|
VAR_LEGACY_DEV_ORDER,
|
||||||
&gEfiLegacyDevOrderVariableGuid,
|
&gEfiLegacyDevOrderVariableGuid,
|
||||||
VAR_FLAG,
|
EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS | EFI_VARIABLE_NON_VOLATILE,
|
||||||
VarSize,
|
VarSize,
|
||||||
OriginalPtr
|
OriginalPtr
|
||||||
);
|
);
|
||||||
|
@ -1231,39 +1227,15 @@ Var_UpdateBBSOption (
|
||||||
// 1. Re-order the Option Number in BootOrder according to Legacy Dev Order
|
// 1. Re-order the Option Number in BootOrder according to Legacy Dev Order
|
||||||
//
|
//
|
||||||
ASSERT (OptionMenu->MenuNumber == DevOrder->Length / sizeof (UINT16) - 1);
|
ASSERT (OptionMenu->MenuNumber == DevOrder->Length / sizeof (UINT16) - 1);
|
||||||
BootOrder = BdsLibGetVariableAndSize (
|
|
||||||
L"BootOrder",
|
|
||||||
&gEfiGlobalVariableGuid,
|
|
||||||
&VarSize
|
|
||||||
);
|
|
||||||
ASSERT (BootOrder != NULL);
|
|
||||||
|
|
||||||
DisBootOption = AllocatePool (VarSize);
|
|
||||||
ASSERT (DisBootOption != NULL);
|
|
||||||
EnBootOption = AllocatePool (VarSize);
|
|
||||||
ASSERT (EnBootOption != NULL);
|
|
||||||
|
|
||||||
OrderLegacyBootOption4SameType (
|
OrderLegacyBootOption4SameType (
|
||||||
BootOrder,
|
|
||||||
VarSize / sizeof (UINT16),
|
|
||||||
DevOrder->Data,
|
DevOrder->Data,
|
||||||
DevOrder->Length / sizeof (UINT16) - 1,
|
DevOrder->Length / sizeof (UINT16) - 1,
|
||||||
EnBootOption,
|
&EnBootOption,
|
||||||
&EnBootOptionCount,
|
&EnBootOptionCount,
|
||||||
DisBootOption,
|
&DisBootOption,
|
||||||
&DisBootOptionCount
|
&DisBootOptionCount
|
||||||
);
|
);
|
||||||
|
|
||||||
Status = gRT->SetVariable (
|
|
||||||
L"BootOrder",
|
|
||||||
&gEfiGlobalVariableGuid,
|
|
||||||
VAR_FLAG,
|
|
||||||
VarSize,
|
|
||||||
BootOrder
|
|
||||||
);
|
|
||||||
ASSERT_EFI_ERROR (Status);
|
|
||||||
|
|
||||||
FreePool (BootOrder);
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// 2. Deactivate the DisBootOption and activate the EnBootOption
|
// 2. Deactivate the DisBootOption and activate the EnBootOption
|
||||||
|
@ -1282,7 +1254,7 @@ Var_UpdateBBSOption (
|
||||||
Status = gRT->SetVariable (
|
Status = gRT->SetVariable (
|
||||||
VarName,
|
VarName,
|
||||||
&gEfiGlobalVariableGuid,
|
&gEfiGlobalVariableGuid,
|
||||||
VAR_FLAG,
|
EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS | EFI_VARIABLE_NON_VOLATILE,
|
||||||
OptionSize,
|
OptionSize,
|
||||||
BootOptionVar
|
BootOptionVar
|
||||||
);
|
);
|
||||||
|
@ -1305,7 +1277,7 @@ Var_UpdateBBSOption (
|
||||||
Status = gRT->SetVariable (
|
Status = gRT->SetVariable (
|
||||||
VarName,
|
VarName,
|
||||||
&gEfiGlobalVariableGuid,
|
&gEfiGlobalVariableGuid,
|
||||||
VAR_FLAG,
|
EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS | EFI_VARIABLE_NON_VOLATILE,
|
||||||
OptionSize,
|
OptionSize,
|
||||||
BootOptionVar
|
BootOptionVar
|
||||||
);
|
);
|
||||||
|
|
|
@ -232,6 +232,14 @@ CallBootManager (
|
||||||
|
|
||||||
BdsLibEnumerateAllBootOption (&mBootOptionsList);
|
BdsLibEnumerateAllBootOption (&mBootOptionsList);
|
||||||
|
|
||||||
|
//
|
||||||
|
// Group the legacy boot options for the same device type
|
||||||
|
//
|
||||||
|
GroupMultipleLegacyBootOption4SameType ();
|
||||||
|
|
||||||
|
InitializeListHead (&mBootOptionsList);
|
||||||
|
BdsLibBuildOptionFromVar (&mBootOptionsList, L"BootOrder");
|
||||||
|
|
||||||
HiiHandle = gBootManagerPrivate.HiiHandle;
|
HiiHandle = gBootManagerPrivate.HiiHandle;
|
||||||
|
|
||||||
//
|
//
|
||||||
|
@ -268,9 +276,9 @@ CallBootManager (
|
||||||
mKeyInput++;
|
mKeyInput++;
|
||||||
|
|
||||||
//
|
//
|
||||||
// Don't display the boot option marked as LOAD_OPTION_HIDDEN
|
// Don't display the hidden/inactive boot option
|
||||||
//
|
//
|
||||||
if ((Option->Attribute & LOAD_OPTION_HIDDEN) != 0) {
|
if (((Option->Attribute & LOAD_OPTION_HIDDEN) != 0) || ((Option->Attribute & LOAD_OPTION_ACTIVE) == 0)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue