summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorydong10 <ydong10@6f19259b-4bc3-4df7-8a09-765794883524>2011-12-22 06:31:40 +0000
committerydong10 <ydong10@6f19259b-4bc3-4df7-8a09-765794883524>2011-12-22 06:31:40 +0000
commit98ba35a40ccbf2fc38700250ce2987abe588fb52 (patch)
tree3837af00264f6bc441b69917feb40908d4e30b5a
parent5c6889f7cea4fda6a7c75289994f009691c6da8e (diff)
downloadedk2-platforms-98ba35a40ccbf2fc38700250ce2987abe588fb52.tar.xz
Patch includes:
1.Update question value after BDS change code to avoid save invalid data. 2.Fix a corner case bug that may cause unexpected popup when changing the legacy device order. Signed-off-by: ydong10 Reviewed-by: lgao4 git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12892 6f19259b-4bc3-4df7-8a09-765794883524
-rw-r--r--IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/BootMaint.c46
1 files changed, 13 insertions, 33 deletions
diff --git a/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/BootMaint.c b/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/BootMaint.c
index d3215a3c86..1186c0cb19 100644
--- a/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/BootMaint.c
+++ b/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/BootMaint.c
@@ -280,12 +280,12 @@ BootMaintCallback (
UINTN Pos;
UINTN Bit;
UINT16 NewValuePos;
+ UINT16 Index3;
UINT16 Index2;
UINT16 Index;
UINT8 *OldLegacyDev;
UINT8 *NewLegacyDev;
UINT8 *DisMap;
- EFI_FORM_ID FormId;
if (Action != EFI_BROWSER_ACTION_CHANGING && Action != EFI_BROWSER_ACTION_CHANGED) {
//
@@ -321,56 +321,30 @@ BootMaintCallback (
//
// Update Select FD/HD/CD/NET/BEV Order Form
//
- if (FORM_SET_FD_ORDER_ID == Private->BmmPreviousPageId ||
- FORM_SET_HD_ORDER_ID == Private->BmmPreviousPageId ||
- FORM_SET_CD_ORDER_ID == Private->BmmPreviousPageId ||
- FORM_SET_NET_ORDER_ID == Private->BmmPreviousPageId ||
- FORM_SET_BEV_ORDER_ID == Private->BmmPreviousPageId ||
- ((FORM_BOOT_SETUP_ID == Private->BmmPreviousPageId) &&
- (QuestionId >= LEGACY_FD_QUESTION_ID) &&
- (QuestionId < (LEGACY_BEV_QUESTION_ID + 100)) )
- ) {
+ if ((QuestionId >= LEGACY_FD_QUESTION_ID) && (QuestionId < LEGACY_BEV_QUESTION_ID + MAX_MENU_NUMBER)) {
DisMap = Private->BmmOldFakeNVData.DisableMap;
- FormId = Private->BmmPreviousPageId;
- if (FormId == FORM_BOOT_SETUP_ID) {
- FormId = Private->BmmCurrentPageId;
- }
-
- switch (FormId) {
- case FORM_SET_FD_ORDER_ID:
+ if (QuestionId >= LEGACY_FD_QUESTION_ID && QuestionId < LEGACY_FD_QUESTION_ID + MAX_MENU_NUMBER) {
Number = (UINT16) LegacyFDMenu.MenuNumber;
OldLegacyDev = Private->BmmOldFakeNVData.LegacyFD;
NewLegacyDev = CurrentFakeNVMap->LegacyFD;
- break;
-
- case FORM_SET_HD_ORDER_ID:
+ } else if (QuestionId >= LEGACY_HD_QUESTION_ID && QuestionId < LEGACY_HD_QUESTION_ID + MAX_MENU_NUMBER) {
Number = (UINT16) LegacyHDMenu.MenuNumber;
OldLegacyDev = Private->BmmOldFakeNVData.LegacyHD;
NewLegacyDev = CurrentFakeNVMap->LegacyHD;
- break;
-
- case FORM_SET_CD_ORDER_ID:
+ } else if (QuestionId >= LEGACY_CD_QUESTION_ID && QuestionId < LEGACY_CD_QUESTION_ID + MAX_MENU_NUMBER) {
Number = (UINT16) LegacyCDMenu.MenuNumber;
OldLegacyDev = Private->BmmOldFakeNVData.LegacyCD;
NewLegacyDev = CurrentFakeNVMap->LegacyCD;
- break;
-
- case FORM_SET_NET_ORDER_ID:
+ } else if (QuestionId >= LEGACY_NET_QUESTION_ID && QuestionId < LEGACY_NET_QUESTION_ID + MAX_MENU_NUMBER) {
Number = (UINT16) LegacyNETMenu.MenuNumber;
OldLegacyDev = Private->BmmOldFakeNVData.LegacyNET;
NewLegacyDev = CurrentFakeNVMap->LegacyNET;
- break;
-
- case FORM_SET_BEV_ORDER_ID:
+ } else if (QuestionId >= LEGACY_BEV_QUESTION_ID && QuestionId < LEGACY_BEV_QUESTION_ID + MAX_MENU_NUMBER) {
Number = (UINT16) LegacyBEVMenu.MenuNumber;
OldLegacyDev = Private->BmmOldFakeNVData.LegacyBEV;
NewLegacyDev = CurrentFakeNVMap->LegacyBEV;
- break;
-
- default:
- break;
}
//
// First, find the different position
@@ -455,6 +429,7 @@ BootMaintCallback (
// To prevent DISABLE appears in the middle of the list
// we should perform a re-ordering
//
+ Index3 = Index;
Index = 0;
while (Index < Number) {
if (0xFF != NewLegacyDev[Index]) {
@@ -485,6 +460,11 @@ BootMaintCallback (
NewLegacyDev,
Number
);
+
+ //
+ // Return correct question value.
+ //
+ Value->u8 = NewLegacyDev[Index3];
}
}