libmsr
0.3.0
A friendlier interface to accessing MSRs on Intel platforms
Main Page
Related Pages
Classes
Files
File List
File Members
All
Classes
Files
Functions
Variables
Enumerations
Enumerator
Macros
Pages
include
msr_thermal.h
Go to the documentation of this file.
1
/* msr_thermal.h
2
*
3
* Copyright (c) 2011-2016, Lawrence Livermore National Security, LLC.
4
* LLNL-CODE-645430
5
*
6
* Produced at Lawrence Livermore National Laboratory
7
* Written by Barry Rountree, rountree@llnl.gov
8
* Scott Walker, walker91@llnl.gov
9
* Kathleen Shoga, shoga1@llnl.gov
10
*
11
* All rights reserved.
12
*
13
* This file is part of libmsr.
14
*
15
* libmsr is free software: you can redistribute it and/or modify it under the
16
* terms of the GNU Lesser General Public License as published by the Free
17
* Software Foundation, either version 3 of the License, or (at your option)
18
* any later version.
19
*
20
* libmsr is distributed in the hope that it will be useful, but WITHOUT ANY
21
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
22
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
23
* details.
24
*
25
* You should have received a copy of the GNU Lesser General Public License
26
* along with libmsr. If not, see <http://www.gnu.org/licenses/>.
27
*
28
* This material is based upon work supported by the U.S. Department of
29
* Energy's Lawrence Livermore National Laboratory. Office of Science, under
30
* Award number DE-AC52-07NA27344.
31
*
32
*/
33
34
#ifndef MSR_THERMAL_H_INCLUDE
35
#define MSR_THERMAL_H_INCLUDE
36
37
#include <stdio.h>
38
39
#include "
master.h
"
40
41
#ifdef __cplusplus
42
extern
"C"
{
43
#endif
44
49
struct
msr_temp_target
{
51
uint64_t **
raw
;
57
uint64_t *
temp_target
;
58
};
59
63
struct
therm_stat
{
65
uint64_t **
raw
;
73
int
*
status
;
82
int
*
status_log
;
89
int
*
PROCHOT_or_FORCEPR_event
;
99
int
*
PROCHOT_or_FORCEPR_log
;
107
int
*
crit_temp_status
;
115
int
*
crit_temp_log
;
123
int
*
therm_thresh1_status
;
131
int
*
therm_thresh1_log
;
139
int
*
therm_thresh2_status
;
147
int
*
therm_thresh2_log
;
155
int
*
power_limit_status
;
165
int
*
power_notification_log
;
170
int
*
readout
;
175
int
*
resolution_deg_celsius
;
180
int
*
readout_valid
;
181
};
182
186
struct
therm_interrupt
{
188
uint64_t **
raw
;
194
int
*
high_temp_enable
;
200
int
*
low_temp_enable
;
207
int
*
PROCHOT_enable
;
213
int
*
FORCEPR_enable
;
219
int
*
crit_temp_enable
;
228
int
*
thresh1_val
;
234
int
*
thresh1_enable
;
243
int
*
thresh2_val
;
249
int
*
thresh2_enable
;
257
int
*
pwr_limit_notification_enable
;
258
};
259
263
struct
pkg_therm_stat
{
265
uint64_t **
raw
;
273
int
*
status
;
283
int
*
status_log
;
290
int
*
PROCHOT_event
;
298
int
*
PROCHOT_log
;
306
int
*
crit_temp_status
;
314
int
*
crit_temp_log
;
322
int
*
therm_thresh1_status
;
330
int
*
therm_thresh1_log
;
338
int
*
therm_thresh2_status
;
346
int
*
therm_thresh2_log
;
354
int
*
power_limit_status
;
//Read only
365
int
*
power_notification_log
;
370
int
*
readout
;
371
};
372
376
struct
pkg_therm_interrupt
{
378
uint64_t **
raw
;
384
int
*
high_temp_enable
;
390
int
*
low_temp_enable
;
397
int
*
PROCHOT_enable
;
403
int
*
crit_temp_enable
;
412
int
*
thresh1_val
;
418
int
*
thresh1_enable
;
427
int
*
thresh2_val
;
433
int
*
thresh2_enable
;
441
int
*
pwr_limit_notification_enable
;
442
};
443
447
void
store_temp_target
(
struct
msr_temp_target
**tt);
448
452
void
store_therm_stat
(
struct
therm_stat
**ts);
453
457
void
store_therm_interrupt
(
struct
therm_interrupt
**ti);
458
462
void
store_pkg_therm_stat
(
struct
pkg_therm_stat
**ps);
463
467
void
store_pkg_therm_interrupt
(
struct
pkg_therm_interrupt
**pi);
468
471
void
is_init
(
void
);
472
473
/************************************/
474
/* MSR_TEMPERATURE_TARGET Functions */
475
/************************************/
476
481
void
get_temp_target
(
struct
msr_temp_target
*s);
482
483
/*********************************************/
484
/* Thermal Functions (Status and Interrupts) */
485
/*********************************************/
486
491
void
get_therm_stat
(
struct
therm_stat
*s);
492
497
void
get_therm_interrupt
(
struct
therm_interrupt
*s);
498
503
void
get_pkg_therm_stat
(
struct
pkg_therm_stat
*s);
504
509
void
get_pkg_therm_interrupt
(
struct
pkg_therm_interrupt
*s);
510
516
int
therm2_ctl_storage
(uint64_t **thermctlref);
517
521
int
get_pkg_therm2_ctl
(
void
);
522
529
int
dump_therm2_ctl
(FILE *writedest);
530
534
void
set_therm_stat
(
struct
therm_stat
*s);
535
539
void
set_therm_interrupt
(
struct
therm_interrupt
*s);
540
544
void
set_pkg_therm_stat
(
struct
pkg_therm_stat
*s);
545
549
void
set_pkg_therm_interrupt
(
struct
pkg_therm_interrupt
*s);
550
555
void
dump_therm_data_terse_label
(FILE *writedest);
556
560
void
dump_therm_data_terse
(FILE *writedest);
561
566
void
dump_therm_data_verbose_label
(FILE *writedest);
567
571
void
dump_therm_temp_reading
(FILE *writedest);
572
576
void
dump_therm_data_verbose
(FILE *writedest);
577
578
#ifdef __cplusplus
579
}
580
#endif
581
#endif
Generated by
1.8.2