-
Notifications
You must be signed in to change notification settings - Fork 1
/
XWinMSR.h
88 lines (74 loc) · 1.41 KB
/
XWinMSR.h
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
#define _MAX_CPU_ 64
#define SHM_DEVNAME "XWinMSR"
#define SHM_FILENAME "/dev/"SHM_DEVNAME
#define IA32_THERM_STATUS 0x19c
#define MSR_TEMPERATURE_TARGET 0x1a2
#define LOOP_MIN_MS 10
#define LOOP_MAX_MS 500
#define LOOP_DEF_MS 100
typedef struct
{
struct
{
unsigned char Chr[4];
} AX, BX, CX, DX;
} BRAND;
typedef struct
{
union
{
struct
{
unsigned int
StatusBit : 1-0,
StatusLog : 2-1,
PROCHOT : 3-2,
PROCHOTLog : 4-3,
CriticalTemp : 5-4,
CriticalTempLog : 6-5,
Threshold1 : 7-6,
Threshold1Log : 8-7,
Threshold2 : 9-8,
Threshold2Log : 10-9,
PowerLimit : 11-10,
PowerLimitLog : 12-11,
ReservedBits1 : 16-12,
DTS : 23-16,
ReservedBits2 : 27-23,
Resolution : 31-27,
ReadingValid : 32-31;
};
unsigned int Lo : 32-0;
};
unsigned int Hi : 32-0;
} THERM_STATUS;
typedef struct
{
union
{
struct
{
unsigned int
ReservedBits1 : 16-0,
Target : 24-16,
ReservedBits2 : 32-24;
};
unsigned int Lo : 32-0;
};
unsigned int Hi : 32-0;
} TJMAX;
typedef struct
{
unsigned int cpu;
struct task_struct *TID;
int Temp;
TJMAX TjMax;
THERM_STATUS ThermStat;
} CORE;
typedef struct
{
unsigned int CPUCount, msleep;
BRAND Brand;
char BrandString[48+1];
CORE Core[_MAX_CPU_];
} PROC;