From bfe9453dd20d189a3dfe30adfff1a957f30ef73f Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Thu, 7 Dec 2006 02:14:08 +0100 Subject: [PATCH] --- yaml --- r: 43071 b: refs/heads/master c: d7cd56111f30259e1b532a12e06f59f8e0a20355 h: refs/heads/master i: 43069: 9c5624e432d70791d85e1adb667008c3da3b9696 43067: f992c6307f114f7e899dffc1e9760225bb9e80f8 43063: e26f6e37ab3e4e635f1779df5f4760a7225eb17d 43055: 003a240402ba08aa05998de084bd93cf4219fd2c 43039: 1545cce57aa1afc8d5e280821b27e7eab3e726c9 43007: 23e9d19e58e5378fbad97b428c0f4698af9d42e6 v: v3 --- [refs] | 2 +- trunk/arch/i386/kernel/cpu/common.c | 37 ++++++++++++++++------------- trunk/include/asm-i386/processor.h | 3 +++ trunk/include/linux/start_kernel.h | 12 ++++++++++ trunk/init/main.c | 1 + 5 files changed, 38 insertions(+), 17 deletions(-) create mode 100644 trunk/include/linux/start_kernel.h diff --git a/[refs] b/[refs] index 39384adddf48..6a7ca1b63ef2 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 139ec7c416248b9ea227d21839235344edfee1e0 +refs/heads/master: d7cd56111f30259e1b532a12e06f59f8e0a20355 diff --git a/trunk/arch/i386/kernel/cpu/common.c b/trunk/arch/i386/kernel/cpu/common.c index cda41aef79ad..68bcb687019a 100644 --- a/trunk/arch/i386/kernel/cpu/common.c +++ b/trunk/arch/i386/kernel/cpu/common.c @@ -236,29 +236,14 @@ static int __cpuinit have_cpuid_p(void) return flag_is_changeable_p(X86_EFLAGS_ID); } -/* Do minimum CPU detection early. - Fields really needed: vendor, cpuid_level, family, model, mask, cache alignment. - The others are not touched to avoid unwanted side effects. - - WARNING: this function is only called on the BP. Don't add code here - that is supposed to run on all CPUs. */ -static void __init early_cpu_detect(void) +void __init cpu_detect(struct cpuinfo_x86 *c) { - struct cpuinfo_x86 *c = &boot_cpu_data; - - c->x86_cache_alignment = 32; - - if (!have_cpuid_p()) - return; - /* Get vendor name */ cpuid(0x00000000, &c->cpuid_level, (int *)&c->x86_vendor_id[0], (int *)&c->x86_vendor_id[8], (int *)&c->x86_vendor_id[4]); - get_cpu_vendor(c, 1); - c->x86 = 4; if (c->cpuid_level >= 0x00000001) { u32 junk, tfms, cap0, misc; @@ -275,6 +260,26 @@ static void __init early_cpu_detect(void) } } +/* Do minimum CPU detection early. + Fields really needed: vendor, cpuid_level, family, model, mask, cache alignment. + The others are not touched to avoid unwanted side effects. + + WARNING: this function is only called on the BP. Don't add code here + that is supposed to run on all CPUs. */ +static void __init early_cpu_detect(void) +{ + struct cpuinfo_x86 *c = &boot_cpu_data; + + c->x86_cache_alignment = 32; + + if (!have_cpuid_p()) + return; + + cpu_detect(c); + + get_cpu_vendor(c, 1); +} + static void __cpuinit generic_identify(struct cpuinfo_x86 * c) { u32 tfms, xlvl; diff --git a/trunk/include/asm-i386/processor.h b/trunk/include/asm-i386/processor.h index 5f0418d0078c..a52d65440429 100644 --- a/trunk/include/asm-i386/processor.h +++ b/trunk/include/asm-i386/processor.h @@ -20,6 +20,7 @@ #include #include #include +#include /* flag for disabling the tsc */ extern int tsc_disable; @@ -112,6 +113,8 @@ extern struct cpuinfo_x86 cpu_data[]; extern int cpu_llc_id[NR_CPUS]; extern char ignore_fpu_irq; +void __init cpu_detect(struct cpuinfo_x86 *c); + extern void identify_cpu(struct cpuinfo_x86 *); extern void print_cpu_info(struct cpuinfo_x86 *); extern unsigned int init_intel_cacheinfo(struct cpuinfo_x86 *c); diff --git a/trunk/include/linux/start_kernel.h b/trunk/include/linux/start_kernel.h new file mode 100644 index 000000000000..d3e5f2756545 --- /dev/null +++ b/trunk/include/linux/start_kernel.h @@ -0,0 +1,12 @@ +#ifndef _LINUX_START_KERNEL_H +#define _LINUX_START_KERNEL_H + +#include +#include + +/* Define the prototype for start_kernel here, rather than cluttering + up something else. */ + +extern asmlinkage void __init start_kernel(void); + +#endif /* _LINUX_START_KERNEL_H */ diff --git a/trunk/init/main.c b/trunk/init/main.c index 36f608a7cfba..985c9ed86050 100644 --- a/trunk/init/main.c +++ b/trunk/init/main.c @@ -29,6 +29,7 @@ #include #include #include +#include #include #include #include