]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Return EFI_WRITE_PROTECTED when setting HwErrRecSupport Global Variable at runtime.
authorlzeng14 <lzeng14@6f19259b-4bc3-4df7-8a09-765794883524>
Wed, 30 May 2012 02:42:26 +0000 (02:42 +0000)
committerlzeng14 <lzeng14@6f19259b-4bc3-4df7-8a09-765794883524>
Wed, 30 May 2012 02:42:26 +0000 (02:42 +0000)
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Guo Dong <guo.dong@intel.com>
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13372 6f19259b-4bc3-4df7-8a09-765794883524

MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c
SecurityPkg/VariableAuthenticated/RuntimeDxe/Variable.c

index 94ec660c04b657522b8a31dc3190e26de485ff8e..8f1ae7b130d2d775193722f6a11d1f2367f008a3 100644 (file)
@@ -1,6 +1,6 @@
 /** @file\r
 \r
-  The common variable operation routines shared by DXE_RINTIME variable \r
+  The common variable operation routines shared by DXE_RUNTIME variable \r
   module and DXE_SMM variable module.\r
   \r
 Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>\r
@@ -2065,7 +2065,17 @@ VariableServiceSetVariable (
         (sizeof (VARIABLE_HEADER) + StrSize (VariableName) + DataSize > PcdGet32 (PcdMaxVariableSize))) {\r
       return EFI_INVALID_PARAMETER;\r
     }  \r
-  }  \r
+  }\r
+\r
+  if (AtRuntime ()) {\r
+    //\r
+    // HwErrRecSupport Global Variable identifies the level of hardware error record persistence\r
+    // support implemented by the platform. This variable is only modified by firmware and is read-only to the OS.\r
+    //\r
+    if (CompareGuid (VendorGuid, &gEfiGlobalVariableGuid) && (StrCmp (VariableName, L"HwErrRecSupport") == 0)) {\r
+      return EFI_WRITE_PROTECTED;\r
+    }\r
+  }\r
 \r
   AcquireLockOnlyAtBootTime(&mVariableModuleGlobal->VariableGlobal.VariableServicesLock);\r
 \r
index 4c88eb6ff69a2007ecd9b67fa7e8ecea33256d3d..d3e0b7766e8d96d065dba767abcc52eeececd1cd 100644 (file)
@@ -1,5 +1,5 @@
 /** @file\r
-  The common variable operation routines shared by DXE_RINTIME variable\r
+  The common variable operation routines shared by DXE_RUNTIME variable\r
   module and DXE_SMM variable module.\r
 \r
 Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.<BR>\r
@@ -2216,6 +2216,16 @@ VariableServiceSetVariable (
     }\r
   }\r
 \r
+  if (AtRuntime ()) {\r
+    //\r
+    // HwErrRecSupport Global Variable identifies the level of hardware error record persistence\r
+    // support implemented by the platform. This variable is only modified by firmware and is read-only to the OS.\r
+    //\r
+    if (CompareGuid (VendorGuid, &gEfiGlobalVariableGuid) && (StrCmp (VariableName, L"HwErrRecSupport") == 0)) {\r
+      return EFI_WRITE_PROTECTED;\r
+    }\r
+  }\r
+\r
   AcquireLockOnlyAtBootTime(&mVariableModuleGlobal->VariableGlobal.VariableServicesLock);\r
 \r
   //\r