libmsr  0.3.0
A friendlier interface to accessing MSRs on Intel platforms
 All Classes Files Functions Variables Enumerations Enumerator Macros Pages
Functions
msr_thermal.c File Reference
#include <stddef.h>
#include <stdio.h>
#include <stdint.h>
#include <sys/time.h>
#include "msr_core.h"
#include "memhdlr.h"
#include "msr_thermal.h"
#include "cpuid.h"
#include "libmsr_debug.h"
Include dependency graph for msr_thermal.c:

Functions

void store_temp_target (struct msr_temp_target **tt)
 Store the target temperature data on the heap.
 
void store_therm_stat (struct therm_stat **ts)
 Store the per-core thermal status data on the heap.
 
void store_therm_interrupt (struct therm_interrupt **ti)
 Store the per-core thermal interrupt data on the heap.
 
void store_pkg_therm_stat (struct pkg_therm_stat **ps)
 Store the package-level thermal status data on the heap.
 
void store_pkg_therm_interrupt (struct pkg_therm_interrupt **pi)
 Store the package-level thermal interrupt data on the heap.
 
void is_init (void)
 Initialize temperature target data – store variable on the heap and read current temperature target.
 
void get_temp_target (struct msr_temp_target *s)
 Retrieve current minimum temperature (in degree Celsius) at which PROCHOT will be asserted.
 
void get_therm_stat (struct therm_stat *s)
 Read value of the IA32_THERM_STATUS register and translate bit fields to human-readable values.
 
void get_therm_interrupt (struct therm_interrupt *s)
 Read value of the IA32_THERM_INTERRUPT register and translate bit fields to human-readable values.
 
void get_pkg_therm_stat (struct pkg_therm_stat *s)
 Read value of the IA32_PACKAGE_THERM_STATUS register and translate bit fields to human-readable values.
 
void get_pkg_therm_interrupt (struct pkg_therm_interrupt *s)
 Read value of the IA32_PACKAGE_THERM_INTERRUPT register and translate bit fields to human-readable values.
 
int therm2_ctl_storage (uint64_t **thermctlref)
 Store the package-level thermal control data on the heap.
 
int get_pkg_therm2_ctl (void)
 Read value of the MSR_THERM2_CTL register.
 
int dump_therm2_ctl (FILE *writedest)
 Print out control settings for Thermal Monitor #2.
 
void set_therm_stat (struct therm_stat *s)
 Set value for IA32_THERM_STATUS across all cores.
 
void set_therm_interrupt (struct therm_interrupt *s)
 Set value for IA32_THERM_INTERRUPT across all cores.
 
void set_pkg_therm_stat (struct pkg_therm_stat *s)
 Set value for IA32_PACKAGE_THERM_STATUS across all sockets.
 
void set_pkg_therm_interrupt (struct pkg_therm_interrupt *s)
 Set value for IA32_PACKAGE_THERM_INTERRUPT across all sockets.
 
void dump_therm_data_terse_label (FILE *writedest)
 Print the label for the abbreviated thermal status and interrupt data printout.
 
void dump_therm_data_terse (FILE *writedest)
 Print abbreviated thermal status and interrupt data.
 
void dump_therm_data_verbose_label (FILE *writedest)
 Print the label for the detailed thermal status and interrupt data printout.
 
void dump_therm_temp_reading (FILE *writedest)
 Print only temperature data.
 
void dump_therm_data_verbose (FILE *writedest)
 Print detailed thermal status and interrupt data.
 

Function Documentation

int dump_therm2_ctl ( FILE *  writedest)

Print out control settings for Thermal Monitor #2.

Parameters
[in]writedestFile stream where output will be written to.
Returns
0 if successful, else return a value less than 0 if therm2_ctl_storage() fails.
void dump_therm_data_terse ( FILE *  writedest)

Print abbreviated thermal status and interrupt data.

