#define pr_fmt(fmt) …
#include <linux/module.h>
#include <linux/init.h>
#include <linux/slab.h>
#include <linux/jiffies.h>
#include <linux/hwmon.h>
#include <linux/sysfs.h>
#include <linux/hwmon-sysfs.h>
#include <linux/err.h>
#include <linux/mutex.h>
#include <linux/list.h>
#include <linux/platform_device.h>
#include <linux/cpu.h>
#include <linux/smp.h>
#include <linux/moduleparam.h>
#include <linux/pci.h>
#include <asm/msr.h>
#include <asm/processor.h>
#include <asm/cpu_device_id.h>
#include <linux/sched/isolation.h>
#define DRVNAME …
static int force_tjmax;
module_param_named(tjmax, force_tjmax, int, 0444);
MODULE_PARM_DESC(…) …;
#define NUM_REAL_CORES …
#define CORETEMP_NAME_LENGTH …
enum coretemp_attr_index { … };
#ifdef CONFIG_SMP
#define for_each_sibling(i, cpu) …
#else
#define for_each_sibling …
#endif
struct temp_data { … };
struct platform_data { … };
struct tjmax_pci { … };
static const struct tjmax_pci tjmax_pci_table[] = …;
struct tjmax { … };
static const struct tjmax tjmax_table[] = …;
struct tjmax_model { … };
#define ANY …
static const struct tjmax_model tjmax_model_table[] = …;
static bool is_pkg_temp_data(struct temp_data *tdata)
{ … }
static int adjust_tjmax(struct cpuinfo_x86 *c, u32 id, struct device *dev)
{ … }
static bool cpu_has_tjmax(struct cpuinfo_x86 *c)
{ … }
static int get_tjmax(struct temp_data *tdata, struct device *dev)
{ … }
static int get_ttarget(struct temp_data *tdata, struct device *dev)
{ … }
static int max_zones __read_mostly;
static struct platform_device **zone_devices;
static ssize_t show_label(struct device *dev,
struct device_attribute *devattr, char *buf)
{ … }
static ssize_t show_crit_alarm(struct device *dev,
struct device_attribute *devattr, char *buf)
{ … }
static ssize_t show_tjmax(struct device *dev,
struct device_attribute *devattr, char *buf)
{ … }
static ssize_t show_ttarget(struct device *dev,
struct device_attribute *devattr, char *buf)
{ … }
static ssize_t show_temp(struct device *dev,
struct device_attribute *devattr, char *buf)
{ … }
static int create_core_attrs(struct temp_data *tdata, struct device *dev)
{ … }
static int chk_ucode_version(unsigned int cpu)
{ … }
static struct platform_device *coretemp_get_pdev(unsigned int cpu)
{ … }
static struct temp_data *
init_temp_data(struct platform_data *pdata, unsigned int cpu, int pkg_flag)
{ … }
static void destroy_temp_data(struct platform_data *pdata, struct temp_data *tdata)
{ … }
static struct temp_data *get_temp_data(struct platform_data *pdata, int cpu)
{ … }
static int create_core_data(struct platform_device *pdev, unsigned int cpu,
int pkg_flag)
{ … }
static void
coretemp_add_core(struct platform_device *pdev, unsigned int cpu, int pkg_flag)
{ … }
static void coretemp_remove_core(struct platform_data *pdata, struct temp_data *tdata)
{ … }
static int coretemp_device_add(int zoneid)
{ … }
static void coretemp_device_remove(int zoneid)
{ … }
static int coretemp_cpu_online(unsigned int cpu)
{ … }
static int coretemp_cpu_offline(unsigned int cpu)
{ … }
static const struct x86_cpu_id __initconst coretemp_ids[] = …;
MODULE_DEVICE_TABLE(x86cpu, coretemp_ids);
static enum cpuhp_state coretemp_hp_online;
static int __init coretemp_init(void)
{ … }
module_init(…) …
static void __exit coretemp_exit(void)
{ … }
module_exit(…)
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;