summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDandan Bi <dandan.bi@intel.com>2016-01-06 00:55:12 +0000
committerdandanbi <dandanbi@Edk2>2016-01-06 00:55:12 +0000
commitf79865264f58cc12e3ace3b83cbea1ee289a5e55 (patch)
tree41135f05b1b0bc473de1e8988b1597fa2ff64884
parent1f9f60ad5a2de3b6020b792296a1a69b826903fa (diff)
downloadedk2-f79865264f58cc12e3ace3b83cbea1ee289a5e55.zip
edk2-f79865264f58cc12e3ace3b83cbea1ee289a5e55.tar.gz
edk2-f79865264f58cc12e3ace3b83cbea1ee289a5e55.tar.bz2
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
-rw-r--r--MdeModulePkg/Library/BootMaintenanceManagerLib/BootMaintenance.c2
-rw-r--r--MdeModulePkg/Library/BootMaintenanceManagerLib/BootMaintenanceManager.h2
-rw-r--r--MdeModulePkg/Library/BootMaintenanceManagerLib/FormGuid.h2
-rw-r--r--MdeModulePkg/Library/BootMaintenanceManagerLib/UpdatePage.c18
-rw-r--r--MdeModulePkg/Library/BootMaintenanceManagerLib/Variable.c2
5 files changed, 14 insertions, 12 deletions
diff --git a/MdeModulePkg/Library/BootMaintenanceManagerLib/BootMaintenance.c b/MdeModulePkg/Library/BootMaintenanceManagerLib/BootMaintenance.c
index 55c294d..2d52f9b 100644
--- a/MdeModulePkg/Library/BootMaintenanceManagerLib/BootMaintenance.c
+++ b/MdeModulePkg/Library/BootMaintenanceManagerLib/BootMaintenance.c
@@ -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;
diff --git a/MdeModulePkg/Library/BootMaintenanceManagerLib/BootMaintenanceManager.h b/MdeModulePkg/Library/BootMaintenanceManagerLib/BootMaintenanceManager.h
index 6934a69..24526e1 100644
--- a/MdeModulePkg/Library/BootMaintenanceManagerLib/BootMaintenanceManager.h
+++ b/MdeModulePkg/Library/BootMaintenanceManagerLib/BootMaintenanceManager.h
@@ -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
diff --git a/MdeModulePkg/Library/BootMaintenanceManagerLib/FormGuid.h b/MdeModulePkg/Library/BootMaintenanceManagerLib/FormGuid.h
index 3e1990d..cf14b40 100644
--- a/MdeModulePkg/Library/BootMaintenanceManagerLib/FormGuid.h
+++ b/MdeModulePkg/Library/BootMaintenanceManagerLib/FormGuid.h
@@ -103,7 +103,7 @@ typedef struct {
// for Timeout, BootNext, Variables respectively
//
UINT16 BootTimeOut;
- UINT16 BootNext;
+ UINT32 BootNext;
//
// This is the COM1 Attributes value storage
diff --git a/MdeModulePkg/Library/BootMaintenanceManagerLib/UpdatePage.c b/MdeModulePkg/Library/BootMaintenanceManagerLib/UpdatePage.c
index 78ace0c..cd1756a 100644
--- a/MdeModulePkg/Library/BootMaintenanceManagerLib/UpdatePage.c
+++ b/MdeModulePkg/Library/BootMaintenanceManagerLib/UpdatePage.c
@@ -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
);
diff --git a/MdeModulePkg/Library/BootMaintenanceManagerLib/Variable.c b/MdeModulePkg/Library/BootMaintenanceManagerLib/Variable.c
index cd2da4a..a276cae 100644
--- a/MdeModulePkg/Library/BootMaintenanceManagerLib/Variable.c
+++ b/MdeModulePkg/Library/BootMaintenanceManagerLib/Variable.c
@@ -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;
}