]> git.proxmox.com Git - mirror_edk2.git/blobdiff - IntelFrameworkModulePkg/Universal/BdsDxe/HwErrRecSupport.c
IntelFrameworkModulePkg: Clean up source files
[mirror_edk2.git] / IntelFrameworkModulePkg / Universal / BdsDxe / HwErrRecSupport.c
index 3b48c370ce37beb8134ee556f555ada8b8c55651..94c72cf984a32cb0acf8ba58be1306e456059db0 100644 (file)
@@ -2,8 +2,8 @@
   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. <BR>\r
-All rights reserved. This program and the accompanying materials\r
+Copyright (c) 2007 - 2018, 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
 http://opensource.org/licenses/bsd-license.php\r
@@ -20,30 +20,29 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
   level of support for Hardware Error Record Persistence that is implemented\r
   by the platform.\r
 \r
-\r
-  @param HwErrRecSupportLevel\r
-                         zero value:      Indicates that the platform implements no support for\r
-                                          Hardware Error Record Persistence.\r
-                         non-zero value:  Indicates that the platform implements Hardware Error\r
-                                          Record Persistence.\r
-\r
 **/\r
 VOID\r
 InitializeHwErrRecSupport (\r
-  IN UINT16       HwErrRecSupportLevel\r
+  VOID\r
   )\r
 {\r
-  EFI_STATUS  Status;\r
-\r
-  Status = gRT->SetVariable (\r
-                  L"HwErrRecSupport",\r
-                  &gEfiGlobalVariableGuid,\r
-                  EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS,\r
-                  sizeof (UINT16),\r
-                  &HwErrRecSupportLevel\r
-                  );\r
-  if (EFI_ERROR (Status)) {\r
-    DEBUG ((EFI_D_ERROR, "HwErrRecSupport: Can not set the variable\n"));\r
+  EFI_STATUS    Status;\r
+  UINT16        HardwareErrorRecordLevel;\r
+\r
+  HardwareErrorRecordLevel = PcdGet16 (PcdHardwareErrorRecordLevel);\r
+\r
+  if (HardwareErrorRecordLevel != 0) {\r
+    //\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
+    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
 }\r