MdeModulePkg:Change the type of BootNext

Currently the invalid boot next set to the number of boot option,
when add a new boot option,also need update the boot next value,
otherwise it will be incorrect.Now set the type of BootNext value
to UINT32,the number out of the range of UINT16 means it is an
invalid BootNext Value.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19591 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
Dandan Bi 2016-01-06 00:55:12 +00:00 committed by dandanbi
parent 1f9f60ad5a
commit f79865264f
5 changed files with 14 additions and 12 deletions

View File

@ -1295,7 +1295,7 @@ InitializeBmmConfig (
//
// Initialize data which located in BMM main page
//
CallbackData->BmmFakeNvData.BootNext = (UINT16) (BootOptionMenu.MenuNumber);
CallbackData->BmmFakeNvData.BootNext = NONE_BOOTNEXT_VALUE;
for (Index = 0; Index < BootOptionMenu.MenuNumber; Index++) {
NewMenuEntry = BOpt_GetMenuEntry (&BootOptionMenu, Index);
NewLoadContext = (BM_LOAD_CONTEXT *) NewMenuEntry->VariableContext;

View File

@ -233,6 +233,8 @@ typedef enum _TYPE_OF_TERMINAL {
#define STRING_DEPOSITORY_NUMBER 8
#define NONE_BOOTNEXT_VALUE (0xFFFF + 1)
///
/// Serial Ports attributes, first one is the value for
/// return from callback function, stringtoken is used to

View File

@ -103,7 +103,7 @@ typedef struct {
// for Timeout, BootNext, Variables respectively
//
UINT16 BootTimeOut;
UINT16 BootNext;
UINT32 BootNext;
//
// This is the COM1 Attributes value storage

View File

@ -686,7 +686,7 @@ UpdateBootNextPage (
OptionsOpCodeHandle = HiiAllocateOpCodeHandle ();
ASSERT (OptionsOpCodeHandle != NULL);
CallbackData->BmmFakeNvData.BootNext = (UINT16) (BootOptionMenu.MenuNumber);
CallbackData->BmmFakeNvData.BootNext = NONE_BOOTNEXT_VALUE;
for (Index = 0; Index < BootOptionMenu.MenuNumber; Index++) {
NewMenuEntry = BOpt_GetMenuEntry (&BootOptionMenu, Index);
@ -697,7 +697,7 @@ UpdateBootNextPage (
OptionsOpCodeHandle,
NewMenuEntry->DisplayStringToken,
EFI_IFR_OPTION_DEFAULT,
EFI_IFR_TYPE_NUM_SIZE_16,
EFI_IFR_TYPE_NUM_SIZE_32,
Index
);
CallbackData->BmmFakeNvData.BootNext = Index;
@ -706,27 +706,27 @@ UpdateBootNextPage (
OptionsOpCodeHandle,
NewMenuEntry->DisplayStringToken,
0,
EFI_IFR_TYPE_NUM_SIZE_16,
EFI_IFR_TYPE_NUM_SIZE_32,
Index
);
}
}
if (CallbackData->BmmFakeNvData.BootNext == Index) {
if (CallbackData->BmmFakeNvData.BootNext == NONE_BOOTNEXT_VALUE) {
HiiCreateOneOfOptionOpCode (
OptionsOpCodeHandle,
STRING_TOKEN (STR_NONE),
EFI_IFR_OPTION_DEFAULT,
EFI_IFR_TYPE_NUM_SIZE_16,
Index
EFI_IFR_TYPE_NUM_SIZE_32,
NONE_BOOTNEXT_VALUE
);
} else {
HiiCreateOneOfOptionOpCode (
OptionsOpCodeHandle,
STRING_TOKEN (STR_NONE),
0,
EFI_IFR_TYPE_NUM_SIZE_16,
Index
EFI_IFR_TYPE_NUM_SIZE_32,
NONE_BOOTNEXT_VALUE
);
}
@ -738,7 +738,7 @@ UpdateBootNextPage (
STRING_TOKEN (STR_BOOT_NEXT),
STRING_TOKEN (STR_BOOT_NEXT_HELP),
0,
EFI_IFR_NUMERIC_SIZE_2,
EFI_IFR_NUMERIC_SIZE_4,
OptionsOpCodeHandle,
NULL
);

View File

@ -868,7 +868,7 @@ Var_UpdateBootNext (
NewLoadContext->IsBootNext = FALSE;
}
if (CurrentFakeNVMap->BootNext == BootOptionMenu.MenuNumber) {
if (CurrentFakeNVMap->BootNext == NONE_BOOTNEXT_VALUE) {
EfiLibDeleteVariable (L"BootNext", &gEfiGlobalVariableGuid);
return EFI_SUCCESS;
}