#include <linux/bitfield.h>
#include <linux/cleanup.h>
#include <linux/cpuhotplug.h>
#include <linux/cpumask.h>
#include <linux/errno.h>
#include <linux/export.h>
#include <linux/hashtable.h>
#include <linux/module.h>
#include <linux/mutex.h>
#include <linux/overflow.h>
#include <linux/slab.h>
#include <linux/topology.h>
#include <linux/types.h>
#include <asm/cpu_device_id.h>
#include <asm/intel-family.h>
#include <asm/msr.h>
#include "tpmi_power_domains.h"
#define MSR_PM_LOGICAL_ID …
#define LP_ID_MASK …
#define MODULE_ID_MASK …
#define PM_DOMAIN_ID_MASK …
struct tpmi_cpu_info { … };
static DEFINE_PER_CPU(struct tpmi_cpu_info, tpmi_cpu_info);
static enum cpuhp_state tpmi_hp_state __read_mostly;
#define MAX_POWER_DOMAINS …
static cpumask_t *tpmi_power_domain_mask;
static DEFINE_MUTEX(tpmi_lock);
static const struct x86_cpu_id tpmi_cpu_ids[] = …;
MODULE_DEVICE_TABLE(x86cpu, tpmi_cpu_ids);
static DECLARE_HASHTABLE(tpmi_cpu_hash, 8);
static bool tpmi_domain_is_valid(struct tpmi_cpu_info *info)
{ … }
int tpmi_get_linux_cpu_number(int package_id, int domain_id, int punit_core_id)
{ … }
EXPORT_SYMBOL_NS_GPL(…);
int tpmi_get_punit_core_number(int cpu_no)
{ … }
EXPORT_SYMBOL_NS_GPL(…);
int tpmi_get_power_domain_id(int cpu_no)
{ … }
EXPORT_SYMBOL_NS_GPL(…);
cpumask_t *tpmi_get_power_domain_mask(int cpu_no)
{ … }
EXPORT_SYMBOL_NS_GPL(…);
static int tpmi_get_logical_id(unsigned int cpu, struct tpmi_cpu_info *info)
{ … }
static int tpmi_cpu_online(unsigned int cpu)
{ … }
static int __init tpmi_init(void)
{ … }
module_init(…) …
static void __exit tpmi_exit(void)
{ … }
module_exit(…)
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;