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