]> git.proxmox.com Git - mirror_edk2.git/blame - Vlv2TbltDevicePkg/PlatformDxe/IdccInfo.c
Upload BSD-licensed Vlv2TbltDevicePkg and Vlv2DeviceRefCodePkg to
[mirror_edk2.git] / Vlv2TbltDevicePkg / PlatformDxe / IdccInfo.c
CommitLineData
3cbfba02
DW
1/** @file\r
2\r
3 Copyright (c) 2004 - 2014, Intel Corporation. All rights reserved.<BR>\r
4 \r\r
5 This program and the accompanying materials are licensed and made available under\r\r
6 the terms and conditions of the BSD License that accompanies this distribution. \r\r
7 The full text of the license may be found at \r\r
8 http://opensource.org/licenses/bsd-license.php. \r\r
9 \r\r
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r\r
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r\r
12 \r\r
13\r
14Module Name:\r
15\r
16\r
17 IdccInfo.c\r
18\r
19Abstract:\r
20\r
21 Platform information used by IDCC.\r
22\r
23Revision History\r
24\r
25--*/\r
26\r
27#include "PlatformDxe.h"\r
28\r
29#include <Guid/IdccData.h>\r
30\r
31extern EFI_GUID mPlatformDriverGuid;\r
32\r
33\r
34EFI_STATUS\r
35WriteIdccInfo (\r
36 )\r
37{\r
38 EFI_STATUS Status;\r
39 EFI_DATA_HUB_PROTOCOL *DataHub;\r
40 UINT8 Ratio;\r
41 EFI_IDCC_PROCESSOR_RATIO ProcRatio;\r
42\r
43 //\r
44 // Locate the data hub protocol\r
45 //\r
46 Status = gBS->LocateProtocol (\r
47 &gEfiDataHubProtocolGuid,\r
48 NULL,\r
49 (VOID **) &DataHub\r
50 );\r
51\r
52 //\r
53 // Find processor actual ratio\r
54 //\r
55 Ratio = 15; //Temporary - some dummy value.\r
56\r
57 //\r
58 // Fill in IDCC Type 5 structure\r
59 //\r
60 ProcRatio.IdccHeader.Type = EFI_IDCC_PROC_RATIO_TYPE;\r
61 ProcRatio.IdccHeader.RecordLength = sizeof(EFI_IDCC_PROCESSOR_RATIO);\r
62 ProcRatio.ProcessorRatio = Ratio;\r
63\r
64 //\r
65 // Write data to the data hub\r
66 //\r
67 Status = DataHub->LogData (\r
68 DataHub,\r
69 &gIdccDataHubGuid,\r
70 &mPlatformDriverGuid,\r
71 EFI_DATA_RECORD_CLASS_DATA,\r
72 &ProcRatio,\r
73 sizeof(EFI_IDCC_PROCESSOR_RATIO)\r
74 );\r
75\r
76 return Status;\r
77}\r