Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 53806
b: refs/heads/master
c: d2cbcc4
h: refs/heads/master
v: v3
  • Loading branch information
Rusty Russell authored and Andi Kleen committed May 2, 2007
1 parent d1ad5eb commit cc768ca
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 31 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: bf50467204b435421d8de33ad080fa46c6f3d50b
refs/heads/master: d2cbcc49e2bfd6eaa44d7e4e5e5f171aaa5ec80d
34 changes: 9 additions & 25 deletions trunk/arch/i386/kernel/cpu/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -644,9 +644,16 @@ struct i386_pda boot_pda = {
.pcurrent = &init_task,
};

/* Common CPU init for both boot and secondary CPUs */
static void __cpuinit _cpu_init(int cpu, struct task_struct *curr)
/*
* cpu_init() initializes state that is per-CPU. Some data is already
* initialized (naturally) in the bootstrap process, such as the GDT
* and IDT. We reload them nevertheless, this function acts as a
* 'CPU state barrier', nothing should get across.
*/
void __cpuinit cpu_init(void)
{
int cpu = smp_processor_id();
struct task_struct *curr = current;
struct tss_struct * t = &per_cpu(init_tss, cpu);
struct thread_struct *thread = &curr->thread;

Expand Down Expand Up @@ -706,29 +713,6 @@ static void __cpuinit _cpu_init(int cpu, struct task_struct *curr)
mxcsr_feature_mask_init();
}

/* Entrypoint to initialize secondary CPU */
void __cpuinit secondary_cpu_init(void)
{
int cpu = smp_processor_id();
struct task_struct *curr = current;

_cpu_init(cpu, curr);
}

/*
* cpu_init() initializes state that is per-CPU. Some data is already
* initialized (naturally) in the bootstrap process, such as the GDT
* and IDT. We reload them nevertheless, this function acts as a
* 'CPU state barrier', nothing should get across.
*/
void __cpuinit cpu_init(void)
{
int cpu = smp_processor_id();
struct task_struct *curr = current;

_cpu_init(cpu, curr);
}

#ifdef CONFIG_HOTPLUG_CPU
void __cpuinit cpu_uninit(void)
{
Expand Down
8 changes: 4 additions & 4 deletions trunk/arch/i386/kernel/smpboot.c
Original file line number Diff line number Diff line change
Expand Up @@ -378,14 +378,14 @@ set_cpu_sibling_map(int cpu)
static void __cpuinit start_secondary(void *unused)
{
/*
* Don't put *anything* before secondary_cpu_init(), SMP
* booting is too fragile that we want to limit the
* things done here to the most necessary things.
* Don't put *anything* before cpu_init(), SMP booting is too
* fragile that we want to limit the things done here to the
* most necessary things.
*/
#ifdef CONFIG_VMI
vmi_bringup();
#endif
secondary_cpu_init();
cpu_init();
preempt_disable();
smp_callin();
while (!cpu_isset(smp_processor_id(), smp_commenced_mask))
Expand Down
2 changes: 1 addition & 1 deletion trunk/include/asm-i386/processor.h
Original file line number Diff line number Diff line change
Expand Up @@ -744,6 +744,6 @@ extern void enable_sep_cpu(void);
extern int sysenter_setup(void);

extern void cpu_set_gdt(int);
extern void secondary_cpu_init(void);
extern void cpu_init(void);

#endif /* __ASM_I386_PROCESSOR_H */

0 comments on commit cc768ca

Please sign in to comment.