aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRusty Russell <rusty@rustcorp.com.au>2007-05-02 13:27:10 -0400
committerAndi Kleen <andi@basil.nowhere.org>2007-05-02 13:27:10 -0400
commitd2cbcc49e2bfd6eaa44d7e4e5e5f171aaa5ec80d (patch)
treef7fb6a01cde18200aa6db57c3abffe69ae90b394
parentbf50467204b435421d8de33ad080fa46c6f3d50b (diff)
[PATCH] i386: clean up cpu_init()
We now have cpu_init() and secondary_cpu_init() doing nothing but calling _cpu_init() with the same arguments. Rename _cpu_init() to cpu_init() and use it as a replcement for secondary_cpu_init(). Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Signed-off-by: Andi Kleen <ak@suse.de> Cc: Andi Kleen <ak@suse.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
-rw-r--r--arch/i386/kernel/cpu/common.c34
-rw-r--r--arch/i386/kernel/smpboot.c8
-rw-r--r--include/asm-i386/processor.h2
3 files changed, 14 insertions, 30 deletions
diff --git a/arch/i386/kernel/cpu/common.c b/arch/i386/kernel/cpu/common.c
index fd6b079f7609..2a26956fce42 100644
--- a/arch/i386/kernel/cpu/common.c
+++ b/arch/i386/kernel/cpu/common.c
@@ -644,9 +644,16 @@ struct i386_pda boot_pda = {
644 .pcurrent = &init_task, 644 .pcurrent = &init_task,
645}; 645};
646 646
647/* Common CPU init for both boot and secondary CPUs */ 647/*
648static void __cpuinit _cpu_init(int cpu, struct task_struct *curr) 648 * cpu_init() initializes state that is per-CPU. Some data is already
649 * initialized (naturally) in the bootstrap process, such as the GDT
650 * and IDT. We reload them nevertheless, this function acts as a
651 * 'CPU state barrier', nothing should get across.
652 */
653void __cpuinit cpu_init(void)
649{ 654{
655 int cpu = smp_processor_id();
656 struct task_struct *curr = current;
650 struct tss_struct * t = &per_cpu(init_tss, cpu); 657 struct tss_struct * t = &per_cpu(init_tss, cpu);
651 struct thread_struct *thread = &curr->thread; 658 struct thread_struct *thread = &curr->thread;
652 659
@@ -706,29 +713,6 @@ static void __cpuinit _cpu_init(int cpu, struct task_struct *curr)
706 mxcsr_feature_mask_init(); 713 mxcsr_feature_mask_init();
707} 714}
708 715
709/* Entrypoint to initialize secondary CPU */
710void __cpuinit secondary_cpu_init(void)
711{
712 int cpu = smp_processor_id();
713 struct task_struct *curr = current;
714
715 _cpu_init(cpu, curr);
716}
717
718/*
719 * cpu_init() initializes state that is per-CPU. Some data is already
720 * initialized (naturally) in the bootstrap process, such as the GDT
721 * and IDT. We reload them nevertheless, this function acts as a
722 * 'CPU state barrier', nothing should get across.
723 */
724void __cpuinit cpu_init(void)
725{
726 int cpu = smp_processor_id();
727 struct task_struct *curr = current;
728
729 _cpu_init(cpu, curr);
730}
731
732#ifdef CONFIG_HOTPLUG_CPU 716#ifdef CONFIG_HOTPLUG_CPU
733void __cpuinit cpu_uninit(void) 717void __cpuinit cpu_uninit(void)
734{ 718{
diff --git a/arch/i386/kernel/smpboot.c b/arch/i386/kernel/smpboot.c
index a9447c3e86dd..954245f6d307 100644
--- a/arch/i386/kernel/smpboot.c
+++ b/arch/i386/kernel/smpboot.c
@@ -378,14 +378,14 @@ set_cpu_sibling_map(int cpu)
378static void __cpuinit start_secondary(void *unused) 378static void __cpuinit start_secondary(void *unused)
379{ 379{
380 /* 380 /*
381 * Don't put *anything* before secondary_cpu_init(), SMP 381 * Don't put *anything* before cpu_init(), SMP booting is too
382 * booting is too fragile that we want to limit the 382 * fragile that we want to limit the things done here to the
383 * things done here to the most necessary things. 383 * most necessary things.
384 */ 384 */
385#ifdef CONFIG_VMI 385#ifdef CONFIG_VMI
386 vmi_bringup(); 386 vmi_bringup();
387#endif 387#endif
388 secondary_cpu_init(); 388 cpu_init();
389 preempt_disable(); 389 preempt_disable();
390 smp_callin(); 390 smp_callin();
391 while (!cpu_isset(smp_processor_id(), smp_commenced_mask)) 391 while (!cpu_isset(smp_processor_id(), smp_commenced_mask))
diff --git a/include/asm-i386/processor.h b/include/asm-i386/processor.h
index b25a2f5b5375..80f7e8a1e878 100644
--- a/include/asm-i386/processor.h
+++ b/include/asm-i386/processor.h
@@ -744,6 +744,6 @@ extern void enable_sep_cpu(void);
744extern int sysenter_setup(void); 744extern int sysenter_setup(void);
745 745
746extern void cpu_set_gdt(int); 746extern void cpu_set_gdt(int);
747extern void secondary_cpu_init(void); 747extern void cpu_init(void);
748 748
749#endif /* __ASM_I386_PROCESSOR_H */ 749#endif /* __ASM_I386_PROCESSOR_H */