summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Dong <eric.dong@intel.com>2015-11-16 08:11:47 +0000
committervanjeff <vanjeff@Edk2>2015-11-16 08:11:47 +0000
commitbcdff59e3a033ce7b3e1046e69297a3e2cf3d0f1 (patch)
tree1f7ecce0413afe12499211015859fc210ded7500
parent4d38d07f9e8fe62d873fadc74d978a4db6a300b6 (diff)
downloadedk2-platforms-bcdff59e3a033ce7b3e1046e69297a3e2cf3d0f1.tar.xz
MdeModulePkg SetupBrowserDxe: Save global variable values before nest function called.
The SendForm function can be called nest in it. This function also uses some global variables. So we must save global variable values before it been called again. Checked in the missing change for gBrowserFormSetList. (Sync patch r18681 from main trunk.) Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-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/branches/UDK2015@18812 6f19259b-4bc3-4df7-8a09-765794883524
-rw-r--r--MdeModulePkg/Universal/SetupBrowserDxe/Setup.c29
-rw-r--r--MdeModulePkg/Universal/SetupBrowserDxe/Setup.h3
2 files changed, 28 insertions, 4 deletions
diff --git a/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c b/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c
index 4a6758a5e4..cc9896959b 100644
--- a/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c
+++ b/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c
@@ -5541,8 +5541,9 @@ SaveBrowserContext (
VOID
)
{
- BROWSER_CONTEXT *Context;
- FORM_ENTRY_INFO *MenuList;
+ BROWSER_CONTEXT *Context;
+ FORM_ENTRY_INFO *MenuList;
+ FORM_BROWSER_FORMSET *FormSet;
gBrowserContextCount++;
if (gBrowserContextCount == 1) {
@@ -5585,6 +5586,17 @@ SaveBrowserContext (
}
//
+ // Save formset list.
+ //
+ InitializeListHead(&Context->FormSetList);
+ while (!IsListEmpty (&gBrowserFormSetList)) {
+ FormSet = FORM_BROWSER_FORMSET_FROM_LINK (gBrowserFormSetList.ForwardLink);
+ RemoveEntryList (&FormSet->Link);
+
+ InsertTailList(&Context->FormSetList, &FormSet->Link);
+ }
+
+ //
// Insert to FormBrowser context list
//
InsertHeadList (&gBrowserContextList, &Context->Link);
@@ -5602,7 +5614,8 @@ RestoreBrowserContext (
{
LIST_ENTRY *Link;
BROWSER_CONTEXT *Context;
- FORM_ENTRY_INFO *MenuList;
+ FORM_ENTRY_INFO *MenuList;
+ FORM_BROWSER_FORMSET *FormSet;
ASSERT (gBrowserContextCount != 0);
gBrowserContextCount--;
@@ -5645,6 +5658,16 @@ RestoreBrowserContext (
}
//
+ // Restore the Formset data.
+ //
+ while (!IsListEmpty (&Context->FormSetList)) {
+ FormSet = FORM_BROWSER_FORMSET_FROM_LINK (Context->FormSetList.ForwardLink);
+ RemoveEntryList (&FormSet->Link);
+
+ InsertTailList(&gBrowserFormSetList, &FormSet->Link);
+ }
+
+ //
// Remove from FormBrowser context list
//
RemoveEntryList (&Context->Link);
diff --git a/MdeModulePkg/Universal/SetupBrowserDxe/Setup.h b/MdeModulePkg/Universal/SetupBrowserDxe/Setup.h
index 81e2a62df1..0abb09cf87 100644
--- a/MdeModulePkg/Universal/SetupBrowserDxe/Setup.h
+++ b/MdeModulePkg/Universal/SetupBrowserDxe/Setup.h
@@ -542,7 +542,8 @@ typedef struct {
EFI_QUESTION_ID CurFakeQestId;
BOOLEAN HiiPackageListUpdated;
BOOLEAN FinishRetrieveCall;
- LIST_ENTRY FormHistoryList;
+ LIST_ENTRY FormHistoryList;
+ LIST_ENTRY FormSetList;
} BROWSER_CONTEXT;
#define BROWSER_CONTEXT_FROM_LINK(a) CR (a, BROWSER_CONTEXT, Link, BROWSER_CONTEXT_SIGNATURE)