Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 149627
b: refs/heads/master
c: d69a78d
h: refs/heads/master
i:
  149625: c699868
  149623: b528a1d
v: v3
  • Loading branch information
Tony Breeds authored and Benjamin Herrenschmidt committed May 21, 2009
1 parent c3a821a commit f1efaca
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 13 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: 805e324b7fbddf9f420f0ea09eb61c21777b0526
refs/heads/master: d69a78d7daada190b42269a73daabe32a5e138a6
23 changes: 11 additions & 12 deletions trunk/arch/powerpc/sysdev/mpic.c
Original file line number Diff line number Diff line change
Expand Up @@ -613,23 +613,23 @@ static int irq_choose_cpu(unsigned int virt_irq)
#define mpic_irq_to_hw(virq) ((unsigned int)irq_map[virq].hwirq)

/* Find an mpic associated with a given linux interrupt */
static struct mpic *mpic_find(unsigned int irq, unsigned int *is_ipi)
static struct mpic *mpic_find(unsigned int irq)
{
unsigned int src = mpic_irq_to_hw(irq);
struct mpic *mpic;

if (irq < NUM_ISA_INTERRUPTS)
return NULL;

mpic = irq_desc[irq].chip_data;
return irq_desc[irq].chip_data;
}

if (is_ipi)
*is_ipi = (src >= mpic->ipi_vecs[0] &&
src <= mpic->ipi_vecs[3]);
/* Determine if the linux irq is an IPI */
static unsigned int mpic_is_ipi(struct mpic *mpic, unsigned int irq)
{
unsigned int src = mpic_irq_to_hw(irq);

return mpic;
return (src >= mpic->ipi_vecs[0] && src <= mpic->ipi_vecs[3]);
}


/* Convert a cpu mask from logical to physical cpu numbers. */
static inline u32 mpic_physmask(u32 cpumask)
{
Expand Down Expand Up @@ -1381,8 +1381,7 @@ void __init mpic_set_serial_int(struct mpic *mpic, int enable)

void mpic_irq_set_priority(unsigned int irq, unsigned int pri)
{
unsigned int is_ipi;
struct mpic *mpic = mpic_find(irq, &is_ipi);
struct mpic *mpic = mpic_find(irq);
unsigned int src = mpic_irq_to_hw(irq);
unsigned long flags;
u32 reg;
Expand All @@ -1391,7 +1390,7 @@ void mpic_irq_set_priority(unsigned int irq, unsigned int pri)
return;

spin_lock_irqsave(&mpic_lock, flags);
if (is_ipi) {
if (mpic_is_ipi(mpic, irq)) {
reg = mpic_ipi_read(src - mpic->ipi_vecs[0]) &
~MPIC_VECPRI_PRIORITY_MASK;
mpic_ipi_write(src - mpic->ipi_vecs[0],
Expand Down

0 comments on commit f1efaca

Please sign in to comment.