Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 99429
b: refs/heads/master
c: 09fd4b4
h: refs/heads/master
i:
  99427: 690b759
v: v3
  • Loading branch information
Thomas Gleixner authored and Ingo Molnar committed Jun 10, 2008
1 parent cdc9b86 commit ae85828
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 732d7be17b98ebfd59e5864c3490f19856fa832c
refs/heads/master: 09fd4b4ef5bc7e5222c13acec1bee8cd252fb63f
28 changes: 20 additions & 8 deletions trunk/arch/x86/kernel/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -122,19 +122,31 @@ static void poll_idle(void)
*
* idle=mwait overrides this decision and forces the usage of mwait.
*/

#define MWAIT_INFO 0x05
#define MWAIT_ECX_EXTENDED_INFO 0x01
#define MWAIT_EDX_C1 0xf0

static int __cpuinit mwait_usable(const struct cpuinfo_x86 *c)
{
u32 eax, ebx, ecx, edx;

if (force_mwait)
return 1;

if (c->x86_vendor == X86_VENDOR_AMD) {
switch(c->x86) {
case 0x10:
case 0x11:
return 0;
}
}
return 1;
if (c->cpuid_level < MWAIT_INFO)
return 0;

cpuid(MWAIT_INFO, &eax, &ebx, &ecx, &edx);
/* Check, whether EDX has extended info about MWAIT */
if (!(ecx & MWAIT_ECX_EXTENDED_INFO))
return 1;

/*
* edx enumeratios MONITOR/MWAIT extensions. Check, whether
* C1 supports MWAIT
*/
return (edx & MWAIT_EDX_C1);
}

void __cpuinit select_idle_routine(const struct cpuinfo_x86 *c)
Expand Down

0 comments on commit ae85828

Please sign in to comment.