]> 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 ec0b9d837e49dc0e0639bcbd0165fe7f2adc712c..6e7411977b967e7a1668442d6d0d2796d59c53f5 100644 (file)
@@ -2,52 +2,41 @@
   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
 #include "HwErrRecSupport.h"\r
 \r
+/**\r
+  Set the HwErrRecSupport variable contains a binary UINT16 that supplies the\r
+  level of support for Hardware Error Record Persistence that is implemented\r
+  by the platform.\r
+\r
+**/\r
 VOID\r
 InitializeHwErrRecSupport (\r
-  IN UINT16       HwErrRecSupportLevel\r
+  VOID\r
   )\r
-/*++\r
-\r
-  Routine Description:\r
-    Set the HwErrRecSupport variable contains a binary UINT16 that supplies the\r
-    level of support for Hardware Error Record Persistence that is implemented\r
-    by the platform.\r
-\r
-  Arguments:\r
-    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
-  Returns:\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