Pyrogenesis
13997
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
source
lib
sysdep
arch
x86_x64
msr.h
Go to the documentation of this file.
1
/* Copyright (c) 2010 Wildfire Games
2
*
3
* Permission is hereby granted, free of charge, to any person obtaining
4
* a copy of this software and associated documentation files (the
5
* "Software"), to deal in the Software without restriction, including
6
* without limitation the rights to use, copy, modify, merge, publish,
7
* distribute, sublicense, and/or sell copies of the Software, and to
8
* permit persons to whom the Software is furnished to do so, subject to
9
* the following conditions:
10
*
11
* The above copyright notice and this permission notice shall be included
12
* in all copies or substantial portions of the Software.
13
*
14
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
17
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
18
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
19
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
20
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21
*/
22
23
/*
24
* model-specific registers
25
*/
26
27
#ifndef INCLUDED_X86_X64_MSR
28
#define INCLUDED_X86_X64_MSR
29
30
namespace
MSR {
31
32
enum
ModelSpecificRegisters
33
{
34
// architectural (will not change on future processors)
35
IA32_MISC_ENABLE
= 0x1A0,
36
IA32_ENERGY_PERF_BIAS
= 0x1B0,
// requires HasEnergyPerfBias
37
38
// PMU v1
39
IA32_PMC0
= 0x0C1,
40
IA32_PERFEVTSEL0
= 0x186,
41
42
// PMU v2
43
IA32_PERF_GLOBAL_STATUS
= 0x38E,
44
IA32_PERF_GLOBAL_CTRL
= 0x38F,
45
IA32_PERF_GLOBAL_OVF_CTRL
= 0x390,
46
47
// Nehalem and later
48
PLATFORM_INFO
= 0x0CE,
// requires HasPlatformInfo
49
50
// Nehalem, Westmere (requires HasUncore)
51
UNCORE_PERF_GLOBAL_CTRL
= 0x391,
52
UNCORE_PERF_GLOBAL_STATUS
= 0x392,
53
UNCORE_PERF_GLOBAL_OVF_CTRL
= 0x393,
54
UNCORE_PMC0
= 0x3B0,
55
UNCORE_PERFEVTSEL0
= 0x3C0
56
};
57
58
LIB_API
bool
IsAccessible
();
59
60
LIB_API
bool
HasEnergyPerfBias
();
61
LIB_API
bool
HasPlatformInfo
();
62
LIB_API
bool
HasUncore
();
63
64
LIB_API
u64
Read
(
u64
reg);
65
LIB_API
void
Write
(
u64
reg,
u64
value);
66
67
}
// namespace MSR
68
69
#endif // #ifndef INCLUDED_X86_X64_MSR
MSR::IA32_PERFEVTSEL0
Definition:
msr.h:40
MSR::IA32_PERF_GLOBAL_CTRL
Definition:
msr.h:44
MSR::HasUncore
bool HasUncore()
Definition:
msr.cpp:103
MSR::IsAccessible
bool IsAccessible()
Definition:
msr.cpp:32
MSR::UNCORE_PERFEVTSEL0
Definition:
msr.h:55
MSR::IA32_MISC_ENABLE
Definition:
msr.h:35
MSR::IA32_PERF_GLOBAL_STATUS
Definition:
msr.h:43
MSR::IA32_ENERGY_PERF_BIAS
Definition:
msr.h:36
MSR::ModelSpecificRegisters
ModelSpecificRegisters
Definition:
msr.h:32
MSR::UNCORE_PMC0
Definition:
msr.h:54
MSR::UNCORE_PERF_GLOBAL_STATUS
Definition:
msr.h:52
MSR::UNCORE_PERF_GLOBAL_CTRL
Definition:
msr.h:51
MSR::HasPlatformInfo
bool HasPlatformInfo()
Definition:
msr.cpp:66
u64
#define u64
Definition:
types.h:42
MSR::HasEnergyPerfBias
bool HasEnergyPerfBias()
Definition:
msr.cpp:45
MSR::PLATFORM_INFO
Definition:
msr.h:48
MSR::Read
u64 Read(u64 reg)
Definition:
msr.cpp:130
MSR::UNCORE_PERF_GLOBAL_OVF_CTRL
Definition:
msr.h:53
MSR::Write
void Write(u64 reg, u64 value)
Definition:
msr.cpp:136
MSR::IA32_PMC0
Definition:
msr.h:39
MSR::IA32_PERF_GLOBAL_OVF_CTRL
Definition:
msr.h:45
Generated on Mon Oct 14 2013 00:58:07 for Pyrogenesis by
1.8.5