EHS
CPU.h
Go to the documentation of this file.
1
#pragma once
2
3
#include "
ehs/Types.h
"
4
#include "
Architecture.h
"
5
#include "
OS.h
"
6
#include "
ehs/Str.h
"
7
#include "
ehs/Array.h
"
8
9
namespace
ehs
10
{
11
enum class
Architecture
:
UInt_8
12
{
13
X64
,
14
X86
,
15
ARM64
,
16
ARM
,
17
UNKNOWN
18
};
19
20
enum class
Endianness
:
UInt_8
21
{
22
LE
,
23
BE
24
};
25
26
struct
TSC
27
{
28
UInt_32
coreId
= 0;
29
UInt_32
highCount
= 0;
30
UInt_32
lowCount
= 0;
31
};
32
33
class
EHS_LIB_IO
CPU
34
{
35
private
:
36
#ifdef EHS_OS_LINUX
37
static
UInt_64 TSC_Freq;
38
#endif
39
40
public
:
41
static
Architecture
GetArchitecture();
42
43
static
UInt_8
PointerSize();
44
45
static
Endianness
GetEndianness();
46
47
static
void
RDTSCP(
TSC
* tsc);
48
49
static
UInt_64 GetTSC_Freq();
50
51
static
UInt_64 GetTSC();
52
55
static
void
GetManufacturer(
Char_8
* input);
56
57
static
UInt_32
GetInfoBits();
58
59
static
UInt_8
GetSteppingId();
60
61
static
UInt_8
GetModelId();
62
63
static
UInt_8
GetFamilyId();
64
65
static
UInt_8
GetProcessorTypeId();
66
67
static
UInt_8
GetExtModelId();
68
69
static
UInt_8
GetExtFamilyId();
70
71
static
UInt_32
GetFeatureBits_1();
72
73
static
bool
HasFPU();
74
75
static
bool
HasVME();
76
77
static
bool
HasDE();
78
79
static
bool
HasPSE();
80
81
static
bool
HasTSC();
82
83
static
bool
HasMSR();
84
85
static
bool
HasPAE();
86
87
static
bool
HasMCE();
88
89
static
bool
HasCX8();
90
91
static
bool
HasAPIC();
92
93
static
bool
HasSEP();
94
95
static
bool
HasMTRR();
96
97
static
bool
HasPGE();
98
99
static
bool
HasMCA();
100
101
static
bool
HasCMOV();
102
103
static
bool
HasPAT();
104
105
static
bool
HasPSE_36();
106
107
static
bool
HasPSN();
108
109
static
bool
HasCLFSH();
110
111
static
bool
HasDS();
112
113
static
bool
HasACPI();
114
115
static
bool
HasMMX();
116
117
static
bool
HasFXSR();
118
119
static
bool
HasSSE();
120
121
static
bool
HasSSE2();
122
123
static
bool
HasSS();
124
125
static
bool
HasHTT();
126
127
static
bool
HasTM();
128
129
static
bool
HasIA64();
130
131
static
bool
HasPBE();
132
133
static
UInt_32
GetFeatureBits_2();
134
135
static
bool
HasSSE3();
136
137
static
bool
HasPCLMULQDQ();
138
139
static
bool
HasDTES64();
140
141
static
bool
HasMONITOR();
142
143
static
bool
HasDS_CPL();
144
145
static
bool
HasVMX();
146
147
static
bool
HasSMX();
148
149
static
bool
HasEST();
150
151
static
bool
HasTM2();
152
153
static
bool
HasSSSE3();
154
155
static
bool
HasCNXT_ID();
156
157
static
bool
HasSDBG();
158
159
static
bool
HasFMA();
160
161
static
bool
HasCX16();
162
163
static
bool
HasXTPR();
164
165
static
bool
HasPDCM();
166
167
static
bool
HasPCID();
168
169
static
bool
HasDCA();
170
171
static
bool
HasSSE4_1();
172
173
static
bool
HasSSE4_2();
174
175
static
bool
HasX2APIC();
176
177
static
bool
HasMOVBE();
178
179
static
bool
HasPOPCNT();
180
181
static
bool
HasTSC_DEADLINE();
182
183
static
bool
HasAES();
184
185
static
bool
HasXSAVE();
186
187
static
bool
HasOSXSAVE();
188
189
static
bool
HasAVX();
190
191
static
bool
HasF16C();
192
193
static
bool
HasRDRND();
194
195
static
bool
HasHYPERVISOR();
196
197
static
UInt_32
GetExtFeatureBits_1();
198
199
static
bool
HasAVX2();
200
201
static
bool
HasRDSEED();
202
203
static
bool
HasADX();
204
205
static
UInt_32
GetExtFeatureBits_2();
206
207
static
UInt_32
GetExtFeatureBits_3();
208
211
static
void
GetBrand(
Char_8
* input);
212
213
static
UInt_8
GetCacheLineSize();
214
215
//static Str_8 ToStr();
216
217
private
:
218
static
UInt_64 RetrieveTSC_Freq();
219
220
static
UInt_64 CalculateTSC_Freq();
221
};
222
}
Architecture.h
Array.h
OS.h
Str.h
Types.h
ehs::CPU
Definition:
CPU.h:34
ehs
Definition:
Anchor.h:6
ehs::Endianness
Endianness
Definition:
CPU.h:21
ehs::Endianness::LE
@ LE
ehs::Endianness::BE
@ BE
ehs::Architecture
Architecture
Definition:
CPU.h:12
ehs::Architecture::ARM
@ ARM
ehs::Architecture::UNKNOWN
@ UNKNOWN
ehs::Architecture::ARM64
@ ARM64
ehs::Architecture::X64
@ X64
ehs::Architecture::X86
@ X86
ehs::UInt_32
unsigned int UInt_32
Definition:
Types.h:49
ehs::Char_8
char Char_8
Definition:
Types.h:40
ehs::UInt_8
unsigned char UInt_8
Definition:
Types.h:43
ehs::TSC
Definition:
CPU.h:27
ehs::TSC::lowCount
UInt_32 lowCount
Definition:
CPU.h:30
ehs::TSC::coreId
UInt_32 coreId
Definition:
CPU.h:28
ehs::TSC::highCount
UInt_32 highCount
Definition:
CPU.h:29
include
ehs
system
CPU.h
Generated by
1.9.4