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