From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 90D1A21CE7479 for ; Fri, 21 Jul 2017 01:54:31 -0700 (PDT) Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga105.fm.intel.com with ESMTP; 21 Jul 2017 01:56:28 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.40,389,1496127600"; d="scan'208";a="289651955" Received: from shwdeopenpsi114.ccr.corp.intel.com ([10.239.157.135]) by fmsmga004.fm.intel.com with ESMTP; 21 Jul 2017 01:56:27 -0700 From: Dandan Bi To: edk2-devel@lists.01.org Cc: Eric Dong , Liming Gao Date: Fri, 21 Jul 2017 16:56:01 +0800 Message-Id: <1500627363-171152-2-git-send-email-dandan.bi@intel.com> X-Mailer: git-send-email 1.9.5.msysgit.1 In-Reply-To: <1500627363-171152-1-git-send-email-dandan.bi@intel.com> References: <1500627363-171152-1-git-send-email-dandan.bi@intel.com> Subject: [PATCH v2 1/3] MdeModulePkg/SetupBrowser: Record the reset status in all SendForm X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Jul 2017 08:54:31 -0000 After calling SendForm to enter front page, configuration change in some driver may require system reset. Currently the reset status is saved in SendForm level. Then SendForm can return the reset status. IsResetRequired API also can return the reset status before exiting browser. It return the reset status in current SendForm level now. But SendForm can be recursive called by some module.so the reset status in previous SendForm may be lost. Now change the IsResetRequired API to return the reset info no matter the reset is caught in any SendForm. Cc: Eric Dong Cc: Liming Gao Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Dandan Bi --- MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c | 9 ++++++--- MdeModulePkg/Universal/SetupBrowserDxe/Setup.c | 19 +++++++++++-------- MdeModulePkg/Universal/SetupBrowserDxe/Setup.h | 5 +++-- 3 files changed, 20 insertions(+), 13 deletions(-) diff --git a/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c b/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c index 08d46cf..97713eb 100644 --- a/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c +++ b/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c @@ -995,11 +995,12 @@ ProcessAction ( if ((Action & BROWSER_ACTION_SUBMIT) == BROWSER_ACTION_SUBMIT) { SubmitForm (gCurrentSelection->FormSet, gCurrentSelection->Form, gBrowserSettingScope); } if ((Action & BROWSER_ACTION_RESET) == BROWSER_ACTION_RESET) { - gResetRequired = TRUE; + gResetRequiredFormLevel = TRUE; + gResetRequiredSystemLevel = TRUE; } if ((Action & BROWSER_ACTION_EXIT) == BROWSER_ACTION_EXIT) { // // Form Exit without saving, Similar to ESC Key. @@ -2043,11 +2044,12 @@ ProcessCallBackFunction ( switch (Action) { case EFI_BROWSER_ACTION_CHANGED: switch (ActionRequest) { case EFI_BROWSER_ACTION_REQUEST_RESET: DiscardFormIsRequired = TRUE; - gResetRequired = TRUE; + gResetRequiredFormLevel = TRUE; + gResetRequiredSystemLevel = TRUE; NeedExit = TRUE; break; case EFI_BROWSER_ACTION_REQUEST_SUBMIT: SubmitFormIsRequired = TRUE; @@ -2542,11 +2544,12 @@ SetupBrowser ( // and process question success till here, trig the gResetFlag/gFlagReconnect. // if ((Status == EFI_SUCCESS) && (Statement->Storage == NULL)) { if ((Statement->QuestionFlags & EFI_IFR_FLAG_RESET_REQUIRED) != 0) { - gResetRequired = TRUE; + gResetRequiredFormLevel = TRUE; + gResetRequiredSystemLevel = TRUE; } if ((Statement->QuestionFlags & EFI_IFR_FLAG_RECONNECT_REQUIRED) != 0) { gFlagReconnect = TRUE; } diff --git a/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c b/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c index 83dc2b8..89e06de 100644 --- a/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c +++ b/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c @@ -51,11 +51,12 @@ LIST_ENTRY gBrowserFormSetList = INITIALIZE_LIST_HEAD_VARIABLE (gBrowserFor LIST_ENTRY gBrowserHotKeyList = INITIALIZE_LIST_HEAD_VARIABLE (gBrowserHotKeyList); LIST_ENTRY gBrowserStorageList = INITIALIZE_LIST_HEAD_VARIABLE (gBrowserStorageList); LIST_ENTRY gBrowserSaveFailFormSetList = INITIALIZE_LIST_HEAD_VARIABLE (gBrowserSaveFailFormSetList); BOOLEAN mSystemSubmit = FALSE; -BOOLEAN gResetRequired; +BOOLEAN gResetRequiredFormLevel; +BOOLEAN gResetRequiredSystemLevel = FALSE; BOOLEAN gExitRequired; BOOLEAN gFlagReconnect; BOOLEAN gCallbackReconnect; BROWSER_SETTING_SCOPE gBrowserSettingScope = FormSetLevel; BOOLEAN mBrowserScopeFirstSet = TRUE; @@ -497,11 +498,11 @@ SendForm ( // Save globals used by SendForm() // SaveBrowserContext (); gFlagReconnect = FALSE; - gResetRequired = FALSE; + gResetRequiredFormLevel = FALSE; gExitRequired = FALSE; gCallbackReconnect = FALSE; Status = EFI_SUCCESS; gEmptyString = L""; gDisplayFormData.ScreenDimensions = (EFI_SCREEN_DESCRIPTOR *) ScreenDimensions; @@ -577,11 +578,11 @@ SendForm ( FreePool (Selection); } if (ActionRequest != NULL) { *ActionRequest = EFI_BROWSER_ACTION_REQUEST_NONE; - if (gResetRequired) { + if (gResetRequiredFormLevel) { *ActionRequest = EFI_BROWSER_ACTION_REQUEST_RESET; } } mFormDisplay->ExitDisplay(); @@ -2676,11 +2677,12 @@ UpdateFlagForForm ( // // Only the changed data has been saved, then need to set the reset flag. // if (SetFlag && OldValue && !Question->ValueChanged) { if ((Question->QuestionFlags & EFI_IFR_FLAG_RESET_REQUIRED) != 0) { - gResetRequired = TRUE; + gResetRequiredFormLevel = TRUE; + gResetRequiredSystemLevel = TRUE; } if ((Question->QuestionFlags & EFI_IFR_FLAG_RECONNECT_REQUIRED) != 0) { gFlagReconnect = TRUE; } @@ -5915,11 +5917,11 @@ SaveBrowserContext ( // // Save FormBrowser context // Context->Selection = gCurrentSelection; - Context->ResetRequired = gResetRequired; + Context->ResetRequired = gResetRequiredFormLevel; Context->FlagReconnect = gFlagReconnect; Context->CallbackReconnect = gCallbackReconnect; Context->ExitRequired = gExitRequired; Context->HiiHandle = mCurrentHiiHandle; Context->FormId = mCurrentFormId; @@ -5988,11 +5990,11 @@ RestoreBrowserContext ( // // Restore FormBrowser context // gCurrentSelection = Context->Selection; - gResetRequired = Context->ResetRequired; + gResetRequiredFormLevel = Context->ResetRequired; gFlagReconnect = Context->FlagReconnect; gCallbackReconnect = Context->CallbackReconnect; gExitRequired = Context->ExitRequired; mCurrentHiiHandle = Context->HiiHandle; mCurrentFormId = Context->FormId; @@ -6463,11 +6465,12 @@ ExecuteAction ( // // Executet the reset action. // if ((Action & BROWSER_ACTION_RESET) != 0) { - gResetRequired = TRUE; + gResetRequiredFormLevel = TRUE; + gResetRequiredSystemLevel = TRUE; } // // Executet the exit action. // @@ -6563,8 +6566,8 @@ BOOLEAN EFIAPI IsResetRequired ( VOID ) { - return gResetRequired; + return gResetRequiredSystemLevel; } diff --git a/MdeModulePkg/Universal/SetupBrowserDxe/Setup.h b/MdeModulePkg/Universal/SetupBrowserDxe/Setup.h index f1accdf..de140e9 100644 --- a/MdeModulePkg/Universal/SetupBrowserDxe/Setup.h +++ b/MdeModulePkg/Universal/SetupBrowserDxe/Setup.h @@ -1,9 +1,9 @@ /** @file Private MACRO, structure and function definitions for Setup Browser module. -Copyright (c) 2007 - 2016, Intel Corporation. All rights reserved.
+Copyright (c) 2007 - 2017, Intel Corporation. All rights reserved.
This program and the accompanying materials 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 http://opensource.org/licenses/bsd-license.php @@ -578,11 +578,12 @@ extern EFI_HII_CONFIG_ROUTING_PROTOCOL *mHiiConfigRouting; extern EFI_DEVICE_PATH_FROM_TEXT_PROTOCOL *mPathFromText; extern EDKII_FORM_DISPLAY_ENGINE_PROTOCOL *mFormDisplay; extern BOOLEAN gCallbackReconnect; extern BOOLEAN gFlagReconnect; -extern BOOLEAN gResetRequired; +extern BOOLEAN gResetRequiredFormLevel; +extern BOOLEAN gResetRequiredSystemLevel; extern BOOLEAN gExitRequired; extern LIST_ENTRY gBrowserFormSetList; extern LIST_ENTRY gBrowserHotKeyList; extern BROWSER_SETTING_SCOPE gBrowserSettingScope; extern EXIT_HANDLER ExitHandlerFunction; -- 1.9.5.msysgit.1