linux/drivers/hwmon/coretemp.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * coretemp.c - Linux kernel module for hardware monitoring
 *
 * Copyright (C) 2007 Rudolf Marek <[email protected]>
 *
 * Inspired from many hwmon drivers
 */

#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

/*
 * force_tjmax only matters when TjMax can't be read from the CPU itself.
 * When set, it replaces the driver's suboptimal heuristic.
 */
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

/*
 * Per-Core Temperature Data
 * @tjmax: The static tjmax value when tjmax cannot be retrieved from
 *		IA32_TEMPERATURE_TARGET MSR.
 * @last_updated: The time when the current temperature value was updated
 *		earlier (in jiffies).
 * @cpu_core_id: The CPU Core from which temperature values should be read
 *		This value is passed as "id" field to rdmsr/wrmsr functions.
 * @status_reg: One of IA32_THERM_STATUS or IA32_PACKAGE_THERM_STATUS,
 *		from where the temperature values should be read.
 * @attr_size:  Total number of pre-core attrs displayed in the sysfs.
 */
struct temp_data {};

/* Platform Data per Physical CPU */
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)
{}

/* Keep track of how many zone pointers we allocated in init() */
static int max_zones __read_mostly;
/* Array of zone pointers. Serialized by cpu hotplug lock */
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();