Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 88846
b: refs/heads/master
c: a8db845
h: refs/heads/master
v: v3
  • Loading branch information
Glauber de Oliveira Costa authored and Ingo Molnar committed Apr 17, 2008
1 parent 64122bd commit 330117c
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 29 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: bbc2ff6a91a4eef8030018cd389bb12352d11b34
refs/heads/master: a8db8453ff52609b14716361651ad10d2ab66682
18 changes: 18 additions & 0 deletions trunk/arch/x86/kernel/smpboot.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@
#include <mach_wakecpu.h>
#include <smpboot_hooks.h>

/* State of each CPU */
DEFINE_PER_CPU(int, cpu_state) = { 0 };

/* Store all idle threads, this can be reused instead of creating
* a new thread. Also avoids complicated thread destroy functionality
* for idle threads.
Expand Down Expand Up @@ -999,6 +1002,21 @@ int __cpuinit native_cpu_up(unsigned int cpu)
return 0;
}

/*
* Early setup to make printk work.
*/
void __init native_smp_prepare_boot_cpu(void)
{
int me = smp_processor_id();
#ifdef CONFIG_X86_32
init_gdt(me);
switch_to_new_gdt();
#endif
/* already set me in cpu_online_map in boot_cpu_init() */
cpu_set(me, cpu_callout_map);
per_cpu(cpu_state, me) = CPU_ONLINE;
}

#ifdef CONFIG_HOTPLUG_CPU
void remove_siblinginfo(int cpu)
{
Expand Down
14 changes: 0 additions & 14 deletions trunk/arch/x86/kernel/smpboot_32.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,6 @@ u8 apicid_2_node[MAX_APICID];
extern void map_cpu_to_logical_apicid(void);
extern void unmap_cpu_to_logical_apicid(int cpu);

/* State of each CPU. */
DEFINE_PER_CPU(int, cpu_state) = { 0 };

#ifdef CONFIG_HOTPLUG_CPU
void cpu_exit_clear(void)
{
Expand Down Expand Up @@ -219,17 +216,6 @@ void __init native_smp_prepare_cpus(unsigned int max_cpus)
smp_boot_cpus(max_cpus);
}

void __init native_smp_prepare_boot_cpu(void)
{
unsigned int cpu = smp_processor_id();

init_gdt(cpu);
switch_to_new_gdt();

cpu_set(cpu, cpu_callout_map);
__get_cpu_var(cpu_state) = CPU_ONLINE;
}

extern void impress_friends(void);
extern void smp_checks(void);

Expand Down
14 changes: 0 additions & 14 deletions trunk/arch/x86/kernel/smpboot_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,6 @@
/* Set when the idlers are all forked */
int smp_threads_ready;

/* State of each CPU */
DEFINE_PER_CPU(int, cpu_state) = { 0 };

cycles_t cacheflush_time;
unsigned long cache_decay_ticks;

Expand Down Expand Up @@ -216,17 +213,6 @@ void __init native_smp_prepare_cpus(unsigned int max_cpus)
print_cpu_info(&cpu_data(0));
}

/*
* Early setup to make printk work.
*/
void __init native_smp_prepare_boot_cpu(void)
{
int me = smp_processor_id();
/* already set me in cpu_online_map in boot_cpu_init() */
cpu_set(me, cpu_callout_map);
per_cpu(cpu_state, me) = CPU_ONLINE;
}

extern void impress_friends(void);
extern void smp_checks(void);

Expand Down

0 comments on commit 330117c

Please sign in to comment.