]> git.proxmox.com Git - mirror_edk2.git/blobdiff - IntelFrameworkModulePkg/Universal/BdsDxe/HwErrRecSupport.c
Follow UEFI spec, set TimeOut and HwErrRecSupport variable by EFI variable service...
[mirror_edk2.git] / IntelFrameworkModulePkg / Universal / BdsDxe / HwErrRecSupport.c
index ee1763b32d2a39cebcf99684770cd727047acdce..ddb2f9398080455f41a520f21e42e6a85221b41b 100644 (file)
@@ -2,7 +2,7 @@
   Set the level of support for Hardware Error Record Persistence that is\r
   implemented by the platform.\r
 \r
-Copyright (c) 2007 - 2008, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2007 - 2013, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -26,17 +26,23 @@ InitializeHwErrRecSupport (
   VOID\r
   )\r
 {\r
-  UINT16 HardwareErrorRecordLevel;\r
+  EFI_STATUS    Status;\r
+  UINT16        HardwareErrorRecordLevel;\r
   \r
   HardwareErrorRecordLevel = PcdGet16 (PcdHardwareErrorRecordLevel);\r
   \r
   if (HardwareErrorRecordLevel != 0) {\r
     //\r
-    // Set original value again to make sure this value is stored into variable\r
-    // area but not PCD database.\r
-    // if level value equal 0, no need set to 0 to variable area because UEFI specification\r
-    // define same behavior between no value or 0 value for L"HwErrRecSupport"\r
+    // If level value equal 0, no need set to 0 to variable area because UEFI specification\r
+    // define same behavior between no value or 0 value for L"HwErrRecSupport".\r
     //\r
-    PcdSet16 (PcdHardwareErrorRecordLevel, HardwareErrorRecordLevel);\r
+    Status = gRT->SetVariable (\r
+                    L"HwErrRecSupport",\r
+                    &gEfiGlobalVariableGuid,\r
+                    EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS | EFI_VARIABLE_NON_VOLATILE,\r
+                    sizeof (UINT16),\r
+                    &HardwareErrorRecordLevel\r
+                    );\r
+    ASSERT_EFI_ERROR(Status);\r
   }\r
 }\r