diff options
author | Dave Jones <davej@redhat.com> | 2008-05-22 18:57:25 -0400 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2008-05-30 18:46:30 -0400 |
commit | 30a713180b3d08fdec5ca572e5a1cd35253c5d8e (patch) | |
tree | 4d286cbf8dbbaaca40241aa8dffe203cb2acd75d /arch | |
parent | 7e2191127eb414d7d5a11df6552ab6e3845d17a1 (diff) |
x86: Move the 64-bit Centaur specific parts out of setup_64.c
Create a separate centaur_64.c file in the cpu/ dir for
the useful parts to live in.
Signed-off-by: Dave Jones <davej@redhat.com>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/x86/kernel/cpu/Makefile | 1 | ||||
-rw-r--r-- | arch/x86/kernel/cpu/centaur_64.c | 31 | ||||
-rw-r--r-- | arch/x86/kernel/setup_64.c | 28 |
3 files changed, 34 insertions, 26 deletions
diff --git a/arch/x86/kernel/cpu/Makefile b/arch/x86/kernel/cpu/Makefile index b7a11924fed7..c77a1c50d944 100644 --- a/arch/x86/kernel/cpu/Makefile +++ b/arch/x86/kernel/cpu/Makefile | |||
@@ -10,6 +10,7 @@ obj-$(CONFIG_X86_32) += amd.o | |||
10 | obj-$(CONFIG_X86_64) += amd_64.o | 10 | obj-$(CONFIG_X86_64) += amd_64.o |
11 | obj-$(CONFIG_X86_32) += cyrix.o | 11 | obj-$(CONFIG_X86_32) += cyrix.o |
12 | obj-$(CONFIG_X86_32) += centaur.o | 12 | obj-$(CONFIG_X86_32) += centaur.o |
13 | obj-$(CONFIG_X86_64) += centaur_64.o | ||
13 | obj-$(CONFIG_X86_32) += transmeta.o | 14 | obj-$(CONFIG_X86_32) += transmeta.o |
14 | obj-$(CONFIG_X86_32) += intel.o | 15 | obj-$(CONFIG_X86_32) += intel.o |
15 | obj-$(CONFIG_X86_64) += intel_64.o | 16 | obj-$(CONFIG_X86_64) += intel_64.o |
diff --git a/arch/x86/kernel/cpu/centaur_64.c b/arch/x86/kernel/cpu/centaur_64.c new file mode 100644 index 000000000000..bac96d187d05 --- /dev/null +++ b/arch/x86/kernel/cpu/centaur_64.c | |||
@@ -0,0 +1,31 @@ | |||
1 | #include <linux/init.h> | ||
2 | #include <linux/smp.h> | ||
3 | |||
4 | #include <asm/cpufeature.h> | ||
5 | #include <asm/processor.h> | ||
6 | |||
7 | void __cpuinit early_init_centaur(struct cpuinfo_x86 *c) | ||
8 | { | ||
9 | if (c->x86 == 0x6 && c->x86_model >= 0xf) | ||
10 | set_cpu_cap(c, X86_FEATURE_CONSTANT_TSC); | ||
11 | } | ||
12 | |||
13 | void __cpuinit init_centaur(struct cpuinfo_x86 *c) | ||
14 | { | ||
15 | /* Cache sizes */ | ||
16 | unsigned n; | ||
17 | |||
18 | n = c->extended_cpuid_level; | ||
19 | if (n >= 0x80000008) { | ||
20 | unsigned eax = cpuid_eax(0x80000008); | ||
21 | c->x86_virt_bits = (eax >> 8) & 0xff; | ||
22 | c->x86_phys_bits = eax & 0xff; | ||
23 | } | ||
24 | |||
25 | if (c->x86 == 0x6 && c->x86_model >= 0xf) { | ||
26 | c->x86_cache_alignment = c->x86_clflush_size * 2; | ||
27 | set_cpu_cap(c, X86_FEATURE_CONSTANT_TSC); | ||
28 | set_cpu_cap(c, X86_FEATURE_REP_GOOD); | ||
29 | } | ||
30 | set_cpu_cap(c, X86_FEATURE_LFENCE_RDTSC); | ||
31 | } | ||
diff --git a/arch/x86/kernel/setup_64.c b/arch/x86/kernel/setup_64.c index c4e6a0b6c303..25afdd80a3cf 100644 --- a/arch/x86/kernel/setup_64.c +++ b/arch/x86/kernel/setup_64.c | |||
@@ -622,32 +622,6 @@ out: | |||
622 | #endif | 622 | #endif |
623 | } | 623 | } |
624 | 624 | ||
625 | static void __cpuinit early_init_centaur(struct cpuinfo_x86 *c) | ||
626 | { | ||
627 | if (c->x86 == 0x6 && c->x86_model >= 0xf) | ||
628 | set_cpu_cap(c, X86_FEATURE_CONSTANT_TSC); | ||
629 | } | ||
630 | |||
631 | static void __cpuinit init_centaur(struct cpuinfo_x86 *c) | ||
632 | { | ||
633 | /* Cache sizes */ | ||
634 | unsigned n; | ||
635 | |||
636 | n = c->extended_cpuid_level; | ||
637 | if (n >= 0x80000008) { | ||
638 | unsigned eax = cpuid_eax(0x80000008); | ||
639 | c->x86_virt_bits = (eax >> 8) & 0xff; | ||
640 | c->x86_phys_bits = eax & 0xff; | ||
641 | } | ||
642 | |||
643 | if (c->x86 == 0x6 && c->x86_model >= 0xf) { | ||
644 | c->x86_cache_alignment = c->x86_clflush_size * 2; | ||
645 | set_cpu_cap(c, X86_FEATURE_CONSTANT_TSC); | ||
646 | set_cpu_cap(c, X86_FEATURE_REP_GOOD); | ||
647 | } | ||
648 | set_cpu_cap(c, X86_FEATURE_LFENCE_RDTSC); | ||
649 | } | ||
650 | |||
651 | static void __cpuinit get_cpu_vendor(struct cpuinfo_x86 *c) | 625 | static void __cpuinit get_cpu_vendor(struct cpuinfo_x86 *c) |
652 | { | 626 | { |
653 | char *v = c->x86_vendor_id; | 627 | char *v = c->x86_vendor_id; |
@@ -667,6 +641,8 @@ extern void __cpuinit early_init_amd(struct cpuinfo_x86 *c); | |||
667 | extern void __cpuinit init_amd(struct cpuinfo_x86 *c); | 641 | extern void __cpuinit init_amd(struct cpuinfo_x86 *c); |
668 | extern void __cpuinit early_init_intel(struct cpuinfo_x86 *c); | 642 | extern void __cpuinit early_init_intel(struct cpuinfo_x86 *c); |
669 | extern void __cpuinit init_intel(struct cpuinfo_x86 *c); | 643 | extern void __cpuinit init_intel(struct cpuinfo_x86 *c); |
644 | extern void __cpuinit early_init_centaur(struct cpuinfo_x86 *c); | ||
645 | extern void __cpuinit init_centaur(struct cpuinfo_x86 *c); | ||
670 | 646 | ||
671 | /* Do some early cpuid on the boot CPU to get some parameter that are | 647 | /* Do some early cpuid on the boot CPU to get some parameter that are |
672 | needed before check_bugs. Everything advanced is in identify_cpu | 648 | needed before check_bugs. Everything advanced is in identify_cpu |