IdccInfo.c 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. /** @file
  2. Copyright (c) 2004 - 2014, Intel Corporation. All rights reserved.<BR>
  3. SPDX-License-Identifier: BSD-2-Clause-Patent
  4. Module Name:
  5. IdccInfo.c
  6. Abstract:
  7. Platform information used by IDCC.
  8. Revision History
  9. --*/
  10. #include "PlatformDxe.h"
  11. #include <Guid/IdccData.h>
  12. extern EFI_GUID mPlatformDriverGuid;
  13. EFI_STATUS
  14. WriteIdccInfo (
  15. )
  16. {
  17. EFI_STATUS Status;
  18. EFI_DATA_HUB_PROTOCOL *DataHub;
  19. UINT8 Ratio;
  20. EFI_IDCC_PROCESSOR_RATIO ProcRatio;
  21. //
  22. // Locate the data hub protocol
  23. //
  24. Status = gBS->LocateProtocol (
  25. &gEfiDataHubProtocolGuid,
  26. NULL,
  27. (VOID **) &DataHub
  28. );
  29. //
  30. // Find processor actual ratio
  31. //
  32. Ratio = 15; //Temporary - some dummy value.
  33. //
  34. // Fill in IDCC Type 5 structure
  35. //
  36. ProcRatio.IdccHeader.Type = EFI_IDCC_PROC_RATIO_TYPE;
  37. ProcRatio.IdccHeader.RecordLength = sizeof(EFI_IDCC_PROCESSOR_RATIO);
  38. ProcRatio.ProcessorRatio = Ratio;
  39. //
  40. // Write data to the data hub
  41. //
  42. Status = DataHub->LogData (
  43. DataHub,
  44. &gIdccDataHubGuid,
  45. &mPlatformDriverGuid,
  46. EFI_DATA_RECORD_CLASS_DATA,
  47. &ProcRatio,
  48. sizeof(EFI_IDCC_PROCESSOR_RATIO)
  49. );
  50. return Status;
  51. }