summaryrefslogtreecommitdiff
path: root/Core/CPU/CpuDxe.h
blob: aeb5015d2125ec31ec4b566f7264a0681bbc1307 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
//*************************************************************************
//*************************************************************************
//**                                                                     **
//**        (C)Copyright 1987-2013, American Megatrends, Inc.            **
//**                                                                     **
//**                       All Rights Reserved.                          **
//**                                                                     **
//**      5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093           **
//**                                                                     **
//**                       Phone: (770)-246-8600                         **
//**                                                                     **
//*************************************************************************
//*************************************************************************

//**********************************************************************
// $Header: /Alaska/SOURCE/Modules/SharkBayRefCodes/Haswell/AMI Cpu PKG/CPU Core/CpuDxe.h 2     1/14/13 1:54a Crystallee $
//
// $Revision: 2 $
//
// $Date: 1/14/13 1:54a $
//**********************************************************************
// Revision History
// ----------------
// $Log: /Alaska/SOURCE/Modules/SharkBayRefCodes/Haswell/AMI Cpu PKG/CPU Core/CpuDxe.h $
// 
// 2     1/14/13 1:54a Crystallee
// [TAG]  		EIP111199
// [Category]  	Improvement
// [Description]  	Provide variable data which constains number of P
// states support.
// 
// 1     2/07/12 3:58a Davidhsieh
//
//**********************************************************************

//<AMI_FHDR_START>
//---------------------------------------------------------------------------
//
// Name:	CpuDxe.h
//
// Description:	Cpu Dxe header file.
//
//---------------------------------------------------------------------------
//<AMI_FHDR_END>

#ifndef __CPU_DXE_H__
#define __CPU_DXE_H__

#include <AmiHobs.h>
#include <Protocol\Cpu.h>
#include <Protocol\MpService\MpService.h>
#include <Protocol\AmiCpuInfo2.h>
#include "Cpu.h"

#ifdef __cplusplus
extern "C" {
#endif

// Define structures used and referenced in this file
typedef struct{
	UINT16 NumberOfPStates;
} P_STATES_DATA;

typedef struct{
	UINT32 MemAddress, MemLength;
} system_memory_struc;

EFI_STATUS EfiCpuFlushDataCache (
    IN EFI_CPU_ARCH_PROTOCOL    *This,
    IN EFI_PHYSICAL_ADDRESS     Start,
    IN UINT64                   Length,
    IN EFI_CPU_FLUSH_TYPE       FlushType);

EFI_STATUS EfiCpuSetMemoryAttributes (
    IN EFI_CPU_ARCH_PROTOCOL    *This,
    IN EFI_PHYSICAL_ADDRESS     BaseAddress,
    IN UINT64                   Length,
    IN UINT64                   Attributes);

extern EFI_MP_SERVICES_PROTOCOL *gEfiMpServicesProtocol;

//APIC ID
//CPU NUM
#define PRIVATE_INFO_NUM_OF_CPU_DATA 2

typedef struct {
    AMI_CPU_INFO_2_PROTOCOL AmiCpuInfo2;
//??? Determine max structure size of UINT32s
    //  UINT32 # of populated Sockets 0
    //  ---------------------
    //  ---------------------
    //  ---Socket #0---
    //  UINT32 # of Cores
    //   ---Core #0---
    //  UINT32 # of Threads
    //   ---Thread #0---
    //  UINT32 APIC ID
    //  UINT32 CPU Num
    //   ---Thread #1---
    //  UINT32 APIC ID
    //  UINT32 CPU Num
    //  ---Core #1---
    //  ....
    //  ---------------------
    //  ---------------------
    //  ---Socket #1---
    //  UINT32 # of Cores
    //  ---Core # 0---
    //  UINT32 # of Threads
    //  ---Thread #0---
    //  ....
} PRIVATE_AMI_CPU_INFO_2_PROTOCOL;

extern PRIVATE_AMI_CPU_INFO_2_PROTOCOL *gPrivateAmiCpuInfo2;

typedef struct _AMI_BEFORE_CPU_RC_PROTOCOL AMI_BEFORE_CPU_RC_PROTOCOL;

typedef
EFI_STATUS
(EFIAPI *PLATFORM_CPU_DXE_POLICY_OVERWRITE) (
  IN AMI_BEFORE_CPU_RC_PROTOCOL    *This
  
  );

typedef struct _AMI_BEFORE_CPU_RC_PROTOCOL {
	PLATFORM_CPU_DXE_POLICY_OVERWRITE		PlatformCpuDxePolicyOverwrite;
};

VOID CpuDxeMiscFuncs(VOID);

#if PERF_TUNE_SUPPORT == 1

EFI_STATUS IntelXtuFillCpuDataCallBack(
    IN EFI_EVENT    Event,
    IN VOID         *Context
);

#endif

/****** DO NOT WRITE BELOW THIS LINE *******/
#ifdef __cplusplus
}
#endif
#endif

//*************************************************************************
//*************************************************************************
//**                                                                     **
//**        (C)Copyright 1987-2013, American Megatrends, Inc.            **
//**                                                                     **
//**                       All Rights Reserved.                          **
//**                                                                     **
//**      5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093           **
//**                                                                     **
//**                       Phone: (770)-246-8600                         **
//**                                                                     **
//*************************************************************************
//*************************************************************************