Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 191640
b: refs/heads/master
c: 9715b8c
h: refs/heads/master
v: v3
  • Loading branch information
Paul Mundt committed Apr 26, 2010
1 parent 1798899 commit cde18b0
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 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: 7acb59eb4b5eee113eb74eeafd1e6536171eeced
refs/heads/master: 9715b8c7d55912fb6f5dd9b1c084d8eefcd0d848
3 changes: 3 additions & 0 deletions trunk/arch/sh/include/asm/smp.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include <linux/spinlock.h>
#include <asm/atomic.h>
#include <asm/current.h>
#include <asm/percpu.h>

#define raw_smp_processor_id() (current_thread_info()->cpu)

Expand All @@ -30,6 +31,8 @@ enum {
SMP_MSG_NR, /* must be last */
};

DECLARE_PER_CPU(int, cpu_state);

void smp_message_recv(unsigned int msg);
void smp_timer_broadcast(const struct cpumask *mask);

Expand Down
14 changes: 10 additions & 4 deletions trunk/arch/sh/kernel/smp.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ int __cpu_logical_map[NR_CPUS]; /* Map logical to physical */

struct plat_smp_ops *mp_ops = NULL;

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

void __cpuinit register_smp_ops(struct plat_smp_ops *ops)
{
if (mp_ops)
Expand Down Expand Up @@ -72,11 +75,13 @@ void __devinit smp_prepare_boot_cpu(void)

set_cpu_online(cpu, true);
set_cpu_possible(cpu, true);

per_cpu(cpu_state, cpu) = CPU_ONLINE;
}

asmlinkage void __cpuinit start_secondary(void)
{
unsigned int cpu;
unsigned int cpu = smp_processor_id();
struct mm_struct *mm = &init_mm;

enable_mmu();
Expand All @@ -90,19 +95,18 @@ asmlinkage void __cpuinit start_secondary(void)

preempt_disable();

notify_cpu_starting(smp_processor_id());
notify_cpu_starting(cpu);

local_irq_enable();

cpu = smp_processor_id();

/* Enable local timers */
local_timer_setup(cpu);
calibrate_delay();

smp_store_cpu_info(cpu);

set_cpu_online(cpu, true);
per_cpu(cpu_state, cpu) = CPU_ONLINE;

cpu_idle();
}
Expand All @@ -127,6 +131,8 @@ int __cpuinit __cpu_up(unsigned int cpu)
return PTR_ERR(tsk);
}

per_cpu(cpu_state, cpu) = CPU_UP_PREPARE;

/* Fill in data in head.S for secondary cpus */
stack_start.sp = tsk->thread.sp;
stack_start.thread_info = tsk->stack;
Expand Down

0 comments on commit cde18b0

Please sign in to comment.