summaryrefslogtreecommitdiffstats
path: root/arch/x86
diff options
context:
space:
mode:
authorLen Brown <len.brown@intel.com>2013-02-02 05:37:30 +0100
committerLen Brown <len.brown@intel.com>2013-02-09 01:29:16 +0100
commite022e7eb90f3edb83f9ff77825eda3d1b3a2f2e0 (patch)
tree3bfc121a7534712af7ca04f4d2ac6f23582a6479 /arch/x86
parentintel_idle: remove use and definition of MWAIT_MAX_NUM_CSTATES (diff)
downloadlinux-e022e7eb90f3edb83f9ff77825eda3d1b3a2f2e0.tar.xz
linux-e022e7eb90f3edb83f9ff77825eda3d1b3a2f2e0.zip
intel_idle: remove assumption of one C-state per MWAIT flag
Remove the assumption that cstate_tables are indexed by MWAIT flag values. Each entry identifies itself via its own flags value. This change is needed to support multiple states that share the same MWAIT flags. Note that this can have an effect on what state is described by 'N' on cmdline intel_idle.max_cstate=N on some systems. intel_idle.max_cstate=0 still disables the driver intel_idle.max_cstate=1 still results in just C1(E) However, "place holders" in the sparse C-state name-space (eg. Atom) have been removed. Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'arch/x86')
-rw-r--r--arch/x86/include/asm/mwait.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/arch/x86/include/asm/mwait.h b/arch/x86/include/asm/mwait.h
index 3f447320ce87..2f366d0ac6b4 100644
--- a/arch/x86/include/asm/mwait.h
+++ b/arch/x86/include/asm/mwait.h
@@ -4,6 +4,8 @@
#define MWAIT_SUBSTATE_MASK 0xf
#define MWAIT_CSTATE_MASK 0xf
#define MWAIT_SUBSTATE_SIZE 4
+#define MWAIT_HINT2CSTATE(hint) (((hint) >> MWAIT_SUBSTATE_SIZE) & MWAIT_CSTATE_MASK)
+#define MWAIT_HINT2SUBSTATE(hint) ((hint) & MWAIT_CSTATE_MASK)
#define CPUID_MWAIT_LEAF 5
#define CPUID5_ECX_EXTENSIONS_SUPPORTED 0x1