diff options
author | Yinghai Lu <yhlu.kernel@gmail.com> | 2008-09-04 23:09:09 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-09-05 03:40:53 -0400 |
commit | 5122c890ba969e6efeaba9ed45f5936e62d3c6d5 (patch) | |
tree | 0a63f3ad46274bb52c02aad5a746d6652136629a /arch/x86 | |
parent | 1cd78776c7d5487e3000426d0ce1ff203c5d60cd (diff) |
x86: cpu/common.c: merge get_cpu_cap()
Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86')
-rw-r--r-- | arch/x86/kernel/cpu/common.c | 20 | ||||
-rw-r--r-- | arch/x86/kernel/cpu/common_64.c | 2 |
2 files changed, 22 insertions, 0 deletions
diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c index b2018f76c94d..ffc2f5ed09a3 100644 --- a/arch/x86/kernel/cpu/common.c +++ b/arch/x86/kernel/cpu/common.c | |||
@@ -458,6 +458,26 @@ static void __cpuinit get_cpu_cap(struct cpuinfo_x86 *c) | |||
458 | c->x86_capability[6] = cpuid_ecx(0x80000001); | 458 | c->x86_capability[6] = cpuid_ecx(0x80000001); |
459 | } | 459 | } |
460 | } | 460 | } |
461 | |||
462 | #ifdef CONFIG_X86_64 | ||
463 | /* Transmeta-defined flags: level 0x80860001 */ | ||
464 | xlvl = cpuid_eax(0x80860000); | ||
465 | if ((xlvl & 0xffff0000) == 0x80860000) { | ||
466 | /* Don't set x86_cpuid_level here for now to not confuse. */ | ||
467 | if (xlvl >= 0x80860001) | ||
468 | c->x86_capability[2] = cpuid_edx(0x80860001); | ||
469 | } | ||
470 | |||
471 | if (c->extended_cpuid_level >= 0x80000007) | ||
472 | c->x86_power = cpuid_edx(0x80000007); | ||
473 | |||
474 | if (c->extended_cpuid_level >= 0x80000008) { | ||
475 | u32 eax = cpuid_eax(0x80000008); | ||
476 | |||
477 | c->x86_virt_bits = (eax >> 8) & 0xff; | ||
478 | c->x86_phys_bits = eax & 0xff; | ||
479 | } | ||
480 | #endif | ||
461 | } | 481 | } |
462 | /* | 482 | /* |
463 | * Do minimum CPU detection early. | 483 | * Do minimum CPU detection early. |
diff --git a/arch/x86/kernel/cpu/common_64.c b/arch/x86/kernel/cpu/common_64.c index 7ac0a00743c7..75bb7ff99ee3 100644 --- a/arch/x86/kernel/cpu/common_64.c +++ b/arch/x86/kernel/cpu/common_64.c | |||
@@ -461,6 +461,7 @@ static void __cpuinit get_cpu_cap(struct cpuinfo_x86 *c) | |||
461 | } | 461 | } |
462 | } | 462 | } |
463 | 463 | ||
464 | #ifdef CONFIG_X86_64 | ||
464 | /* Transmeta-defined flags: level 0x80860001 */ | 465 | /* Transmeta-defined flags: level 0x80860001 */ |
465 | xlvl = cpuid_eax(0x80860000); | 466 | xlvl = cpuid_eax(0x80860000); |
466 | if ((xlvl & 0xffff0000) == 0x80860000) { | 467 | if ((xlvl & 0xffff0000) == 0x80860000) { |
@@ -478,6 +479,7 @@ static void __cpuinit get_cpu_cap(struct cpuinfo_x86 *c) | |||
478 | c->x86_virt_bits = (eax >> 8) & 0xff; | 479 | c->x86_virt_bits = (eax >> 8) & 0xff; |
479 | c->x86_phys_bits = eax & 0xff; | 480 | c->x86_phys_bits = eax & 0xff; |
480 | } | 481 | } |
482 | #endif | ||
481 | } | 483 | } |
482 | 484 | ||
483 | /* Do some early cpuid on the boot CPU to get some parameter that are | 485 | /* Do some early cpuid on the boot CPU to get some parameter that are |