Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 116080
b: refs/heads/master
c: 6f52707
h: refs/heads/master
v: v3
  • Loading branch information
Paul Mundt committed Sep 8, 2008
1 parent 8b7dd03 commit e0d76eb
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 7 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: c7936b9abcf5e043e73f183a37e81787f6178dd0
refs/heads/master: 6f52707e6882eb3bc6920c3f59beb05d23d68354
19 changes: 13 additions & 6 deletions trunk/arch/sh/include/asm/smp.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,26 @@ extern int __cpu_number_map[NR_CPUS];
extern int __cpu_logical_map[NR_CPUS];
#define cpu_logical_map(cpu) __cpu_logical_map[cpu]

#define SMP_MSG_FUNCTION 0
#define SMP_MSG_RESCHEDULE 1
#define SMP_MSG_FUNCTION_SINGLE 2
#define SMP_MSG_NR 3
enum {
SMP_MSG_FUNCTION,
SMP_MSG_RESCHEDULE,
SMP_MSG_FUNCTION_SINGLE,
SMP_MSG_TIMER,

SMP_MSG_NR, /* must be last */
};

void smp_message_recv(unsigned int msg);
void smp_timer_broadcast(cpumask_t mask);

void plat_smp_setup(void);
void plat_prepare_cpus(unsigned int max_cpus);
int plat_smp_processor_id(void);
void plat_start_cpu(unsigned int cpu, unsigned long entry_point);
void plat_send_ipi(unsigned int cpu, unsigned int message);
extern void arch_send_call_function_single_ipi(int cpu);
extern void arch_send_call_function_ipi(cpumask_t mask);

void arch_send_call_function_single_ipi(int cpu);
void arch_send_call_function_ipi(cpumask_t mask);

#else

Expand Down
18 changes: 18 additions & 0 deletions trunk/arch/sh/kernel/smp.c
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,21 @@ void arch_send_call_function_single_ipi(int cpu)
plat_send_ipi(cpu, SMP_MSG_FUNCTION_SINGLE);
}

void smp_timer_broadcast(cpumask_t mask)
{
int cpu;

for_each_cpu_mask(cpu, mask)
plat_send_ipi(cpu, SMP_MSG_TIMER);
}

static void ipi_timer(void)
{
irq_enter();
/* XXX ... */
irq_exit();
}

void smp_message_recv(unsigned int msg)
{
switch (msg) {
Expand All @@ -195,6 +210,9 @@ void smp_message_recv(unsigned int msg)
case SMP_MSG_FUNCTION_SINGLE:
generic_smp_call_function_single_interrupt();
break;
case SMP_MSG_TIMER:
ipi_timer();
break;
default:
printk(KERN_WARNING "SMP %d: %s(): unknown IPI %d\n",
smp_processor_id(), __func__, msg);
Expand Down

0 comments on commit e0d76eb

Please sign in to comment.