]> git.proxmox.com Git - mirror_edk2.git/blob - MdeModulePkg/Universal/BdsDxe/HwErrRecSupport.c
MdeModulePkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / MdeModulePkg / Universal / BdsDxe / HwErrRecSupport.c
1 /** @file
2 Set the level of support for Hardware Error Record Persistence that is
3 implemented by the platform.
4
5 Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>
6 SPDX-License-Identifier: BSD-2-Clause-Patent
7
8 **/
9
10 #include "HwErrRecSupport.h"
11
12 /**
13 Set the HwErrRecSupport variable contains a binary UINT16 that supplies the
14 level of support for Hardware Error Record Persistence that is implemented
15 by the platform.
16
17 **/
18 VOID
19 InitializeHwErrRecSupport (
20 VOID
21 )
22 {
23 EFI_STATUS Status;
24 UINT16 HardwareErrorRecordLevel;
25
26 HardwareErrorRecordLevel = PcdGet16 (PcdHardwareErrorRecordLevel);
27
28 if (HardwareErrorRecordLevel != 0) {
29 //
30 // If level value equal 0, no need set to 0 to variable area because UEFI specification
31 // define same behavior between no value or 0 value for L"HwErrRecSupport".
32 //
33 Status = gRT->SetVariable (
34 L"HwErrRecSupport",
35 &gEfiGlobalVariableGuid,
36 EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS | EFI_VARIABLE_NON_VOLATILE,
37 sizeof (UINT16),
38 &HardwareErrorRecordLevel
39 );
40 ASSERT_EFI_ERROR(Status);
41 }
42 }