aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeremy Fitzhardinge <jeremy@goop.org>2007-05-02 13:27:12 -0400
committerAndi Kleen <andi@basil.nowhere.org>2007-05-02 13:27:12 -0400
commita6c4e076ee4c1ea670e4faa55814e63dd08e3f29 (patch)
tree42ae132ca8ad99b05904af07ed8abc6aeef33aa8
parent1353ebb4b48151e3810d9a60449edd43a90ea3c3 (diff)
[PATCH] i386: clean up identify_cpu
identify_cpu() is used to identify both the boot CPU and secondary CPUs, but it performs some actions which only apply to the boot CPU. Those functions are therefore really __init functions, but because they're called by identify_cpu(), they must be marked __cpuinit. This patch splits identify_cpu() into identify_boot_cpu() and identify_secondary_cpu(), and calls the appropriate init functions from each. Also, identify_boot_cpu() and all the functions it dominates are marked __init. Signed-off-by: Jeremy Fitzhardinge <jeremy@xensource.com> Signed-off-by: Andi Kleen <ak@suse.de>
-rw-r--r--arch/i386/kernel/cpu/common.c21
-rw-r--r--arch/i386/kernel/smpboot.c2
-rw-r--r--arch/i386/kernel/sysenter.c2
-rw-r--r--include/asm-i386/processor.h3
4 files changed, 18 insertions, 10 deletions
diff --git a/arch/i386/kernel/cpu/common.c b/arch/i386/kernel/cpu/common.c
index 5faf675aab4b..58128585ae60 100644
--- a/arch/i386/kernel/cpu/common.c
+++ b/arch/i386/kernel/cpu/common.c
@@ -394,7 +394,7 @@ __setup("serialnumber", x86_serial_nr_setup);
394/* 394/*
395 * This does the hard work of actually picking apart the CPU stuff... 395 * This does the hard work of actually picking apart the CPU stuff...
396 */ 396 */
397void __cpuinit identify_cpu(struct cpuinfo_x86 *c) 397static void __cpuinit identify_cpu(struct cpuinfo_x86 *c)
398{ 398{
399 int i; 399 int i;
400 400
@@ -505,15 +505,22 @@ void __cpuinit identify_cpu(struct cpuinfo_x86 *c)
505 505
506 /* Init Machine Check Exception if available. */ 506 /* Init Machine Check Exception if available. */
507 mcheck_init(c); 507 mcheck_init(c);
508}
508 509
509 if (c == &boot_cpu_data) 510void __init identify_boot_cpu(void)
510 sysenter_setup(); 511{
512 identify_cpu(&boot_cpu_data);
513 sysenter_setup();
511 enable_sep_cpu(); 514 enable_sep_cpu();
515 mtrr_bp_init();
516}
512 517
513 if (c == &boot_cpu_data) 518void __cpuinit identify_secondary_cpu(struct cpuinfo_x86 *c)
514 mtrr_bp_init(); 519{
515 else 520 BUG_ON(c == &boot_cpu_data);
516 mtrr_ap_init(); 521 identify_cpu(c);
522 enable_sep_cpu();
523 mtrr_ap_init();
517} 524}
518 525
519#ifdef CONFIG_X86_HT 526#ifdef CONFIG_X86_HT
diff --git a/arch/i386/kernel/smpboot.c b/arch/i386/kernel/smpboot.c
index 1c3ad9b406ca..61e2842add36 100644
--- a/arch/i386/kernel/smpboot.c
+++ b/arch/i386/kernel/smpboot.c
@@ -155,7 +155,7 @@ static void __cpuinit smp_store_cpu_info(int id)
155 155
156 *c = boot_cpu_data; 156 *c = boot_cpu_data;
157 if (id!=0) 157 if (id!=0)
158 identify_cpu(c); 158 identify_secondary_cpu(c);
159 /* 159 /*
160 * Mask B, Pentium, but not Pentium MMX 160 * Mask B, Pentium, but not Pentium MMX
161 */ 161 */
diff --git a/arch/i386/kernel/sysenter.c b/arch/i386/kernel/sysenter.c
index 168f8147d3b4..13ca54a85a1c 100644
--- a/arch/i386/kernel/sysenter.c
+++ b/arch/i386/kernel/sysenter.c
@@ -72,7 +72,7 @@ extern const char vsyscall_int80_start, vsyscall_int80_end;
72extern const char vsyscall_sysenter_start, vsyscall_sysenter_end; 72extern const char vsyscall_sysenter_start, vsyscall_sysenter_end;
73static struct page *syscall_pages[1]; 73static struct page *syscall_pages[1];
74 74
75int __cpuinit sysenter_setup(void) 75int __init sysenter_setup(void)
76{ 76{
77 void *syscall_page = (void *)get_zeroed_page(GFP_ATOMIC); 77 void *syscall_page = (void *)get_zeroed_page(GFP_ATOMIC);
78 syscall_pages[0] = virt_to_page(syscall_page); 78 syscall_pages[0] = virt_to_page(syscall_page);
diff --git a/include/asm-i386/processor.h b/include/asm-i386/processor.h
index 11838df88603..9d895cc2f312 100644
--- a/include/asm-i386/processor.h
+++ b/include/asm-i386/processor.h
@@ -116,7 +116,8 @@ extern char ignore_fpu_irq;
116 116
117void __init cpu_detect(struct cpuinfo_x86 *c); 117void __init cpu_detect(struct cpuinfo_x86 *c);
118 118
119extern void identify_cpu(struct cpuinfo_x86 *); 119extern void identify_boot_cpu(void);
120extern void identify_secondary_cpu(struct cpuinfo_x86 *);
120extern void print_cpu_info(struct cpuinfo_x86 *); 121extern void print_cpu_info(struct cpuinfo_x86 *);
121extern unsigned int init_intel_cacheinfo(struct cpuinfo_x86 *c); 122extern unsigned int init_intel_cacheinfo(struct cpuinfo_x86 *c);
122extern unsigned short num_cache_leaves; 123extern unsigned short num_cache_leaves;