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