mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-19 05:04:20 +00:00
Merge do_boot_cpu() into the new style __cpu_up().
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
This commit is contained in:
parent
0ac354801a
commit
b727a60258
1 changed files with 19 additions and 31 deletions
|
@ -247,32 +247,6 @@ void __devinit smp_prepare_boot_cpu(void)
|
||||||
cpu_set(0, cpu_callin_map);
|
cpu_set(0, cpu_callin_map);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* Startup the CPU with this logical number
|
|
||||||
*/
|
|
||||||
static int __init do_boot_cpu(int cpu)
|
|
||||||
{
|
|
||||||
struct task_struct *idle;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* The following code is purely to make sure
|
|
||||||
* Linux can schedule processes on this slave.
|
|
||||||
*/
|
|
||||||
idle = fork_idle(cpu);
|
|
||||||
if (IS_ERR(idle))
|
|
||||||
panic("failed fork for CPU %d\n", cpu);
|
|
||||||
|
|
||||||
prom_boot_secondary(cpu, idle);
|
|
||||||
|
|
||||||
/* XXXKW timeout */
|
|
||||||
while (!cpu_isset(cpu, cpu_callin_map))
|
|
||||||
udelay(100);
|
|
||||||
|
|
||||||
cpu_set(cpu, cpu_online_map);
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Called once for each "cpu_possible(cpu)". Needs to spin up the cpu
|
* Called once for each "cpu_possible(cpu)". Needs to spin up the cpu
|
||||||
* and keep control until "cpu_online(cpu)" is set. Note: cpu is
|
* and keep control until "cpu_online(cpu)" is set. Note: cpu is
|
||||||
|
@ -280,12 +254,26 @@ static int __init do_boot_cpu(int cpu)
|
||||||
*/
|
*/
|
||||||
int __devinit __cpu_up(unsigned int cpu)
|
int __devinit __cpu_up(unsigned int cpu)
|
||||||
{
|
{
|
||||||
int ret;
|
struct task_struct *idle;
|
||||||
|
|
||||||
/* Processor goes to start_secondary(), sets online flag */
|
/*
|
||||||
ret = do_boot_cpu(cpu);
|
* Processor goes to start_secondary(), sets online flag
|
||||||
if (ret < 0)
|
* The following code is purely to make sure
|
||||||
return ret;
|
* Linux can schedule processes on this slave.
|
||||||
|
*/
|
||||||
|
idle = fork_idle(cpu);
|
||||||
|
if (IS_ERR(idle))
|
||||||
|
panic(KERN_ERR "Fork failed for CPU %d", cpu);
|
||||||
|
|
||||||
|
prom_boot_secondary(cpu, idle);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Trust is futile. We should really have timeouts ...
|
||||||
|
*/
|
||||||
|
while (!cpu_isset(cpu, cpu_callin_map))
|
||||||
|
udelay(100);
|
||||||
|
|
||||||
|
cpu_set(cpu, cpu_online_map);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue