diff options
author | Stefano Stabellini <stefano.stabellini@eu.citrix.com> | 2012-01-23 09:38:34 +0000 |
---|---|---|
committer | Stefano Stabellini <stefano.stabellini@eu.citrix.com> | 2012-01-23 09:38:34 +0000 |
commit | 03a4bcf0853d32a431b52b8108e0b1c6c38409c7 (patch) | |
tree | e3cb90d91130d62b8a33b7f91c0aa12c77bc7454 /xen | |
parent | 1c4ee35553ffd7c7dc0bd246bc340b09ec382b17 (diff) | |
download | xen-03a4bcf0853d32a431b52b8108e0b1c6c38409c7.tar.gz xen-03a4bcf0853d32a431b52b8108e0b1c6c38409c7.tar.bz2 xen-03a4bcf0853d32a431b52b8108e0b1c6c38409c7.zip |
Move cpufreq option parsing to cpufreq.c
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
Committed-by: Keir Fraser <keir@xen.org>
Diffstat (limited to 'xen')
-rw-r--r-- | xen/common/domain.c | 35 | ||||
-rw-r--r-- | xen/drivers/cpufreq/cpufreq.c | 31 | ||||
-rw-r--r-- | xen/include/xen/domain.h | 2 |
3 files changed, 35 insertions, 33 deletions
diff --git a/xen/common/domain.c b/xen/common/domain.c index 786ae741d9..8e8a9b23d5 100644 --- a/xen/common/domain.c +++ b/xen/common/domain.c @@ -31,8 +31,8 @@ #include <xen/grant_table.h> #include <xen/xenoprof.h> #include <xen/irq.h> -#include <acpi/cpufreq/cpufreq.h> #include <asm/debugger.h> +#include <asm/processor.h> #include <public/sched.h> #include <public/sysctl.h> #include <public/vcpu.h> @@ -45,40 +45,9 @@ unsigned int xen_processor_pmbits = XEN_PROCESSOR_PM_PX; /* opt_dom0_vcpus_pin: If true, dom0 VCPUs are pinned. */ -static bool_t opt_dom0_vcpus_pin; +bool_t opt_dom0_vcpus_pin; boolean_param("dom0_vcpus_pin", opt_dom0_vcpus_pin); -/* set xen as default cpufreq */ -enum cpufreq_controller cpufreq_controller = FREQCTL_xen; - -static void __init setup_cpufreq_option(char *str) -{ - char *arg; - - if ( !strcmp(str, "dom0-kernel") ) - { - xen_processor_pmbits &= ~XEN_PROCESSOR_PM_PX; - cpufreq_controller = FREQCTL_dom0_kernel; - opt_dom0_vcpus_pin = 1; - return; - } - - if ( !strcmp(str, "none") ) - { - xen_processor_pmbits &= ~XEN_PROCESSOR_PM_PX; - cpufreq_controller = FREQCTL_none; - return; - } - - if ( (arg = strpbrk(str, ",:")) != NULL ) - *arg++ = '\0'; - - if ( !strcmp(str, "xen") ) - if ( arg && *arg ) - cpufreq_cmdline_parse(arg); -} -custom_param("cpufreq", setup_cpufreq_option); - /* Protect updates/reads (resp.) of domain_list and domain_hash. */ DEFINE_SPINLOCK(domlist_update_lock); DEFINE_RCU_READ_LOCK(domlist_read_lock); diff --git a/xen/drivers/cpufreq/cpufreq.c b/xen/drivers/cpufreq/cpufreq.c index c0b0f88a09..b1be8c18ca 100644 --- a/xen/drivers/cpufreq/cpufreq.c +++ b/xen/drivers/cpufreq/cpufreq.c @@ -60,6 +60,37 @@ static LIST_HEAD_READ_MOSTLY(cpufreq_dom_list_head); struct cpufreq_governor *__read_mostly cpufreq_opt_governor; LIST_HEAD_READ_MOSTLY(cpufreq_governor_list); +/* set xen as default cpufreq */ +enum cpufreq_controller cpufreq_controller = FREQCTL_xen; + +static void __init setup_cpufreq_option(char *str) +{ + char *arg; + + if ( !strcmp(str, "dom0-kernel") ) + { + xen_processor_pmbits &= ~XEN_PROCESSOR_PM_PX; + cpufreq_controller = FREQCTL_dom0_kernel; + opt_dom0_vcpus_pin = 1; + return; + } + + if ( !strcmp(str, "none") ) + { + xen_processor_pmbits &= ~XEN_PROCESSOR_PM_PX; + cpufreq_controller = FREQCTL_none; + return; + } + + if ( (arg = strpbrk(str, ",:")) != NULL ) + *arg++ = '\0'; + + if ( !strcmp(str, "xen") ) + if ( arg && *arg ) + cpufreq_cmdline_parse(arg); +} +custom_param("cpufreq", setup_cpufreq_option); + bool_t __read_mostly cpufreq_verbose; struct cpufreq_governor *__find_governor(const char *governor) diff --git a/xen/include/xen/domain.h b/xen/include/xen/domain.h index 7a8436a2ef..eed73f49a9 100644 --- a/xen/include/xen/domain.h +++ b/xen/include/xen/domain.h @@ -83,4 +83,6 @@ int continue_hypercall_on_cpu( extern unsigned int xen_processor_pmbits; +extern bool_t opt_dom0_vcpus_pin; + #endif /* __XEN_DOMAIN_H__ */ |