| 1234567891011121314151617181920212223242526272829303132 |
- /* CPU temperature sources: Intel DTS and AMD family 15h D18F3xA4. */
- #ifndef THERMAL_H
- #define THERMAL_H
- /* Probe once on the BSP (before the timer starts); logs the result to COM1. */
- void thermal_init(void);
- /* Sample this CPU's DTS. Called from the per-CPU scheduler tick, at most
- * once per second. The AMD package sensor is sampled from the kworker
- * instead (under the BKL; PCI config space is not safe to touch from a
- * timer interrupt on multiple CPUs). */
- void thermal_tick(void);
- /* Once-a-second AMD package sensor poll; called from system_housekeeping()
- * under the BKL. A no-op on Intel and when no sensor was found. */
- void thermal_housekeeping(void);
- /* Read this CPU's temperature now: degrees C, or -1 when unavailable.
- * On AMD this reads the package sensor, so all CPUs report the same value. */
- int thermal_read_this_cpu(void);
- /* Read this CPU's raw IA32_THERM_STATUS (Intel only): 0 on success, -1 when
- * unavailable. */
- int thermal_status_this_cpu(unsigned int *status);
- /* Hottest per-CPU reading cached by the ticks, or -1 when unavailable. */
- int thermal_max_c(void);
- /* TjMax used for the conversion, or 0 when DTS is unavailable. */
- int thermal_tjmax(void);
- #endif
|