diff options
Diffstat (limited to 'arch/x86/kernel')
-rw-r--r-- | arch/x86/kernel/process.c | 24 |
1 files changed, 8 insertions, 16 deletions
diff --git a/arch/x86/kernel/process.c b/arch/x86/kernel/process.c index 09c08a1c706f..7c23a0cd3eb9 100644 --- a/arch/x86/kernel/process.c +++ b/arch/x86/kernel/process.c | |||
@@ -22,11 +22,6 @@ | |||
22 | #include <asm/i387.h> | 22 | #include <asm/i387.h> |
23 | #include <asm/debugreg.h> | 23 | #include <asm/debugreg.h> |
24 | 24 | ||
25 | unsigned long idle_halt; | ||
26 | EXPORT_SYMBOL(idle_halt); | ||
27 | unsigned long idle_nomwait; | ||
28 | EXPORT_SYMBOL(idle_nomwait); | ||
29 | |||
30 | struct kmem_cache *task_xstate_cachep; | 25 | struct kmem_cache *task_xstate_cachep; |
31 | EXPORT_SYMBOL_GPL(task_xstate_cachep); | 26 | EXPORT_SYMBOL_GPL(task_xstate_cachep); |
32 | 27 | ||
@@ -327,7 +322,7 @@ long sys_execve(const char __user *name, | |||
327 | /* | 322 | /* |
328 | * Idle related variables and functions | 323 | * Idle related variables and functions |
329 | */ | 324 | */ |
330 | unsigned long boot_option_idle_override = 0; | 325 | unsigned long boot_option_idle_override = IDLE_NO_OVERRIDE; |
331 | EXPORT_SYMBOL(boot_option_idle_override); | 326 | EXPORT_SYMBOL(boot_option_idle_override); |
332 | 327 | ||
333 | /* | 328 | /* |
@@ -503,7 +498,6 @@ static void poll_idle(void) | |||
503 | * | 498 | * |
504 | * idle=mwait overrides this decision and forces the usage of mwait. | 499 | * idle=mwait overrides this decision and forces the usage of mwait. |
505 | */ | 500 | */ |
506 | static int __cpuinitdata force_mwait; | ||
507 | 501 | ||
508 | #define MWAIT_INFO 0x05 | 502 | #define MWAIT_INFO 0x05 |
509 | #define MWAIT_ECX_EXTENDED_INFO 0x01 | 503 | #define MWAIT_ECX_EXTENDED_INFO 0x01 |
@@ -513,7 +507,7 @@ static int __cpuinit mwait_usable(const struct cpuinfo_x86 *c) | |||
513 | { | 507 | { |
514 | u32 eax, ebx, ecx, edx; | 508 | u32 eax, ebx, ecx, edx; |
515 | 509 | ||
516 | if (force_mwait) | 510 | if (boot_option_idle_override == IDLE_FORCE_MWAIT) |
517 | return 1; | 511 | return 1; |
518 | 512 | ||
519 | if (c->cpuid_level < MWAIT_INFO) | 513 | if (c->cpuid_level < MWAIT_INFO) |
@@ -633,9 +627,10 @@ static int __init idle_setup(char *str) | |||
633 | if (!strcmp(str, "poll")) { | 627 | if (!strcmp(str, "poll")) { |
634 | printk("using polling idle threads.\n"); | 628 | printk("using polling idle threads.\n"); |
635 | pm_idle = poll_idle; | 629 | pm_idle = poll_idle; |
636 | } else if (!strcmp(str, "mwait")) | 630 | boot_option_idle_override = IDLE_POLL; |
637 | force_mwait = 1; | 631 | } else if (!strcmp(str, "mwait")) { |
638 | else if (!strcmp(str, "halt")) { | 632 | boot_option_idle_override = IDLE_FORCE_MWAIT; |
633 | } else if (!strcmp(str, "halt")) { | ||
639 | /* | 634 | /* |
640 | * When the boot option of idle=halt is added, halt is | 635 | * When the boot option of idle=halt is added, halt is |
641 | * forced to be used for CPU idle. In such case CPU C2/C3 | 636 | * forced to be used for CPU idle. In such case CPU C2/C3 |
@@ -644,8 +639,7 @@ static int __init idle_setup(char *str) | |||
644 | * the boot_option_idle_override. | 639 | * the boot_option_idle_override. |
645 | */ | 640 | */ |
646 | pm_idle = default_idle; | 641 | pm_idle = default_idle; |
647 | idle_halt = 1; | 642 | boot_option_idle_override = IDLE_HALT; |
648 | return 0; | ||
649 | } else if (!strcmp(str, "nomwait")) { | 643 | } else if (!strcmp(str, "nomwait")) { |
650 | /* | 644 | /* |
651 | * If the boot option of "idle=nomwait" is added, | 645 | * If the boot option of "idle=nomwait" is added, |
@@ -653,12 +647,10 @@ static int __init idle_setup(char *str) | |||
653 | * states. In such case it won't touch the variable | 647 | * states. In such case it won't touch the variable |
654 | * of boot_option_idle_override. | 648 | * of boot_option_idle_override. |
655 | */ | 649 | */ |
656 | idle_nomwait = 1; | 650 | boot_option_idle_override = IDLE_NOMWAIT; |
657 | return 0; | ||
658 | } else | 651 | } else |
659 | return -1; | 652 | return -1; |
660 | 653 | ||
661 | boot_option_idle_override = 1; | ||
662 | return 0; | 654 | return 0; |
663 | } | 655 | } |
664 | early_param("idle", idle_setup); | 656 | early_param("idle", idle_setup); |