hc
2024-03-22 a0752693d998599af469473b8dc239ef973a012f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
/** @file
  Platform CMOS Access Library.
 
  @copyright
  Copyright 2015 - 2021 Intel Corporation. <BR>
 
  SPDX-License-Identifier: BSD-2-Clause-Patent
**/
 
#include <Library/IoLib.h>
#include <Library/PlatformCmosAccessLib.h>
#include <Platform.h>
#include <Uefi.h>
#include <PiPei.h>
#include <Library/PchInfoLib.h>
#include <Register/PchRegsPcr.h>
#include <Library/PeiServicesLib.h>
#include <Ppi/DynamicSiLibraryPpi.h>
#include <Library/DebugLib.h>
 
/**
  Return the platform CMOS entries.
 
  @param [out]  EnryCount Number of platform CMOS entries.
 
  @return Platform CMOS entries.
**/
CMOS_ENTRY *
EFIAPI
PlatformCmosGetEntry (
  OUT UINTN       *EntryCount
  )
{
 
  *EntryCount = 0;
  return NULL;
}
 
 
/**
  Return the NMI enable status.
**/
 
BOOLEAN
EFIAPI
PlatformCmosGetNmiState (
  VOID
 )
{
  volatile UINT32           Data32;
  BOOLEAN                   Nmi;
  Data32                    = 0;
  EFI_STATUS                Status = EFI_SUCCESS;
  DYNAMIC_SI_LIBARY_PPI     *DynamicSiLibraryPpi = NULL;
 
  Status = PeiServicesLocatePpi (&gDynamicSiLibraryPpiGuid, 0, NULL, &DynamicSiLibraryPpi);
  if (EFI_ERROR (Status)) {
    ASSERT_EFI_ERROR (Status);
    return FALSE;
  }
 
  //
  // Preserve NMI bit setting
  //
 
  if ((DynamicSiLibraryPpi->ReadNmiEn ())& B_PCH_IO_NMI_EN_NMI_EN) {
    Nmi = TRUE;
  }
  else
    Nmi = FALSE;
 
  return Nmi;
}