AcpiPlatformLibNfit.c 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /** @file
  2. ACPI Platform Driver Hooks
  3. @copyright
  4. Copyright 1996 - 2019 Intel Corporation. <BR>
  5. SPDX-License-Identifier: BSD-2-Clause-Patent
  6. **/
  7. //
  8. // Statements that include other files
  9. //
  10. #include "AcpiPlatformLibLocal.h"
  11. /**
  12. This function locates the CrystalRidge protocol and JedecNvdimm protocol
  13. and calls the update ACPI tables functions defined there to update/build
  14. the NVDIMM F/W Interface Table (NFIT). It builds the NFIT table which gets
  15. published in ACPI XSDT.
  16. @param[in,out] Table Pointer to NFIT which will be build in
  17. CR Protocol and will be publised in ACPI XSDT.
  18. @retval EFI_SUCCESS Table successfully updated.
  19. @retval EFI_UNSUPPORTED Table not updated.
  20. **/
  21. EFI_STATUS
  22. UpdateNfitTable (
  23. IN OUT EFI_ACPI_COMMON_HEADER *Table
  24. )
  25. {
  26. EFI_NFIT_TABLE_UPDATE_PROTOCOL *NfitTableUpdateProtocol = NULL;
  27. EFI_STATUS Status;
  28. Status = gBS->LocateProtocol (&gEfiNfitTableUpdateProtocolGuid, NULL, (VOID **) &NfitTableUpdateProtocol);
  29. if (!EFI_ERROR (Status)) {
  30. Status = NfitTableUpdateProtocol->UpdateAcpiTable ((UINT64*) Table);
  31. } else {
  32. DEBUG ((DEBUG_ERROR, "Cannot find NfitTableUpdateProtocol\n"));
  33. }
  34. DEBUG ((DEBUG_INFO, "NFIT Update Status: 0x%x\n", Status));
  35. return Status;
  36. }