Revision: 14726
http://sourceforge.net/p/edk2/code/14726
Author: vanjeff
Date: 2013-09-25 05:08:42 +0000 (Wed, 25 Sep 2013)
Log Message:
-----------
Sync patch r14711 from main trunk.
Fix deadloop issue in BrowserCallback function.
Revision Links:
--------------
http://sourceforge.net/p/edk2/code/14711
Modified Paths:
--------------
branches/UDK2010.SR1/MdeModulePkg/Universal/SetupBrowserDxe/IfrParse.c
branches/UDK2010.SR1/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c
branches/UDK2010.SR1/MdeModulePkg/Universal/SetupBrowserDxe/Setup.h
Modified: branches/UDK2010.SR1/MdeModulePkg/Universal/SetupBrowserDxe/IfrParse.c
===================================================================
--- branches/UDK2010.SR1/MdeModulePkg/Universal/SetupBrowserDxe/IfrParse.c
2013-09-25 03:34:23 UTC (rev 14725)
+++ branches/UDK2010.SR1/MdeModulePkg/Universal/SetupBrowserDxe/IfrParse.c
2013-09-25 05:08:42 UTC (rev 14726)
@@ -509,10 +509,6 @@
InitializeConfigHdr (FormSet, BrowserStorage);
}
- //
- // Add count because one formset storage use this global storage.
- //
- BrowserStorage->ReferenceCount++;
Storage->BrowserStorage = BrowserStorage;
Storage->ConfigRequest = AllocateCopyPool (StrSize
(BrowserStorage->ConfigHdr), BrowserStorage->ConfigHdr);
@@ -741,12 +737,6 @@
FreePool (Storage->ConfigRequest);
}
- //
- // Minus the reference to the global storage.
- //
- ASSERT (Storage->BrowserStorage->ReferenceCount > 0);
- Storage->BrowserStorage->ReferenceCount--;
-
FreePool (Storage);
}
Modified: branches/UDK2010.SR1/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c
===================================================================
--- branches/UDK2010.SR1/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c
2013-09-25 03:34:23 UTC (rev 14725)
+++ branches/UDK2010.SR1/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c
2013-09-25 05:08:42 UTC (rev 14726)
@@ -53,6 +53,7 @@
BROWSER_SETTING_SCOPE gBrowserSettingScope = FormSetLevel;
BOOLEAN mBrowserScopeFirstSet = TRUE;
EXIT_HANDLER ExitHandlerFunction = NULL;
+FORM_BROWSER_FORMSET *mSystemLevelFormSet;
//
// Browser Global Strings
@@ -255,7 +256,10 @@
UINTN Index;
EFI_GUID ZeroGuid;
EFI_STATUS Status;
+ FORM_BROWSER_FORMSET *OldFormset;
+ OldFormset = mSystemLevelFormSet;
+
//
// Get all the Hii handles
//
@@ -278,6 +282,8 @@
//
LocalFormSet = AllocateZeroPool (sizeof (FORM_BROWSER_FORMSET));
ASSERT (LocalFormSet != NULL);
+ mSystemLevelFormSet = LocalFormSet;
+
ZeroMem (&ZeroGuid, sizeof (ZeroGuid));
Status = InitializeFormSet (HiiHandles[Index], &ZeroGuid, LocalFormSet);
if (EFI_ERROR (Status) || IsListEmpty (&LocalFormSet->FormListHead)) {
@@ -300,6 +306,8 @@
// Free resources, and restore gOldFormSet and gClassOfVfr
//
FreePool (HiiHandles);
+
+ mSystemLevelFormSet = OldFormset;
}
/**
@@ -388,6 +396,7 @@
break;
}
Selection->FormSet = FormSet;
+ mSystemLevelFormSet = FormSet;
//
// Display this formset
@@ -397,6 +406,7 @@
Status = SetupBrowser (Selection);
gCurrentSelection = NULL;
+ mSystemLevelFormSet = NULL;
//
// If no data is changed, don't need to save current FormSet into the
maintain list.
@@ -580,7 +590,6 @@
LIST_ENTRY *Link;
BROWSER_STORAGE *Storage;
FORMSET_STORAGE *FormsetStorage;
- FORM_BROWSER_FORMSET *FormSet;
UINTN TotalSize;
BOOLEAN Found;
@@ -650,16 +659,15 @@
//
// GUID/Name is not specified, take the first storage in FormSet
//
- if (gCurrentSelection == NULL) {
+ if (mSystemLevelFormSet == NULL) {
return EFI_NOT_READY;
}
//
// Generate <ConfigResp>
//
- FormSet = gCurrentSelection->FormSet;
- Link = GetFirstNode (&FormSet->StorageListHead);
- if (IsNull (&FormSet->StorageListHead, Link)) {
+ Link = GetFirstNode (&mSystemLevelFormSet->StorageListHead);
+ if (IsNull (&mSystemLevelFormSet->StorageListHead, Link)) {
return EFI_UNSUPPORTED;
}
@@ -2375,7 +2383,8 @@
LIST_ENTRY *Link;
FORMSET_STORAGE *Storage;
FORM_BROWSER_CONFIG_REQUEST *ConfigInfo;
- FORM_BROWSER_FORMSET *LocalFormSet;
+ FORM_BROWSER_FORMSET *LocalFormSet;
+ FORM_BROWSER_FORMSET *OldFormSet;
//
// Check the supported setting level.
@@ -2454,7 +2463,8 @@
//
// System Level Discard.
//
-
+ OldFormSet = mSystemLevelFormSet;
+
//
// Discard changed value for each FormSet in the maintain list.
//
@@ -2465,6 +2475,9 @@
if (!ValidateFormSet(LocalFormSet)) {
continue;
}
+
+ mSystemLevelFormSet = LocalFormSet;
+
DiscardForm (LocalFormSet, NULL, FormSetLevel);
if (!IsHiiHandleInBrowserContext (LocalFormSet->HiiHandle)) {
//
@@ -2475,6 +2488,8 @@
DestroyFormSet (LocalFormSet);
}
}
+
+ mSystemLevelFormSet = OldFormSet;
}
return EFI_SUCCESS;
@@ -3416,6 +3431,7 @@
LIST_ENTRY *Link;
FORM_BROWSER_STATEMENT *Question;
FORM_BROWSER_FORMSET *LocalFormSet;
+ FORM_BROWSER_FORMSET *OldFormSet;
Status = EFI_SUCCESS;
@@ -3499,7 +3515,9 @@
// Preload all Hii formset.
//
LoadAllHiiFormset();
-
+
+ OldFormSet = mSystemLevelFormSet;
+
//
// Set Default Value for each FormSet in the maintain list.
//
@@ -3510,8 +3528,13 @@
if (!ValidateFormSet(LocalFormSet)) {
continue;
}
+
+ mSystemLevelFormSet = LocalFormSet;
+
ExtractDefault (LocalFormSet, NULL, DefaultId, FormSetLevel,
GetDefaultValueScope, Storage, RetrieveValueFirst);
}
+
+ mSystemLevelFormSet = OldFormSet;
}
return EFI_SUCCESS;
@@ -4224,7 +4247,7 @@
return;
case EFI_HII_VARSTORE_EFI_VARIABLE_BUFFER:
- if (Storage->BrowserStorage->ReferenceCount > 1) {
+ if (Storage->BrowserStorage->ConfigRequest != NULL) {
ConfigRequestAdjust(Storage);
return;
}
@@ -4326,6 +4349,17 @@
FORM_BROWSER_FORMSET *OldFormSet;
//
+ // Try to find pre FormSet in the maintain backup list.
+ // If old formset != NULL, destroy this formset. Add new formset to
gBrowserFormSetList.
+ //
+ OldFormSet = GetFormSetFromHiiHandle (FormSet->HiiHandle);
+ if (OldFormSet != NULL) {
+ RemoveEntryList (&OldFormSet->Link);
+ DestroyFormSet (OldFormSet);
+ }
+ InsertTailList (&gBrowserFormSetList, &FormSet->Link);
+
+ //
// Extract default from IFR binary for no storage questions.
//
ExtractDefault (FormSet, NULL, EFI_HII_DEFAULT_CLASS_STANDARD, FormSetLevel,
GetDefaultForNoStorage, NULL, TRUE);
@@ -4341,17 +4375,6 @@
Link = GetNextNode (&FormSet->StorageListHead, Link);
}
-
- //
- // Try to find pre FormSet in the maintain backup list.
- // If old formset != NULL, destroy this formset. Add new formset to
gBrowserFormSetList.
- //
- OldFormSet = GetFormSetFromHiiHandle (FormSet->HiiHandle);
- if (OldFormSet != NULL) {
- RemoveEntryList (&OldFormSet->Link);
- DestroyFormSet (OldFormSet);
- }
- InsertTailList (&gBrowserFormSetList, &FormSet->Link);
}
Modified: branches/UDK2010.SR1/MdeModulePkg/Universal/SetupBrowserDxe/Setup.h
===================================================================
--- branches/UDK2010.SR1/MdeModulePkg/Universal/SetupBrowserDxe/Setup.h
2013-09-25 03:34:23 UTC (rev 14725)
+++ branches/UDK2010.SR1/MdeModulePkg/Universal/SetupBrowserDxe/Setup.h
2013-09-25 05:08:42 UTC (rev 14726)
@@ -150,7 +150,6 @@
CHAR16 *ConfigRequest; // <ConfigRequest> = <ConfigHdr> +
<RequestElement>
// <RequestElement> includes all fields
which is used by current form sets.
UINTN SpareStrLen; // Spare length of ConfigRequest string
buffer
- UINT8 ReferenceCount; // How many form set storage refrence this
storage.
} BROWSER_STORAGE;
#define BROWSER_STORAGE_FROM_LINK(a) CR (a, BROWSER_STORAGE, Link,
BROWSER_STORAGE_SIGNATURE)
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60133471&iu=/4140/ostg.clktrk
_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits