PlatformCmosAccessLib.c 1.3 KB

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