Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 225867
b: refs/heads/master
c: 24480d9
h: refs/heads/master
i:
  225865: d85846e
  225863: 26ddb2f
v: v3
  • Loading branch information
Russell King committed Dec 3, 2010
1 parent ed7c45b commit f37eb42
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 62 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: ad3b6993b9c5482e8a2ec5aed181538c921fdcbd
refs/heads/master: 24480d980e9063b3ebd0dfdf2f396c305956c356
87 changes: 26 additions & 61 deletions trunk/arch/arm/kernel/smp.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,20 +48,15 @@ struct secondary_data secondary_data;

/*
* structures for inter-processor calls
* - A collection of single bit ipi messages.
*/
struct ipi_data {
spinlock_t lock;
unsigned long ipi_count;
unsigned long bits;
};

static DEFINE_PER_CPU(struct ipi_data, ipi_data) = {
.lock = SPIN_LOCK_UNLOCKED,
};
static DEFINE_PER_CPU(struct ipi_data, ipi_data);

enum ipi_msg_type {
IPI_TIMER,
IPI_TIMER = 2,
IPI_RESCHEDULE,
IPI_CALL_FUNC,
IPI_CALL_FUNC_SINGLE,
Expand Down Expand Up @@ -389,22 +384,13 @@ void __init smp_prepare_boot_cpu(void)
static void send_ipi_message(const struct cpumask *mask, enum ipi_msg_type msg)
{
unsigned long flags;
unsigned int cpu;

local_irq_save(flags);

for_each_cpu(cpu, mask) {
struct ipi_data *ipi = &per_cpu(ipi_data, cpu);

spin_lock(&ipi->lock);
ipi->bits |= 1 << msg;
spin_unlock(&ipi->lock);
}

/*
* Call the platform specific cross-CPU call function.
*/
smp_cross_call(mask, 1);
smp_cross_call(mask, msg);

local_irq_restore(flags);
}
Expand Down Expand Up @@ -546,56 +532,35 @@ asmlinkage void __exception do_IPI(int ipinr, struct pt_regs *regs)

ipi->ipi_count++;

for (;;) {
unsigned long msgs;

spin_lock(&ipi->lock);
msgs = ipi->bits;
ipi->bits = 0;
spin_unlock(&ipi->lock);

if (!msgs)
break;

do {
unsigned nextmsg;

nextmsg = msgs & -msgs;
msgs &= ~nextmsg;
nextmsg = ffz(~nextmsg);

switch (nextmsg) {
case IPI_TIMER:
ipi_timer();
break;
switch (ipinr) {
case IPI_TIMER:
ipi_timer();
break;

case IPI_RESCHEDULE:
/*
* nothing more to do - eveything is
* done on the interrupt return path
*/
break;
case IPI_RESCHEDULE:
/*
* nothing more to do - eveything is
* done on the interrupt return path
*/
break;

case IPI_CALL_FUNC:
generic_smp_call_function_interrupt();
break;
case IPI_CALL_FUNC:
generic_smp_call_function_interrupt();
break;

case IPI_CALL_FUNC_SINGLE:
generic_smp_call_function_single_interrupt();
break;
case IPI_CALL_FUNC_SINGLE:
generic_smp_call_function_single_interrupt();
break;

case IPI_CPU_STOP:
ipi_cpu_stop(cpu);
break;
case IPI_CPU_STOP:
ipi_cpu_stop(cpu);
break;

default:
printk(KERN_CRIT "CPU%u: Unknown IPI message 0x%x\n",
cpu, nextmsg);
break;
}
} while (msgs);
default:
printk(KERN_CRIT "CPU%u: Unknown IPI message 0x%x\n",
cpu, ipinr);
break;
}

set_irq_regs(old_regs);
}

Expand Down

0 comments on commit f37eb42

Please sign in to comment.