#include <linux/kernel.h>
#include <linux/cpumask.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/types.h>
#include <linux/kthread.h>
#include <uapi/linux/sched/types.h>
#include <linux/freezer.h>
#include <linux/cpu.h>
#include <linux/tick.h>
#include <linux/slab.h>
#include <linux/acpi.h>
#include <linux/perf_event.h>
#include <linux/platform_device.h>
#include <asm/mwait.h>
#include <xen/xen.h>
#define ACPI_PROCESSOR_AGGREGATOR_CLASS …
#define ACPI_PROCESSOR_AGGREGATOR_DEVICE_NAME …
#define ACPI_PROCESSOR_AGGREGATOR_NOTIFY …
#define ACPI_PROCESSOR_AGGREGATOR_STATUS_SUCCESS …
#define ACPI_PROCESSOR_AGGREGATOR_STATUS_NO_ACTION …
static DEFINE_MUTEX(isolated_cpus_lock);
static DEFINE_MUTEX(round_robin_lock);
static unsigned long power_saving_mwait_eax;
static unsigned char tsc_detected_unstable;
static unsigned char tsc_marked_unstable;
static void power_saving_mwait_init(void)
{ … }
static unsigned long cpu_weight[NR_CPUS];
static int tsk_in_cpu[NR_CPUS] = …;
static DECLARE_BITMAP(pad_busy_cpus_bits, NR_CPUS);
static void round_robin_cpu(unsigned int tsk_index)
{ … }
static void exit_round_robin(unsigned int tsk_index)
{ … }
static unsigned int idle_pct = …;
static unsigned int round_robin_time = …;
static int power_saving_thread(void *data)
{ … }
static struct task_struct *ps_tsks[NR_CPUS];
static unsigned int ps_tsk_num;
static int create_power_saving_task(void)
{ … }
static void destroy_power_saving_task(void)
{ … }
static void set_power_saving_task_num(unsigned int num)
{ … }
static void acpi_pad_idle_cpus(unsigned int num_cpus)
{ … }
static uint32_t acpi_pad_idle_cpus_num(void)
{ … }
static ssize_t rrtime_store(struct device *dev,
struct device_attribute *attr, const char *buf, size_t count)
{ … }
static ssize_t rrtime_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static DEVICE_ATTR_RW(rrtime);
static ssize_t idlepct_store(struct device *dev,
struct device_attribute *attr, const char *buf, size_t count)
{ … }
static ssize_t idlepct_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static DEVICE_ATTR_RW(idlepct);
static ssize_t idlecpus_store(struct device *dev,
struct device_attribute *attr, const char *buf, size_t count)
{ … }
static ssize_t idlecpus_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static DEVICE_ATTR_RW(idlecpus);
static struct attribute *acpi_pad_attrs[] = …;
ATTRIBUTE_GROUPS(…);
static int acpi_pad_pur(acpi_handle handle)
{ … }
static void acpi_pad_handle_notify(acpi_handle handle)
{ … }
static void acpi_pad_notify(acpi_handle handle, u32 event,
void *data)
{ … }
static int acpi_pad_probe(struct platform_device *pdev)
{ … }
static void acpi_pad_remove(struct platform_device *pdev)
{ … }
static const struct acpi_device_id pad_device_ids[] = …;
MODULE_DEVICE_TABLE(acpi, pad_device_ids);
static struct platform_driver acpi_pad_driver = …;
static int __init acpi_pad_init(void)
{ … }
static void __exit acpi_pad_exit(void)
{ … }
module_init(…) …;
module_exit(acpi_pad_exit);
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;