#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/slab.h>
#include <linux/platform_device.h>
#include <linux/acpi.h>
#include <linux/io.h>
#include <linux/spinlock.h>
#include <linux/uaccess.h>
#include <acpi/processor.h>
#define PCC_VERSION …
#define POLL_LOOPS …
#define CMD_COMPLETE …
#define CMD_GET_FREQ …
#define CMD_SET_FREQ …
#define BUF_SZ …
struct pcc_register_resource { … } __attribute__ ((packed));
struct pcc_memory_resource { … } __attribute__ ((packed));
static struct cpufreq_driver pcc_cpufreq_driver;
struct pcc_header { … };
static void __iomem *pcch_virt_addr;
static struct pcc_header __iomem *pcch_hdr;
static DEFINE_SPINLOCK(pcc_lock);
static struct acpi_generic_address doorbell;
static u64 doorbell_preserve;
static u64 doorbell_write;
static u8 OSC_UUID[16] = …;
struct pcc_cpu { … };
static struct pcc_cpu __percpu *pcc_cpu_info;
static int pcc_cpufreq_verify(struct cpufreq_policy_data *policy)
{ … }
static inline void pcc_cmd(void)
{ … }
static inline void pcc_clear_mapping(void)
{ … }
static unsigned int pcc_get_freq(unsigned int cpu)
{ … }
static int pcc_cpufreq_target(struct cpufreq_policy *policy,
unsigned int target_freq,
unsigned int relation)
{ … }
static int pcc_get_offset(int cpu)
{ … }
static int __init pcc_cpufreq_do_osc(acpi_handle *handle)
{ … }
static int __init pcc_cpufreq_evaluate(void)
{ … }
static int pcc_cpufreq_cpu_init(struct cpufreq_policy *policy)
{ … }
static struct cpufreq_driver pcc_cpufreq_driver = …;
static int __init pcc_cpufreq_probe(struct platform_device *pdev)
{ … }
static void pcc_cpufreq_remove(struct platform_device *pdev)
{ … }
static struct platform_driver pcc_cpufreq_platdrv = …;
static int __init pcc_cpufreq_init(void)
{ … }
static void __exit pcc_cpufreq_exit(void)
{ … }
MODULE_ALIAS(…) …;
MODULE_AUTHOR(…) …;
MODULE_VERSION(…);
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;
late_initcall(pcc_cpufreq_init);
module_exit(pcc_cpufreq_exit);