libmsr  0.3.0
A friendlier interface to accessing MSRs on Intel platforms
 All Classes Files Functions Variables Enumerations Enumerator Macros Pages
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 
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;
170  int *readout;
181 };
182 
188  uint64_t **raw;
258 };
259 
265  uint64_t **raw;
273  int *status;
354  int *power_limit_status; //Read only
370  int *readout;
371 };
372 
378  uint64_t **raw;
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 
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 
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 
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