#include <linux/interrupt.h>
#include <linux/notifier.h>
#include <linux/jiffies.h>
#include <linux/kernel.h>
#include <linux/percpu.h>
#include <linux/export.h>
#include <linux/types.h>
#include <linux/init.h>
#include <linux/smp.h>
#include <linux/cpu.h>
#include <asm/processor.h>
#include <asm/thermal.h>
#include <asm/traps.h>
#include <asm/apic.h>
#include <asm/irq.h>
#include <asm/msr.h>
#include "intel_hfi.h"
#include "thermal_interrupt.h"
#define CHECK_INTERVAL …
#define THERMAL_THROTTLING_EVENT …
#define POWER_LIMIT_EVENT …
struct _thermal_state { … };
struct thermal_state { … };
int (*platform_thermal_notify)(__u64 msr_val);
EXPORT_SYMBOL(…);
int (*platform_thermal_package_notify)(__u64 msr_val);
EXPORT_SYMBOL_GPL(…);
bool (*platform_thermal_package_rate_control)(void);
EXPORT_SYMBOL_GPL(…);
static DEFINE_PER_CPU(struct thermal_state, thermal_state);
static atomic_t therm_throt_en = …;
static u32 lvtthmr_init __read_mostly;
#ifdef CONFIG_SYSFS
#define define_therm_throt_device_one_ro(_name) … \
#define define_therm_throt_device_show_func(event, name) …
define_therm_throt_device_show_func(core_throttle, count);
define_therm_throt_device_one_ro(…);
define_therm_throt_device_show_func(core_power_limit, count);
define_therm_throt_device_one_ro(…);
define_therm_throt_device_show_func(package_throttle, count);
define_therm_throt_device_one_ro(…);
define_therm_throt_device_show_func(package_power_limit, count);
define_therm_throt_device_one_ro(…);
define_therm_throt_device_show_func(core_throttle, max_time_ms);
define_therm_throt_device_one_ro(…);
define_therm_throt_device_show_func(package_throttle, max_time_ms);
define_therm_throt_device_one_ro(…);
define_therm_throt_device_show_func(core_throttle, total_time_ms);
define_therm_throt_device_one_ro(…);
define_therm_throt_device_show_func(package_throttle, total_time_ms);
define_therm_throt_device_one_ro(…);
static struct attribute *thermal_throttle_attrs[] = …;
static const struct attribute_group thermal_attr_group = …;
#endif
#define THERM_THROT_POLL_INTERVAL …
#define THERM_STATUS_PROCHOT_LOG …
static u64 therm_intr_core_clear_mask;
static u64 therm_intr_pkg_clear_mask;
static void thermal_intr_init_core_clear_mask(void)
{ … }
static void thermal_intr_init_pkg_clear_mask(void)
{ … }
void thermal_clear_package_intr_status(int level, u64 bit_mask)
{ … }
EXPORT_SYMBOL_GPL(…);
static void get_therm_status(int level, bool *proc_hot, u8 *temp)
{ … }
static void __maybe_unused throttle_active_work(struct work_struct *work)
{ … }
static void therm_throt_process(bool new_event, int event, int level)
{ … }
static int thresh_event_valid(int level, int event)
{ … }
static bool int_pln_enable;
static int __init int_pln_enable_setup(char *s)
{ … }
__setup(…);
#ifdef CONFIG_SYSFS
static int thermal_throttle_add_dev(struct device *dev, unsigned int cpu)
{ … }
static void thermal_throttle_remove_dev(struct device *dev)
{ … }
static int thermal_throttle_online(unsigned int cpu)
{ … }
static int thermal_throttle_offline(unsigned int cpu)
{ … }
static __init int thermal_throttle_init_device(void)
{ … }
device_initcall(thermal_throttle_init_device);
#endif
static void notify_package_thresholds(__u64 msr_val)
{ … }
static void notify_thresholds(__u64 msr_val)
{ … }
void __weak notify_hwp_interrupt(void)
{ … }
void intel_thermal_interrupt(void)
{ … }
static int intel_thermal_supported(struct cpuinfo_x86 *c)
{ … }
bool x86_thermal_enabled(void)
{ … }
void __init therm_lvt_init(void)
{ … }
void intel_init_thermal(struct cpuinfo_x86 *c)
{ … }