Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 133283
b: refs/heads/master
c: bdaa6e8
h: refs/heads/master
i:
  133281: 7baf02e
  133279: be421fa
v: v3
  • Loading branch information
Magnus Damm authored and Paul Mundt committed Feb 27, 2009
1 parent 3528fb4 commit b11e588
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 2 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: 3e91faec47e9e12b965c952d698b0bb64847af06
refs/heads/master: bdaa6e8062d7f8085d8ed94ff88c99406ad53d79
2 changes: 1 addition & 1 deletion trunk/arch/sh/kernel/irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ asmlinkage int do_IRQ(unsigned int irq, struct pt_regs *regs)
}
#endif

irq = irq_demux(evt2irq(irq));
irq = irq_demux(intc_evt2irq(irq));

#ifdef CONFIG_IRQSTACKS
curctx = (union irq_ctx *)current_thread_info();
Expand Down
47 changes: 47 additions & 0 deletions trunk/drivers/sh/intc.c
Original file line number Diff line number Diff line change
Expand Up @@ -568,6 +568,10 @@ static void __init intc_register_irq(struct intc_desc *desc,
if (!data[0] && data[1])
primary = 1;

if (!data[0] && !data[1])
pr_warning("intc: missing unique irq mask for 0x%04x\n",
irq2evt(irq));

data[0] = data[0] ? data[0] : intc_mask_data(desc, d, enum_id, 1);
data[1] = data[1] ? data[1] : intc_prio_data(desc, d, enum_id, 1);

Expand Down Expand Up @@ -641,6 +645,17 @@ static unsigned int __init save_reg(struct intc_desc_int *d,
return 0;
}

static unsigned char *intc_evt2irq_table;

unsigned int intc_evt2irq(unsigned int vector)
{
unsigned int irq = evt2irq(vector);

if (intc_evt2irq_table && intc_evt2irq_table[irq])
irq = intc_evt2irq_table[irq];

return irq;
}

void __init register_intc_controller(struct intc_desc *desc)
{
Expand Down Expand Up @@ -705,9 +720,41 @@ void __init register_intc_controller(struct intc_desc *desc)

BUG_ON(k > 256); /* _INTC_ADDR_E() and _INTC_ADDR_D() are 8 bits */

/* keep the first vector only if same enum is used multiple times */
for (i = 0; i < desc->nr_vectors; i++) {
struct intc_vect *vect = desc->vectors + i;
int first_irq = evt2irq(vect->vect);

if (!vect->enum_id)
continue;

for (k = i + 1; k < desc->nr_vectors; k++) {
struct intc_vect *vect2 = desc->vectors + k;

if (vect->enum_id != vect2->enum_id)
continue;

vect2->enum_id = 0;

if (!intc_evt2irq_table)
intc_evt2irq_table = alloc_bootmem(NR_IRQS);

if (!intc_evt2irq_table) {
pr_warning("intc: cannot allocate evt2irq!\n");
continue;
}

intc_evt2irq_table[evt2irq(vect2->vect)] = first_irq;
}
}

/* register the vectors one by one */
for (i = 0; i < desc->nr_vectors; i++) {
struct intc_vect *vect = desc->vectors + i;

if (!vect->enum_id)
continue;

intc_register_irq(desc, d, vect->enum_id, evt2irq(vect->vect));
}
}
1 change: 1 addition & 0 deletions trunk/include/linux/sh_intc.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ struct intc_desc symbol __initdata = { \
}
#endif

unsigned int intc_evt2irq(unsigned int vector);
void __init register_intc_controller(struct intc_desc *desc);
int intc_set_priority(unsigned int irq, unsigned int prio);

Expand Down

0 comments on commit b11e588

Please sign in to comment.