diff options
author | Roman Zippel <zippel@linux-m68k.org> | 2006-06-25 05:47:00 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-06-25 10:00:57 -0700 |
commit | 1d174cfb0f2a8967433e157bae9c2d4dcdee5324 (patch) | |
tree | 18212e31548ff0b86b1faf8d8c25a41c34be1b0b /arch | |
parent | 4facfde9f1d7b8a61fb0017460da45e23e60115c (diff) | |
download | renesas_kernel-1d174cfb0f2a8967433e157bae9c2d4dcdee5324.tar.gz renesas_kernel-1d174cfb0f2a8967433e157bae9c2d4dcdee5324.tar.bz2 renesas_kernel-1d174cfb0f2a8967433e157bae9c2d4dcdee5324.zip |
[PATCH] m68k: cleanup amiga irq numbering
Fix amiga irq numbering, so they are after the generic IRQ_AUTO defines and
remove the IRQ_AMIGA_AUTO defines.
Signed-off-by: Roman Zippel <zippel@linux-m68k.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/m68k/amiga/amiints.c | 74 | ||||
-rw-r--r-- | arch/m68k/amiga/cia.c | 11 |
2 files changed, 43 insertions, 42 deletions
diff --git a/arch/m68k/amiga/amiints.c b/arch/m68k/amiga/amiints.c index b0aa61bf870..d02458ebd34 100644 --- a/arch/m68k/amiga/amiints.c +++ b/arch/m68k/amiga/amiints.c @@ -61,25 +61,25 @@ extern int cia_get_irq_list(struct ciabase *base, struct seq_file *p); static irq_node_t *ami_irq_list[AMI_STD_IRQS]; static unsigned short amiga_intena_vals[AMI_STD_IRQS] = { - [IRQ_AMIGA_VERTB] = IF_VERTB, - [IRQ_AMIGA_COPPER] = IF_COPER, - [IRQ_AMIGA_AUD0] = IF_AUD0, - [IRQ_AMIGA_AUD1] = IF_AUD1, - [IRQ_AMIGA_AUD2] = IF_AUD2, - [IRQ_AMIGA_AUD3] = IF_AUD3, - [IRQ_AMIGA_BLIT] = IF_BLIT, - [IRQ_AMIGA_DSKSYN] = IF_DSKSYN, - [IRQ_AMIGA_DSKBLK] = IF_DSKBLK, - [IRQ_AMIGA_RBF] = IF_RBF, - [IRQ_AMIGA_TBE] = IF_TBE, - [IRQ_AMIGA_SOFT] = IF_SOFT, - [IRQ_AMIGA_PORTS] = IF_PORTS, - [IRQ_AMIGA_EXTER] = IF_EXTER + [IRQ_AMIGA_VERTB-IRQ_USER] = IF_VERTB, + [IRQ_AMIGA_COPPER-IRQ_USER] = IF_COPER, + [IRQ_AMIGA_AUD0-IRQ_USER] = IF_AUD0, + [IRQ_AMIGA_AUD1-IRQ_USER] = IF_AUD1, + [IRQ_AMIGA_AUD2-IRQ_USER] = IF_AUD2, + [IRQ_AMIGA_AUD3-IRQ_USER] = IF_AUD3, + [IRQ_AMIGA_BLIT-IRQ_USER] = IF_BLIT, + [IRQ_AMIGA_DSKSYN-IRQ_USER] = IF_DSKSYN, + [IRQ_AMIGA_DSKBLK-IRQ_USER] = IF_DSKBLK, + [IRQ_AMIGA_RBF-IRQ_USER] = IF_RBF, + [IRQ_AMIGA_TBE-IRQ_USER] = IF_TBE, + [IRQ_AMIGA_SOFT-IRQ_USER] = IF_SOFT, + [IRQ_AMIGA_PORTS-IRQ_USER] = IF_PORTS, + [IRQ_AMIGA_EXTER-IRQ_USER] = IF_EXTER }; static const unsigned char ami_servers[AMI_STD_IRQS] = { - [IRQ_AMIGA_VERTB] = 1, - [IRQ_AMIGA_PORTS] = 1, - [IRQ_AMIGA_EXTER] = 1 + [IRQ_AMIGA_VERTB-IRQ_USER] = 1, + [IRQ_AMIGA_PORTS-IRQ_USER] = 1, + [IRQ_AMIGA_EXTER-IRQ_USER] = 1 }; static short ami_ablecount[AMI_IRQS]; @@ -210,9 +210,8 @@ int amiga_request_irq(unsigned int irq, return -ENXIO; } - if (irq >= IRQ_AMIGA_AUTO) - return cpu_request_irq(irq - IRQ_AMIGA_AUTO, handler, - flags, devname, dev_id); + if (irq < IRQ_USER) + return cpu_request_irq(irq, handler, flags, devname, dev_id); if (irq >= IRQ_AMIGA_CIAB) return cia_request_irq(&ciab_base, irq - IRQ_AMIGA_CIAB, @@ -222,6 +221,7 @@ int amiga_request_irq(unsigned int irq, return cia_request_irq(&ciaa_base, irq - IRQ_AMIGA_CIAA, handler, flags, devname, dev_id); + irq -= IRQ_USER; /* * IRQ_AMIGA_PORTS & IRQ_AMIGA_EXTER defaults to shared, * we could add a check here for the SA_SHIRQ flag but all drivers @@ -257,8 +257,8 @@ void amiga_free_irq(unsigned int irq, void *dev_id) return; } - if (irq >= IRQ_AMIGA_AUTO) - cpu_free_irq(irq - IRQ_AMIGA_AUTO, dev_id); + if (irq < IRQ_USER) + cpu_free_irq(irq, dev_id); if (irq >= IRQ_AMIGA_CIAB) { cia_free_irq(&ciab_base, irq - IRQ_AMIGA_CIAB, dev_id); @@ -270,6 +270,7 @@ void amiga_free_irq(unsigned int irq, void *dev_id) return; } + irq -= IRQ_USER; if (ami_servers[irq]) { amiga_delete_irq(&ami_irq_list[irq], dev_id); /* if server list empty, disable the interrupt */ @@ -306,9 +307,9 @@ void amiga_enable_irq(unsigned int irq) return; /* No action for auto-vector interrupts */ - if (irq >= IRQ_AMIGA_AUTO){ + if (irq < IRQ_USER) { printk("%s: Trying to enable auto-vector IRQ %i\n", - __FUNCTION__, irq - IRQ_AMIGA_AUTO); + __FUNCTION__, irq); return; } @@ -327,7 +328,7 @@ void amiga_enable_irq(unsigned int irq) } /* enable the interrupt */ - amiga_custom.intena = IF_SETCLR | amiga_intena_vals[irq]; + amiga_custom.intena = IF_SETCLR | amiga_intena_vals[irq-IRQ_USER]; } void amiga_disable_irq(unsigned int irq) @@ -341,9 +342,9 @@ void amiga_disable_irq(unsigned int irq) return; /* No action for auto-vector interrupts */ - if (irq >= IRQ_AMIGA_AUTO) { + if (irq < IRQ_USER) { printk("%s: Trying to disable auto-vector IRQ %i\n", - __FUNCTION__, irq - IRQ_AMIGA_AUTO); + __FUNCTION__, irq); return; } @@ -358,24 +359,24 @@ void amiga_disable_irq(unsigned int irq) } /* disable the interrupt */ - amiga_custom.intena = amiga_intena_vals[irq]; + amiga_custom.intena = amiga_intena_vals[irq-IRQ_USER]; } inline void amiga_do_irq(int irq, struct pt_regs *fp) { - kstat_cpu(0).irqs[SYS_IRQS + irq]++; - ami_irq_list[irq]->handler(irq, ami_irq_list[irq]->dev_id, fp); + kstat_cpu(0).irqs[irq]++; + ami_irq_list[irq-IRQ_USER]->handler(irq, ami_irq_list[irq-IRQ_USER]->dev_id, fp); } void amiga_do_irq_list(int irq, struct pt_regs *fp) { irq_node_t *node; - kstat_cpu(0).irqs[SYS_IRQS + irq]++; + kstat_cpu(0).irqs[irq]++; - amiga_custom.intreq = amiga_intena_vals[irq]; + amiga_custom.intreq = amiga_intena_vals[irq-IRQ_USER]; - for (node = ami_irq_list[irq]; node; node = node->next) + for (node = ami_irq_list[irq-IRQ_USER]; node; node = node->next) node->handler(irq, node->dev_id, fp); } @@ -498,11 +499,12 @@ int show_amiga_interrupts(struct seq_file *p, void *v) int i; irq_node_t *node; - for (i = 0; i < AMI_STD_IRQS; i++) { - if (!(node = ami_irq_list[i])) + for (i = IRQ_USER; i < IRQ_AMIGA_CIAA; i++) { + node = ami_irq_list[i - IRQ_USER]; + if (!node) continue; seq_printf(p, "ami %2d: %10u ", i, - kstat_cpu(0).irqs[SYS_IRQS + i]); + kstat_cpu(0).irqs[i]); do { if (node->flags & SA_INTERRUPT) seq_puts(p, "F "); diff --git a/arch/m68k/amiga/cia.c b/arch/m68k/amiga/cia.c index 9476eb9440f..4a003d87f98 100644 --- a/arch/m68k/amiga/cia.c +++ b/arch/m68k/amiga/cia.c @@ -33,14 +33,14 @@ struct ciabase { } ciaa_base = { .cia = &ciaa, .int_mask = IF_PORTS, - .handler_irq = IRQ_AMIGA_AUTO_2, + .handler_irq = IRQ_AUTO_2, .cia_irq = IRQ_AMIGA_CIAA, .server_irq = IRQ_AMIGA_PORTS, .name = "CIAA handler" }, ciab_base = { .cia = &ciab, .int_mask = IF_EXTER, - .handler_irq = IRQ_AMIGA_AUTO_6, + .handler_irq = IRQ_AUTO_6, .cia_irq = IRQ_AMIGA_CIAB, .server_irq = IRQ_AMIGA_EXTER, .name = "CIAB handler" @@ -131,12 +131,11 @@ static irqreturn_t cia_handler(int irq, void *dev_id, struct pt_regs *fp) unsigned char ints; mach_irq = base->cia_irq; - irq = SYS_IRQS + mach_irq; ints = cia_set_irq(base, CIA_ICR_ALL); amiga_custom.intreq = base->int_mask; - for (i = 0; i < CIA_IRQS; i++, irq++, mach_irq++) { + for (i = 0; i < CIA_IRQS; i++, mach_irq++) { if (ints & 1) { - kstat_cpu(0).irqs[irq]++; + kstat_cpu(0).irqs[mach_irq]++; base->irq_list[i].handler(mach_irq, base->irq_list[i].dev_id, fp); } ints >>= 1; @@ -172,7 +171,7 @@ int cia_get_irq_list(struct ciabase *base, struct seq_file *p) j = base->cia_irq; for (i = 0; i < CIA_IRQS; i++) { seq_printf(p, "cia %2d: %10d ", j + i, - kstat_cpu(0).irqs[SYS_IRQS + j + i]); + kstat_cpu(0).irqs[j + i]); seq_puts(p, " "); seq_printf(p, "%s\n", base->irq_list[i].devname); } |