aboutsummaryrefslogtreecommitdiffstats
path: root/arch/i386/kernel/cpu/common.c
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 /arch/i386/kernel/cpu/common.c
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>
Diffstat (limited to 'arch/i386/kernel/cpu/common.c')
-rw-r--r--arch/i386/kernel/cpu/common.c21
1 files changed, 14 insertions, 7 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