diff options
author | jljusten <jljusten@6f19259b-4bc3-4df7-8a09-765794883524> | 2009-04-29 20:22:38 +0000 |
---|---|---|
committer | jljusten <jljusten@6f19259b-4bc3-4df7-8a09-765794883524> | 2009-04-29 20:22:38 +0000 |
commit | 51967a53143ff87800afe37b3c72292a7ae5f938 (patch) | |
tree | 1761806be1c5280a44a79ea4f0511183a6dec97b /MdeModulePkg | |
parent | 6198c34621b38815bbfb116f8fcf656a54470920 (diff) | |
download | edk2-51967a53143ff87800afe37b3c72292a7ae5f938.zip edk2-51967a53143ff87800afe37b3c72292a7ae5f938.tar.gz edk2-51967a53143ff87800afe37b3c72292a7ae5f938.tar.bz2 |
Acquire & Release the lock from the high level variable service
routines similar to MdeModulePkg/Universal/Variable/RuntimeDxe.
When the Acquire was in the FindVariable routine, is was
being called by both EmuSetVariable and again in
AutoUpdateLangVariable, which caused an ASSERT to fail.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@8205 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg')
-rw-r--r-- | MdeModulePkg/Universal/Variable/EmuRuntimeDxe/EmuVariable.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/MdeModulePkg/Universal/Variable/EmuRuntimeDxe/EmuVariable.c b/MdeModulePkg/Universal/Variable/EmuRuntimeDxe/EmuVariable.c index 9f372c1..6925f3c 100644 --- a/MdeModulePkg/Universal/Variable/EmuRuntimeDxe/EmuVariable.c +++ b/MdeModulePkg/Universal/Variable/EmuRuntimeDxe/EmuVariable.c @@ -812,13 +812,6 @@ FindVariable ( UINTN Index;
//
- // We aquire the lock at the entry of FindVariable as GetVariable, GetNextVariableName
- // SetVariable all call FindVariable at entry point. Please move "Aquire Lock" to
- // the correct places if this assumption does not hold TRUE anymore.
- //
- AcquireLockOnlyAtBootTime(&Global->VariableServicesLock);
-
- //
// 0: Non-Volatile, 1: Volatile
//
VariableStoreHeader[0] = (VARIABLE_STORE_HEADER *) ((UINTN) Global->NonVolatileVariableBase);
@@ -906,6 +899,9 @@ EmuGetVariable ( if (VariableName == NULL || VendorGuid == NULL || DataSize == NULL) {
return EFI_INVALID_PARAMETER;
}
+
+ AcquireLockOnlyAtBootTime(&Global->VariableServicesLock);
+
//
// Find existing variable
//
@@ -979,6 +975,8 @@ EmuGetNextVariableName ( return EFI_INVALID_PARAMETER;
}
+ AcquireLockOnlyAtBootTime(&Global->VariableServicesLock);
+
Status = FindVariable (VariableName, VendorGuid, &Variable, Global);
if (Variable.CurrPtr == NULL || EFI_ERROR (Status)) {
@@ -1129,6 +1127,8 @@ EmuSetVariable ( }
}
+ AcquireLockOnlyAtBootTime(&Global->VariableServicesLock);
+
//
// Check whether the input variable is already existed
//
|