summaryrefslogtreecommitdiff
path: root/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint
diff options
context:
space:
mode:
authorydong10 <ydong10@6f19259b-4bc3-4df7-8a09-765794883524>2011-12-15 02:56:46 +0000
committerydong10 <ydong10@6f19259b-4bc3-4df7-8a09-765794883524>2011-12-15 02:56:46 +0000
commit847240774030f9da79140a9d515a64ec817eb6eb (patch)
treeaec7f7665adee7363cdd9ab353eb44f19b66ee50 /IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint
parent3a4e7a3e73a40eecbb0a977a0e7421ff5743c353 (diff)
downloadedk2-platforms-847240774030f9da79140a9d515a64ec817eb6eb.tar.xz
Update for IntelFrameworkModulePkg.
Per UEFI spec, on CallBack action EFI_BROWSER_ACTION_CHANGING, the return value of ActionRequest will be ignored, but on CallBack action EFI_BROWSER_ACTION_CHANGED, the return value of ActionRequest will be used. But, EDKII browser still processes the got ActionRequest. And, all HII drivers in EDKII project also returns their expected ActionRequest value on action EFI_BROWSER_ACTION_CHANGING. Now update the browser to follow the spec, and update all core Hii drivers to keep old working modal. Signed-off-by: ydong10 Reviewed-by: lgao4 git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12866 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint')
-rw-r--r--IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/Bm.vfr16
-rw-r--r--IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/BootMaint.c121
-rw-r--r--IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/FileExplorer.c50
-rw-r--r--IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/FormGuid.h1
-rw-r--r--IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/UpdatePage.c12
-rw-r--r--IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/Variable.c5
6 files changed, 95 insertions, 110 deletions
diff --git a/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/Bm.vfr b/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/Bm.vfr
index fd14a7714e..afbbfdddf9 100644
--- a/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/Bm.vfr
+++ b/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/Bm.vfr
@@ -55,7 +55,7 @@ formset
subtitle text = STRING_TOKEN(STR_NULL_STRING);
- goto FORM_CON_MAIN_ID,
+ goto FORM_BOOT_FROM_FILE_ID,
prompt = STRING_TOKEN(STR_BOOT_FROM_FILE),
help = STRING_TOKEN(STR_BOOT_FROM_FILE_HELP),
flags = INTERACTIVE,
@@ -154,13 +154,6 @@ formset
key = FORM_DRV_CHG_ID;
endform;
- form formid = FORM_BOOT_ADD_ID,
- title = STRING_TOKEN(STR_FORM_BOOT_ADD_TITLE);
-
- label FORM_BOOT_ADD_ID;
- label LABEL_END;
- endform;
-
form formid = FORM_BOOT_DEL_ID,
title = STRING_TOKEN(STR_FORM_BOOT_DEL_TITLE);
@@ -298,13 +291,6 @@ formset
label LABEL_END;
endform;
- form formid = FORM_DRV_ADD_FILE_ID,
- title = STRING_TOKEN(STR_FORM_DRV_ADD_FILE_TITLE);
-
- label FORM_DRV_ADD_FILE_ID;
- label LABEL_END;
- endform;
-
form formid = FORM_DRV_ADD_HANDLE_ID,
title = STRING_TOKEN(STR_FORM_DRV_ADD_HANDLE_TITLE);
diff --git a/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/BootMaint.c b/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/BootMaint.c
index 4c8e3c8a4d..d3215a3c86 100644
--- a/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/BootMaint.c
+++ b/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/BootMaint.c
@@ -286,32 +286,37 @@ BootMaintCallback (
UINT8 *NewLegacyDev;
UINT8 *DisMap;
EFI_FORM_ID FormId;
- Status = EFI_SUCCESS;
+ if (Action != EFI_BROWSER_ACTION_CHANGING && Action != EFI_BROWSER_ACTION_CHANGED) {
+ //
+ // All other action return unsupported.
+ //
+ return EFI_UNSUPPORTED;
+ }
+
+ Status = EFI_SUCCESS;
+ OldValue = 0;
+ NewValue = 0;
+ Number = 0;
+ OldLegacyDev = NULL;
+ NewLegacyDev = NULL;
+ NewValuePos = 0;
+ DisMap = NULL;
+
+ Private = BMM_CALLBACK_DATA_FROM_THIS (This);
+ //
+ // Retrive uncommitted data from Form Browser
+ //
+ CurrentFakeNVMap = &Private->BmmFakeNvData;
+ HiiGetBrowserData (&gBootMaintFormSetGuid, mBootMaintStorageName, sizeof (BMM_FAKE_NV_DATA), (UINT8 *) CurrentFakeNVMap);
if (Action == EFI_BROWSER_ACTION_CHANGING) {
- if ((Value == NULL) || (ActionRequest == NULL)) {
+ if (Value == NULL) {
return EFI_INVALID_PARAMETER;
}
-
- OldValue = 0;
- NewValue = 0;
- Number = 0;
- OldLegacyDev = NULL;
- NewLegacyDev = NULL;
- NewValuePos = 0;
- DisMap = NULL;
- *ActionRequest = EFI_BROWSER_ACTION_REQUEST_NONE;
-
- Private = BMM_CALLBACK_DATA_FROM_THIS (This);
+
UpdatePageId (Private, QuestionId);
//
- // Retrive uncommitted data from Form Browser
- //
- CurrentFakeNVMap = &Private->BmmFakeNvData;
- HiiGetBrowserData (&gBootMaintFormSetGuid, mBootMaintStorageName, sizeof (BMM_FAKE_NV_DATA), (UINT8 *) CurrentFakeNVMap);
-
- //
// need to be subtituded.
//
// Update Select FD/HD/CD/NET/BEV Order Form
@@ -488,29 +493,14 @@ BootMaintCallback (
switch (QuestionId) {
case KEY_VALUE_BOOT_FROM_FILE:
Private->FeCurrentState = FileExplorerStateBootFromFile;
-
- //
- // Exit Bmm main formset to send File Explorer formset.
- //
- *ActionRequest = EFI_BROWSER_ACTION_REQUEST_EXIT;
break;
case FORM_BOOT_ADD_ID:
Private->FeCurrentState = FileExplorerStateAddBootOption;
-
- //
- // Exit Bmm main formset to send File Explorer formset.
- //
- *ActionRequest = EFI_BROWSER_ACTION_REQUEST_EXIT;
break;
case FORM_DRV_ADD_FILE_ID:
Private->FeCurrentState = FileExplorerStateAddDriverOptionState;
-
- //
- // Exit Bmm main formset to send File Explorer formset.
- //
- *ActionRequest = EFI_BROWSER_ACTION_REQUEST_EXIT;
break;
case FORM_DRV_ADD_HANDLE_ID:
@@ -543,10 +533,6 @@ BootMaintCallback (
UpdateTimeOutPage (Private);
break;
- case FORM_RESET:
- gRT->ResetSystem (EfiResetCold, EFI_SUCCESS, 0, NULL);
- return EFI_UNSUPPORTED;
-
case FORM_CON_IN_ID:
case FORM_CON_OUT_ID:
case FORM_CON_ERR_ID:
@@ -572,25 +558,6 @@ BootMaintCallback (
UpdateSetLegacyDeviceOrderPage (QuestionId, Private);
break;
- case KEY_VALUE_SAVE_AND_EXIT:
- case KEY_VALUE_NO_SAVE_AND_EXIT:
-
- if (QuestionId == KEY_VALUE_SAVE_AND_EXIT) {
- Status = ApplyChangeHandler (Private, CurrentFakeNVMap, Private->BmmPreviousPageId);
- if (EFI_ERROR (Status)) {
- return Status;
- }
- } else if (QuestionId == KEY_VALUE_NO_SAVE_AND_EXIT) {
- DiscardChangeHandler (Private, CurrentFakeNVMap);
- }
-
- //
- // Tell browser not to ask for confirmation of changes,
- // since we have already applied or discarded.
- //
- *ActionRequest = EFI_BROWSER_ACTION_REQUEST_FORM_APPLY;
- break;
-
default:
break;
}
@@ -616,18 +583,44 @@ BootMaintCallback (
UpdateDriverAddHandleDescPage (Private);
}
}
+ } else if (Action == EFI_BROWSER_ACTION_CHANGED) {
+ if ((Value == NULL) || (ActionRequest == NULL)) {
+ return EFI_INVALID_PARAMETER;
+ }
+
+ switch (QuestionId) {
+ case KEY_VALUE_SAVE_AND_EXIT:
+ case KEY_VALUE_NO_SAVE_AND_EXIT:
+ if (QuestionId == KEY_VALUE_SAVE_AND_EXIT) {
+ Status = ApplyChangeHandler (Private, CurrentFakeNVMap, Private->BmmPreviousPageId);
+ if (EFI_ERROR (Status)) {
+ return Status;
+ }
+ } else if (QuestionId == KEY_VALUE_NO_SAVE_AND_EXIT) {
+ DiscardChangeHandler (Private, CurrentFakeNVMap);
+ }
- //
- // Pass changed uncommitted data back to Form Browser
- //
- Status = HiiSetBrowserData (&gBootMaintFormSetGuid, mBootMaintStorageName, sizeof (BMM_FAKE_NV_DATA), (UINT8 *) CurrentFakeNVMap, NULL);
- return Status;
+ //
+ // Tell browser not to ask for confirmation of changes,
+ // since we have already applied or discarded.
+ //
+ *ActionRequest = EFI_BROWSER_ACTION_REQUEST_FORM_SUBMIT_EXIT;
+ break;
+
+ case FORM_RESET:
+ gRT->ResetSystem (EfiResetCold, EFI_SUCCESS, 0, NULL);
+ return EFI_UNSUPPORTED;
+
+ default:
+ break;
+ }
}
//
- // All other action return unsupported.
+ // Pass changed uncommitted data back to Form Browser
//
- return EFI_UNSUPPORTED;
+ HiiSetBrowserData (&gBootMaintFormSetGuid, mBootMaintStorageName, sizeof (BMM_FAKE_NV_DATA), (UINT8 *) CurrentFakeNVMap, NULL);
+ return EFI_SUCCESS;
}
/**
diff --git a/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/FileExplorer.c b/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/FileExplorer.c
index b77e909ad5..733632b9f4 100644
--- a/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/FileExplorer.c
+++ b/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/FileExplorer.c
@@ -253,21 +253,27 @@ FileExplorerCallback (
FILE_EXPLORER_NV_DATA *NvRamMap;
EFI_STATUS Status;
- if (Action == EFI_BROWSER_ACTION_CHANGING) {
- if ((Value == NULL) || (ActionRequest == NULL)) {
- return EFI_INVALID_PARAMETER;
- }
-
- Status = EFI_SUCCESS;
- Private = FE_CALLBACK_DATA_FROM_THIS (This);
- *ActionRequest = EFI_BROWSER_ACTION_REQUEST_NONE;
-
+ if (Action != EFI_BROWSER_ACTION_CHANGING && Action != EFI_BROWSER_ACTION_CHANGED) {
//
- // Retrieve uncommitted data from Form Browser
+ // All other action return unsupported.
//
- NvRamMap = &Private->FeFakeNvData;
- HiiGetBrowserData (&gFileExploreFormSetGuid, mFileExplorerStorageName, sizeof (FILE_EXPLORER_NV_DATA), (UINT8 *) NvRamMap);
+ return EFI_UNSUPPORTED;
+ }
+
+ Status = EFI_SUCCESS;
+ Private = FE_CALLBACK_DATA_FROM_THIS (This);
+ //
+ // Retrieve uncommitted data from Form Browser
+ //
+ NvRamMap = &Private->FeFakeNvData;
+ HiiGetBrowserData (&gFileExploreFormSetGuid, mFileExplorerStorageName, sizeof (FILE_EXPLORER_NV_DATA), (UINT8 *) NvRamMap);
+
+ if (Action == EFI_BROWSER_ACTION_CHANGED) {
+ if ((Value == NULL) || (ActionRequest == NULL)) {
+ return EFI_INVALID_PARAMETER;
+ }
+
if (QuestionId == KEY_VALUE_SAVE_AND_EXIT_BOOT || QuestionId == KEY_VALUE_SAVE_AND_EXIT_DRIVER) {
//
// Apply changes and exit formset
@@ -309,16 +315,16 @@ FileExplorerCallback (
// Exit File Explorer formset
//
*ActionRequest = EFI_BROWSER_ACTION_REQUEST_EXIT;
- } else {
- if (UpdateFileExplorer (Private, QuestionId)) {
- *ActionRequest = EFI_BROWSER_ACTION_REQUEST_EXIT;
- }
}
-
- return Status;
+ } else if (Action == EFI_BROWSER_ACTION_CHANGING) {
+ if (Value == NULL) {
+ return EFI_INVALID_PARAMETER;
+ }
+
+ if (QuestionId >= FILE_OPTION_OFFSET) {
+ UpdateFileExplorer (Private, QuestionId);
+ }
}
- //
- // All other action return unsupported.
- //
- return EFI_UNSUPPORTED;
+
+ return Status;
}
diff --git a/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/FormGuid.h b/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/FormGuid.h
index 1087db8472..f0049a3043 100644
--- a/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/FormGuid.h
+++ b/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/FormGuid.h
@@ -49,6 +49,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#define FORM_BOOT_ADD_DESCRIPTION_ID 0x101F
#define FORM_DRIVER_ADD_FILE_DESCRIPTION_ID 0x1020
#define FORM_CON_MODE_ID 0x1021
+#define FORM_BOOT_FROM_FILE_ID 0x1022
#define MAXIMUM_FORM_ID 0x10FF
diff --git a/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/UpdatePage.c b/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/UpdatePage.c
index f77b9f82ed..7d4f33d409 100644
--- a/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/UpdatePage.c
+++ b/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/UpdatePage.c
@@ -99,26 +99,26 @@ UpdatePageEnd (
0
);
- HiiCreateGotoOpCode (
+ HiiCreateActionOpCode (
mStartOpCodeHandle,
- FORM_MAIN_ID,
+ KEY_VALUE_SAVE_AND_EXIT,
STRING_TOKEN (STR_SAVE_AND_EXIT),
STRING_TOKEN (STR_NULL_STRING),
EFI_IFR_FLAG_CALLBACK,
- KEY_VALUE_SAVE_AND_EXIT
+ 0
);
}
//
// Ensure user can return to the main page.
//
- HiiCreateGotoOpCode (
+ HiiCreateActionOpCode (
mStartOpCodeHandle,
- FORM_MAIN_ID,
+ KEY_VALUE_NO_SAVE_AND_EXIT,
STRING_TOKEN (STR_NO_SAVE_AND_EXIT),
STRING_TOKEN (STR_NULL_STRING),
EFI_IFR_FLAG_CALLBACK,
- KEY_VALUE_NO_SAVE_AND_EXIT
+ 0
);
HiiUpdateForm (
diff --git a/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/Variable.c b/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/Variable.c
index ac7e61496f..c4b83ba0ff 100644
--- a/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/Variable.c
+++ b/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/Variable.c
@@ -673,14 +673,13 @@ Var_UpdateDriverOption (
&gEfiGlobalVariableGuid,
&DriverOrderListSize
);
- ASSERT (DriverOrderList != NULL);
NewDriverOrderList = AllocateZeroPool (DriverOrderListSize + sizeof (UINT16));
ASSERT (NewDriverOrderList != NULL);
- CopyMem (NewDriverOrderList, DriverOrderList, DriverOrderListSize);
- NewDriverOrderList[DriverOrderListSize / sizeof (UINT16)] = Index;
if (DriverOrderList != NULL) {
+ CopyMem (NewDriverOrderList, DriverOrderList, DriverOrderListSize);
EfiLibDeleteVariable (L"DriverOrder", &gEfiGlobalVariableGuid);
}
+ NewDriverOrderList[DriverOrderListSize / sizeof (UINT16)] = Index;
Status = gRT->SetVariable (
L"DriverOrder",