From f7436dffb9e8a34722210e2e82c54cce60981421 Mon Sep 17 00:00:00 2001 From: Sergey Isakov Date: Mon, 20 Apr 2020 19:42:43 +0300 Subject: [PATCH] some EDK2 fixes Signed-off-by: Sergey Isakov --- MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c | 11 ++++++++--- MdePkg/Include/IndustryStandard/AcpiAml.h | 8 ++++++++ 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c b/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c index f32c9c280..58d93789e 100644 --- a/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c +++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c @@ -2865,9 +2865,9 @@ VariableServiceGetVariable ( } CopyMem (Data, GetVariableDataPtr (Variable.CurrPtr), VarDataSize); - if (Attributes != NULL) { - *Attributes = Variable.CurrPtr->Attributes; - } +// if (Attributes != NULL) { +// *Attributes = Variable.CurrPtr->Attributes; +// } *DataSize = VarDataSize; UpdateVariableInfo (VariableName, VendorGuid, Variable.Volatile, TRUE, FALSE, FALSE, FALSE); @@ -2881,6 +2881,11 @@ VariableServiceGetVariable ( } Done: + if (Status == EFI_SUCCESS || Status == EFI_BUFFER_TOO_SMALL) { + if (Attributes != NULL && Variable.CurrPtr != NULL) { + *Attributes = Variable.CurrPtr->Attributes; + } + } ReleaseLockOnlyAtBootTime (&mVariableModuleGlobal->VariableGlobal.VariableServicesLock); return Status; } diff --git a/MdePkg/Include/IndustryStandard/AcpiAml.h b/MdePkg/Include/IndustryStandard/AcpiAml.h index 6919622af..4e95c95c9 100644 --- a/MdePkg/Include/IndustryStandard/AcpiAml.h +++ b/MdePkg/Include/IndustryStandard/AcpiAml.h @@ -166,4 +166,12 @@ #define AML_EXT_BANK_FIELD_OP 0x87 #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