diff options
author | Len Brown <len.brown@intel.com> | 2011-03-30 23:52:29 -0400 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2011-08-03 19:06:36 -0400 |
commit | 4bfc8288bc4a64529c5547d17349a2a1f4675507 (patch) | |
tree | b7c89fc03fe4cfad612e15554b2095426415b177 /arch/x86 | |
parent | d91ee5863b71e8c90eaf6035bff3078a85e2e7b5 (diff) |
x86 idle: move mwait_idle_with_hints() to where it is used
...and make it static
no functional change
cc: x86@kernel.org
Acked-by: H. Peter Anvin <hpa@linux.intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'arch/x86')
-rw-r--r-- | arch/x86/include/asm/processor.h | 2 | ||||
-rw-r--r-- | arch/x86/kernel/acpi/cstate.c | 23 | ||||
-rw-r--r-- | arch/x86/kernel/process.c | 23 |
3 files changed, 23 insertions, 25 deletions
diff --git a/arch/x86/include/asm/processor.h b/arch/x86/include/asm/processor.h index 219371546afd..0d1171c97729 100644 --- a/arch/x86/include/asm/processor.h +++ b/arch/x86/include/asm/processor.h | |||
@@ -751,8 +751,6 @@ static inline void __sti_mwait(unsigned long eax, unsigned long ecx) | |||
751 | :: "a" (eax), "c" (ecx)); | 751 | :: "a" (eax), "c" (ecx)); |
752 | } | 752 | } |
753 | 753 | ||
754 | extern void mwait_idle_with_hints(unsigned long eax, unsigned long ecx); | ||
755 | |||
756 | extern void select_idle_routine(const struct cpuinfo_x86 *c); | 754 | extern void select_idle_routine(const struct cpuinfo_x86 *c); |
757 | extern void init_amd_e400_c1e_mask(void); | 755 | extern void init_amd_e400_c1e_mask(void); |
758 | 756 | ||
diff --git a/arch/x86/kernel/acpi/cstate.c b/arch/x86/kernel/acpi/cstate.c index 5812404a0d4c..f50e7fb2a201 100644 --- a/arch/x86/kernel/acpi/cstate.c +++ b/arch/x86/kernel/acpi/cstate.c | |||
@@ -149,6 +149,29 @@ int acpi_processor_ffh_cstate_probe(unsigned int cpu, | |||
149 | } | 149 | } |
150 | EXPORT_SYMBOL_GPL(acpi_processor_ffh_cstate_probe); | 150 | EXPORT_SYMBOL_GPL(acpi_processor_ffh_cstate_probe); |
151 | 151 | ||
152 | /* | ||
153 | * This uses new MONITOR/MWAIT instructions on P4 processors with PNI, | ||
154 | * which can obviate IPI to trigger checking of need_resched. | ||
155 | * We execute MONITOR against need_resched and enter optimized wait state | ||
156 | * through MWAIT. Whenever someone changes need_resched, we would be woken | ||
157 | * up from MWAIT (without an IPI). | ||
158 | * | ||
159 | * New with Core Duo processors, MWAIT can take some hints based on CPU | ||
160 | * capability. | ||
161 | */ | ||
162 | void mwait_idle_with_hints(unsigned long ax, unsigned long cx) | ||
163 | { | ||
164 | if (!need_resched()) { | ||
165 | if (this_cpu_has(X86_FEATURE_CLFLUSH_MONITOR)) | ||
166 | clflush((void *)¤t_thread_info()->flags); | ||
167 | |||
168 | __monitor((void *)¤t_thread_info()->flags, 0, 0); | ||
169 | smp_mb(); | ||
170 | if (!need_resched()) | ||
171 | __mwait(ax, cx); | ||
172 | } | ||
173 | } | ||
174 | |||
152 | void acpi_processor_ffh_cstate_enter(struct acpi_processor_cx *cx) | 175 | void acpi_processor_ffh_cstate_enter(struct acpi_processor_cx *cx) |
153 | { | 176 | { |
154 | unsigned int cpu = smp_processor_id(); | 177 | unsigned int cpu = smp_processor_id(); |
diff --git a/arch/x86/kernel/process.c b/arch/x86/kernel/process.c index e1ba8cb24e4e..e7e3b019c439 100644 --- a/arch/x86/kernel/process.c +++ b/arch/x86/kernel/process.c | |||
@@ -438,29 +438,6 @@ void cpu_idle_wait(void) | |||
438 | } | 438 | } |
439 | EXPORT_SYMBOL_GPL(cpu_idle_wait); | 439 | EXPORT_SYMBOL_GPL(cpu_idle_wait); |
440 | 440 | ||
441 | /* | ||
442 | * This uses new MONITOR/MWAIT instructions on P4 processors with PNI, | ||
443 | * which can obviate IPI to trigger checking of need_resched. | ||
444 | * We execute MONITOR against need_resched and enter optimized wait state | ||
445 | * through MWAIT. Whenever someone changes need_resched, we would be woken | ||
446 | * up from MWAIT (without an IPI). | ||
447 | * | ||
448 | * New with Core Duo processors, MWAIT can take some hints based on CPU | ||
449 | * capability. | ||
450 | */ | ||
451 | void mwait_idle_with_hints(unsigned long ax, unsigned long cx) | ||
452 | { | ||
453 | if (!need_resched()) { | ||
454 | if (this_cpu_has(X86_FEATURE_CLFLUSH_MONITOR)) | ||
455 | clflush((void *)¤t_thread_info()->flags); | ||
456 | |||
457 | __monitor((void *)¤t_thread_info()->flags, 0, 0); | ||
458 | smp_mb(); | ||
459 | if (!need_resched()) | ||
460 | __mwait(ax, cx); | ||
461 | } | ||
462 | } | ||
463 | |||
464 | /* Default MONITOR/MWAIT with no hints, used for default C1 state */ | 441 | /* Default MONITOR/MWAIT with no hints, used for default C1 state */ |
465 | static void mwait_idle(void) | 442 | static void mwait_idle(void) |
466 | { | 443 | { |