/* * linux/drivers/cpufreq/cpufreq.c * * Copyright (C) 2001 Russell King * (C) 2002 - 2003 Dominik Brodowski <linux@brodo.de> * * Oct 2005 - Ashok Raj <ashok.raj@intel.com> * Added handling for CPU hotplug * Feb 2006 - Jacob Shin <jacob.shin@amd.com> * Fix handling for CPU hotplug -- affected CPUs * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. * */#include <linux/config.h>#include <linux/kernel.h>#include <linux/module.h>#include <linux/init.h>#include <linux/notifier.h>#include <linux/cpufreq.h>#include <linux/delay.h>#include <linux/interrupt.h>#include <linux/spinlock.h>#include <linux/device.h>#include <linux/slab.h>#include <linux/cpu.h>#include <linux/completion.h>#include <linux/mutex.h>#define dprintk(msg...) cpufreq_debug_printk(CPUFREQ_DEBUG_CORE,"cpufreq-core", msg)/** * The "cpufreq driver" - the arch- or hardware-dependend low * level driver of CPUFreq support, and its spinlock. This lock * also protects the cpufreq_cpu_data array. */static struct cpufreq_driver *cpufreq_driver;static struct cpufreq_policy *cpufreq_cpu_data[NR_CPUS];staticDEFINE_SPINLOCK(cpufreq_driver_lock);/* internal prototypes */static int__cpufreq_governor(struct cpufreq_policy *policy,unsigned int event);static voidhandle_update(void*data);/** * Two notifier lists: the "policy" list is involved in the * validation process for a new CPU frequency policy; the * "transition" list for kernel code that needs to handle * changes to devices when the CPU clock speed changes. * The mutex locks both lists. */staticBLOCKING_NOTIFIER_HEAD(cpufreq_policy_notifier_list);staticBLOCKING_NOTIFIER