]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/BdsDxe/HwErrRecSupport.c
MdeModulePkg ResetSystem: Update the comments of ResetSystem()
[mirror_edk2.git] / MdeModulePkg / Universal / BdsDxe / HwErrRecSupport.c
index 9ea6dbc554012e241c53e3d8d02ba07ef46d5b1c..87e39c3c8d6dcf7bff2cebc80379d5c588cacfa8 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 - 2015, 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