]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/BdsDxe/HwErrRecSupport.c
MdeModulePkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / MdeModulePkg / Universal / BdsDxe / HwErrRecSupport.c
index aad06afa2c08030476ba891e0dd6f6261b1eeb30..6e7411977b967e7a1668442d6d0d2796d59c53f5 100644 (file)
@@ -2,14 +2,8 @@
   Set the level of support for Hardware Error Record Persistence that is\r
   implemented by the platform.\r
 \r
   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
-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
-\r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>\r
+SPDX-License-Identifier: BSD-2-Clause-Patent\r
 \r
 **/\r
 \r
 \r
 **/\r
 \r
@@ -20,32 +14,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
   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
-  @return VOID\r
-\r
 **/\r
 VOID\r
 InitializeHwErrRecSupport (\r
 **/\r
 VOID\r
 InitializeHwErrRecSupport (\r
-  IN UINT16       HwErrRecSupportLevel\r
+  VOID\r
   )\r
 {\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
 }\r
 }\r