some EDK2 fixes

Signed-off-by: Sergey Isakov <isakov-sl@bk.ru>
This commit is contained in:
Sergey Isakov 2020-04-20 19:42:43 +03:00
parent d7a38dce3e
commit f7436dffb9
2 changed files with 16 additions and 3 deletions

View File

@ -2865,9 +2865,9 @@ VariableServiceGetVariable (
} }
CopyMem (Data, GetVariableDataPtr (Variable.CurrPtr), VarDataSize); CopyMem (Data, GetVariableDataPtr (Variable.CurrPtr), VarDataSize);
if (Attributes != NULL) { // if (Attributes != NULL) {
*Attributes = Variable.CurrPtr->Attributes; // *Attributes = Variable.CurrPtr->Attributes;
} // }
*DataSize = VarDataSize; *DataSize = VarDataSize;
UpdateVariableInfo (VariableName, VendorGuid, Variable.Volatile, TRUE, FALSE, FALSE, FALSE); UpdateVariableInfo (VariableName, VendorGuid, Variable.Volatile, TRUE, FALSE, FALSE, FALSE);
@ -2881,6 +2881,11 @@ VariableServiceGetVariable (
} }
Done: Done:
if (Status == EFI_SUCCESS || Status == EFI_BUFFER_TOO_SMALL) {
if (Attributes != NULL && Variable.CurrPtr != NULL) {
*Attributes = Variable.CurrPtr->Attributes;
}
}
ReleaseLockOnlyAtBootTime (&mVariableModuleGlobal->VariableGlobal.VariableServicesLock); ReleaseLockOnlyAtBootTime (&mVariableModuleGlobal->VariableGlobal.VariableServicesLock);
return Status; return Status;
} }

View File

@ -166,4 +166,12 @@
#define AML_EXT_BANK_FIELD_OP 0x87 #define AML_EXT_BANK_FIELD_OP 0x87
#define AML_EXT_DATA_REGION_OP 0x88 #define AML_EXT_DATA_REGION_OP 0x88
//
// FieldElement OpCode
//
#define AML_FIELD_RESERVED_OP 0x00
#define AML_FIELD_ACCESS_OP 0x01
#define AML_FIELD_CONNECTION_OP 0x02
#define AML_FIELD_EXT_ACCESS_OP 0x03
#endif #endif