Parameters
[in]writedestFile stream where output will be written to.
void dump_therm_data_terse_label ( FILE *  writedest)

Print the label for the abbreviated thermal status and interrupt data printout.

Parameters
[in]writedestFile stream where output will be written to.
void dump_therm_data_verbose ( FILE *  writedest)

Print detailed thermal status and interrupt data.

Parameters
[in]writedestFile stream where output will be written to.
void dump_therm_data_verbose_label ( FILE *  writedest)

Print the label for the detailed thermal status and interrupt data printout.

Parameters
[in]writedestFile stream where output will be written to.
void dump_therm_temp_reading ( FILE *  writedest)

Print only temperature data.

Parameters
[in]writedestFile stream where output will be written to.
int get_pkg_therm2_ctl ( void  )

Read value of the MSR_THERM2_CTL register.

Returns
0 if successful, else 1 if read_msr_by_coord() fails.
void get_pkg_therm_interrupt ( struct pkg_therm_interrupt s)

Read value of the IA32_PACKAGE_THERM_INTERRUPT register and translate bit fields to human-readable values.

Parameters
[out]sData for package-level thermal interrupts.
void get_pkg_therm_stat ( struct pkg_therm_stat s)

Read value of the IA32_PACKAGE_THERM_STATUS register and translate bit fields to human-readable values.

Parameters
[out]sData for package-level thermal status.
void get_temp_target ( struct msr_temp_target s)

Retrieve current minimum temperature (in degree Celsius) at which PROCHOT will be asserted.

Parameters
[out]sData for target temperature.
void get_therm_interrupt ( struct therm_interrupt s)

Read value of the IA32_THERM_INTERRUPT register and translate bit fields to human-readable values.

Parameters
[out]sData for per-core thermal interrupts.
void get_therm_stat ( struct therm_stat s)

Read value of the IA32_THERM_STATUS register and translate bit fields to human-readable values.

Parameters
[out]sData for per-core thermal status.
void is_init ( void  )

Initialize temperature target data – store variable on the heap and read current temperature target.

void set_pkg_therm_interrupt ( struct pkg_therm_interrupt s)

Set value for IA32_PACKAGE_THERM_INTERRUPT across all sockets.

Parameters
[in]sData for package-level thermal interrupts.
void set_pkg_therm_stat ( struct pkg_therm_stat s)

Set value for IA32_PACKAGE_THERM_STATUS across all sockets.

Parameters
[in]sData for package-level thermal status.
void set_therm_interrupt ( struct therm_interrupt s)

Set value for IA32_THERM_INTERRUPT across all cores.

Parameters
[in]sData for per-core thermal interrupts.
void set_therm_stat ( struct therm_stat s)

Set value for IA32_THERM_STATUS across all cores.

Parameters
[in]sData for per-core thermal status.
void store_pkg_therm_interrupt ( struct pkg_therm_interrupt **  pi)

Store the package-level thermal interrupt data on the heap.

Parameters
[out]piPointer to data for package-level thermal interrupts.
void store_pkg_therm_stat ( struct pkg_therm_stat **  ps)

Store the package-level thermal status data on the heap.

Parameters
[out]psPointer to data for package-level thermal status.
void store_temp_target ( struct msr_temp_target **  tt)

Store the target temperature data on the heap.

Parameters
[out]ttPointer to data for target temperature.
void store_therm_interrupt ( struct therm_interrupt **  ti)

Store the per-core thermal interrupt data on the heap.

Parameters
[out]tiPointer to data for per-core thermal interrupts.
void store_therm_stat ( struct therm_stat **  ts)

Store the per-core thermal status data on the heap.

Parameters
[out]tsPointer to data for per-core thermal status.
int therm2_ctl_storage ( uint64_t **  thermctlref)

Store the package-level thermal control data on the heap.

Parameters
[out]thermctlrefPointer to data for package-level thermal control.
Returns
0 if successful.