#define pr_fmt(fmt) …
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/smp.h>
#include <linux/sched.h>
#include <linux/cpufreq.h>
#include <linux/compiler.h>
#include <linux/dmi.h>
#include <linux/slab.h>
#include <linux/string_helpers.h>
#include <linux/platform_device.h>
#include <linux/acpi.h>
#include <linux/io.h>
#include <linux/delay.h>
#include <linux/uaccess.h>
#include <acpi/processor.h>
#include <acpi/cppc_acpi.h>
#include <asm/msr.h>
#include <asm/processor.h>
#include <asm/cpufeature.h>
#include <asm/cpu_device_id.h>
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;
enum { … };
#define INTEL_MSR_RANGE …
#define AMD_MSR_RANGE …
#define HYGON_MSR_RANGE …
struct acpi_cpufreq_data { … };
static struct acpi_processor_performance __percpu *acpi_perf_data;
static inline struct acpi_processor_performance *to_perf_data(struct acpi_cpufreq_data *data)
{ … }
static struct cpufreq_driver acpi_cpufreq_driver;
static unsigned int acpi_pstate_strict;
static bool boost_state(unsigned int cpu)
{ … }
static int boost_set_msr(bool enable)
{ … }
static void boost_set_msr_each(void *p_en)
{ … }
static int set_boost(struct cpufreq_policy *policy, int val)
{ … }
static ssize_t show_freqdomain_cpus(struct cpufreq_policy *policy, char *buf)
{ … }
cpufreq_freq_attr_ro(…);
#ifdef CONFIG_X86_ACPI_CPUFREQ_CPB
static ssize_t store_cpb(struct cpufreq_policy *policy, const char *buf,
size_t count)
{ … }
static ssize_t show_cpb(struct cpufreq_policy *policy, char *buf)
{ … }
cpufreq_freq_attr_rw(…);
#endif
static int check_est_cpu(unsigned int cpuid)
{ … }
static int check_amd_hwpstate_cpu(unsigned int cpuid)
{ … }
static unsigned extract_io(struct cpufreq_policy *policy, u32 value)
{ … }
static unsigned extract_msr(struct cpufreq_policy *policy, u32 msr)
{ … }
static unsigned extract_freq(struct cpufreq_policy *policy, u32 val)
{ … }
static u32 cpu_freq_read_intel(struct acpi_pct_register *not_used)
{ … }
static void cpu_freq_write_intel(struct acpi_pct_register *not_used, u32 val)
{ … }
static u32 cpu_freq_read_amd(struct acpi_pct_register *not_used)
{ … }
static void cpu_freq_write_amd(struct acpi_pct_register *not_used, u32 val)
{ … }
static u32 cpu_freq_read_io(struct acpi_pct_register *reg)
{ … }
static void cpu_freq_write_io(struct acpi_pct_register *reg, u32 val)
{ … }
struct drv_cmd { … };
static void do_drv_read(void *_cmd)
{ … }
static u32 drv_read(struct acpi_cpufreq_data *data, const struct cpumask *mask)
{ … }
static void do_drv_write(void *_cmd)
{ … }
static void drv_write(struct acpi_cpufreq_data *data,
const struct cpumask *mask, u32 val)
{ … }
static u32 get_cur_val(const struct cpumask *mask, struct acpi_cpufreq_data *data)
{ … }
static unsigned int get_cur_freq_on_cpu(unsigned int cpu)
{ … }
static unsigned int check_freqs(struct cpufreq_policy *policy,
const struct cpumask *mask, unsigned int freq)
{ … }
static int acpi_cpufreq_target(struct cpufreq_policy *policy,
unsigned int index)
{ … }
static unsigned int acpi_cpufreq_fast_switch(struct cpufreq_policy *policy,
unsigned int target_freq)
{ … }
static unsigned long
acpi_cpufreq_guess_freq(struct acpi_cpufreq_data *data, unsigned int cpu)
{ … }
static void free_acpi_perf_data(void)
{ … }
static int cpufreq_boost_down_prep(unsigned int cpu)
{ … }
static int __init acpi_cpufreq_early_init(void)
{ … }
#ifdef CONFIG_SMP
static int bios_with_sw_any_bug;
static int sw_any_bug_found(const struct dmi_system_id *d)
{ … }
static const struct dmi_system_id sw_any_bug_dmi_table[] = …;
static int acpi_cpufreq_blacklist(struct cpuinfo_x86 *c)
{ … }
#endif
#ifdef CONFIG_ACPI_CPPC_LIB
static u64 get_max_boost_ratio(unsigned int cpu)
{ … }
#else
static inline u64 get_max_boost_ratio(unsigned int cpu) { return 0; }
#endif
static int acpi_cpufreq_cpu_init(struct cpufreq_policy *policy)
{ … }
static void acpi_cpufreq_cpu_exit(struct cpufreq_policy *policy)
{ … }
static int acpi_cpufreq_resume(struct cpufreq_policy *policy)
{ … }
static struct freq_attr *acpi_cpufreq_attr[] = …;
static struct cpufreq_driver acpi_cpufreq_driver = …;
static void __init acpi_cpufreq_boost_init(void)
{ … }
static int __init acpi_cpufreq_probe(struct platform_device *pdev)
{ … }
static void acpi_cpufreq_remove(struct platform_device *pdev)
{ … }
static struct platform_driver acpi_cpufreq_platdrv = …;
static int __init acpi_cpufreq_init(void)
{ … }
static void __exit acpi_cpufreq_exit(void)
{ … }
module_param(acpi_pstate_strict, uint, 0644);
MODULE_PARM_DESC(…) …;
late_initcall(acpi_cpufreq_init);
module_exit(acpi_cpufreq_exit);
MODULE_ALIAS(…) …;