diff options
author | Roman Zippel <zippel@linux-m68k.org> | 2006-06-25 08:47:00 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-06-25 13:00:57 -0400 |
commit | 1d174cfb0f2a8967433e157bae9c2d4dcdee5324 (patch) | |
tree | 18212e31548ff0b86b1faf8d8c25a41c34be1b0b /arch/m68k/amiga/amiints.c | |
parent | 4facfde9f1d7b8a61fb0017460da45e23e60115c (diff) |
[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/m68k/amiga/amiints.c')
-rw-r--r-- | arch/m68k/amiga/amiints.c | 74 |
1 files changed, 38 insertions, 36 deletions
diff --git a/arch/m68k/amiga/amiints.c b/arch/m68k/amiga/amiints.c index b0aa61bf8700..d02458ebd345 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); | |||
61 | static irq_node_t *ami_irq_list[AMI_STD_IRQS]; | 61 | static irq_node_t *ami_irq_list[AMI_STD_IRQS]; |
62 | 62 | ||
63 | static unsigned short amiga_intena_vals[AMI_STD_IRQS] = { | 63 | static unsigned short amiga_intena_vals[AMI_STD_IRQS] = { |
64 | [IRQ_AMIGA_VERTB] = IF_VERTB, | 64 | [IRQ_AMIGA_VERTB-IRQ_USER] = IF_VERTB, |
65 | [IRQ_AMIGA_COPPER] = IF_COPER, | 65 | [IRQ_AMIGA_COPPER-IRQ_USER] = IF_COPER, |
66 | [IRQ_AMIGA_AUD0] = IF_AUD0, | 66 | [IRQ_AMIGA_AUD0-IRQ_USER] = IF_AUD0, |
67 | [IRQ_AMIGA_AUD1] = IF_AUD1, | 67 | [IRQ_AMIGA_AUD1-IRQ_USER] = IF_AUD1, |
68 | [IRQ_AMIGA_AUD2] = IF_AUD2, | 68 | [IRQ_AMIGA_AUD2-IRQ_USER] = IF_AUD2, |
69 | [IRQ_AMIGA_AUD3] = IF_AUD3, | 69 | [IRQ_AMIGA_AUD3-IRQ_USER] = IF_AUD3, |
70 | [IRQ_AMIGA_BLIT] = IF_BLIT, | 70 | [IRQ_AMIGA_BLIT-IRQ_USER] = IF_BLIT, |
71 | [IRQ_AMIGA_DSKSYN] = IF_DSKSYN, | 71 | [IRQ_AMIGA_DSKSYN-IRQ_USER] = IF_DSKSYN, |
72 | [IRQ_AMIGA_DSKBLK] = IF_DSKBLK, | 72 | [IRQ_AMIGA_DSKBLK-IRQ_USER] = IF_DSKBLK, |
73 | [IRQ_AMIGA_RBF] = IF_RBF, | 73 | [IRQ_AMIGA_RBF-IRQ_USER] = IF_RBF, |
74 | [IRQ_AMIGA_TBE] = IF_TBE, | 74 | [IRQ_AMIGA_TBE-IRQ_USER] = IF_TBE, |
75 | [IRQ_AMIGA_SOFT] = IF_SOFT, | 75 | [IRQ_AMIGA_SOFT-IRQ_USER] = IF_SOFT, |
76 | [IRQ_AMIGA_PORTS] = IF_PORTS, | 76 | [IRQ_AMIGA_PORTS-IRQ_USER] = IF_PORTS, |
77 | [IRQ_AMIGA_EXTER] = IF_EXTER | 77 | [IRQ_AMIGA_EXTER-IRQ_USER] = IF_EXTER |
78 | }; | 78 | }; |
79 | static const unsigned char ami_servers[AMI_STD_IRQS] = { | 79 | static const unsigned char ami_servers[AMI_STD_IRQS] = { |
80 | [IRQ_AMIGA_VERTB] = 1, | 80 | [IRQ_AMIGA_VERTB-IRQ_USER] = 1, |
81 | [IRQ_AMIGA_PORTS] = 1, | 81 | [IRQ_AMIGA_PORTS-IRQ_USER] = 1, |
82 | [IRQ_AMIGA_EXTER] = 1 | 82 | [IRQ_AMIGA_EXTER-IRQ_USER] = 1 |
83 | }; | 83 | }; |
84 | 84 | ||
85 | static short ami_ablecount[AMI_IRQS]; | 85 | static short ami_ablecount[AMI_IRQS]; |
@@ -210,9 +210,8 @@ int amiga_request_irq(unsigned int irq, | |||
210 | return -ENXIO; | 210 | return -ENXIO; |
211 | } | 211 | } |
212 | 212 | ||
213 | if (irq >= IRQ_AMIGA_AUTO) | 213 | if (irq < IRQ_USER) |
214 | return cpu_request_irq(irq - IRQ_AMIGA_AUTO, handler, | 214 | return cpu_request_irq(irq, handler, flags, devname, dev_id); |
215 | flags, devname, dev_id); | ||
216 | 215 | ||
217 | if (irq >= IRQ_AMIGA_CIAB) | 216 | if (irq >= IRQ_AMIGA_CIAB) |
218 | return cia_request_irq(&ciab_base, irq - IRQ_AMIGA_CIAB, | 217 | return cia_request_irq(&ciab_base, irq - IRQ_AMIGA_CIAB, |
@@ -222,6 +221,7 @@ int amiga_request_irq(unsigned int irq, | |||
222 | return cia_request_irq(&ciaa_base, irq - IRQ_AMIGA_CIAA, | 221 | return cia_request_irq(&ciaa_base, irq - IRQ_AMIGA_CIAA, |
223 | handler, flags, devname, dev_id); | 222 | handler, flags, devname, dev_id); |
224 | 223 | ||
224 | irq -= IRQ_USER; | ||
225 | /* | 225 | /* |
226 | * IRQ_AMIGA_PORTS & IRQ_AMIGA_EXTER defaults to shared, | 226 | * IRQ_AMIGA_PORTS & IRQ_AMIGA_EXTER defaults to shared, |
227 | * we could add a check here for the SA_SHIRQ flag but all drivers | 227 | * 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) | |||
257 | return; | 257 | return; |
258 | } | 258 | } |
259 | 259 | ||
260 | if (irq >= IRQ_AMIGA_AUTO) | 260 | if (irq < IRQ_USER) |
261 | cpu_free_irq(irq - IRQ_AMIGA_AUTO, dev_id); | 261 | cpu_free_irq(irq, dev_id); |
262 | 262 | ||
263 | if (irq >= IRQ_AMIGA_CIAB) { | 263 | if (irq >= IRQ_AMIGA_CIAB) { |
264 | cia_free_irq(&ciab_base, irq - IRQ_AMIGA_CIAB, dev_id); | 264 | 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) | |||
270 | return; | 270 | return; |
271 | } | 271 | } |
272 | 272 | ||
273 | irq -= IRQ_USER; | ||
273 | if (ami_servers[irq]) { | 274 | if (ami_servers[irq]) { |
274 | amiga_delete_irq(&ami_irq_list[irq], dev_id); | 275 | amiga_delete_irq(&ami_irq_list[irq], dev_id); |
275 | /* if server list empty, disable the interrupt */ | 276 | /* if server list empty, disable the interrupt */ |
@@ -306,9 +307,9 @@ void amiga_enable_irq(unsigned int irq) | |||
306 | return; | 307 | return; |
307 | 308 | ||
308 | /* No action for auto-vector interrupts */ | 309 | /* No action for auto-vector interrupts */ |
309 | if (irq >= IRQ_AMIGA_AUTO){ | 310 | if (irq < IRQ_USER) { |
310 | printk("%s: Trying to enable auto-vector IRQ %i\n", | 311 | printk("%s: Trying to enable auto-vector IRQ %i\n", |
311 | __FUNCTION__, irq - IRQ_AMIGA_AUTO); | 312 | __FUNCTION__, irq); |
312 | return; | 313 | return; |
313 | } | 314 | } |
314 | 315 | ||
@@ -327,7 +328,7 @@ void amiga_enable_irq(unsigned int irq) | |||
327 | } | 328 | } |
328 | 329 | ||
329 | /* enable the interrupt */ | 330 | /* enable the interrupt */ |
330 | amiga_custom.intena = IF_SETCLR | amiga_intena_vals[irq]; | 331 | amiga_custom.intena = IF_SETCLR | amiga_intena_vals[irq-IRQ_USER]; |
331 | } | 332 | } |
332 | 333 | ||
333 | void amiga_disable_irq(unsigned int irq) | 334 | void amiga_disable_irq(unsigned int irq) |
@@ -341,9 +342,9 @@ void amiga_disable_irq(unsigned int irq) | |||
341 | return; | 342 | return; |
342 | 343 | ||
343 | /* No action for auto-vector interrupts */ | 344 | /* No action for auto-vector interrupts */ |
344 | if (irq >= IRQ_AMIGA_AUTO) { | 345 | if (irq < IRQ_USER) { |
345 | printk("%s: Trying to disable auto-vector IRQ %i\n", | 346 | printk("%s: Trying to disable auto-vector IRQ %i\n", |
346 | __FUNCTION__, irq - IRQ_AMIGA_AUTO); | 347 | __FUNCTION__, irq); |
347 | return; | 348 | return; |
348 | } | 349 | } |
349 | 350 | ||
@@ -358,24 +359,24 @@ void amiga_disable_irq(unsigned int irq) | |||
358 | } | 359 | } |
359 | 360 | ||
360 | /* disable the interrupt */ | 361 | /* disable the interrupt */ |
361 | amiga_custom.intena = amiga_intena_vals[irq]; | 362 | amiga_custom.intena = amiga_intena_vals[irq-IRQ_USER]; |
362 | } | 363 | } |
363 | 364 | ||
364 | inline void amiga_do_irq(int irq, struct pt_regs *fp) | 365 | inline void amiga_do_irq(int irq, struct pt_regs *fp) |
365 | { | 366 | { |
366 | kstat_cpu(0).irqs[SYS_IRQS + irq]++; | 367 | kstat_cpu(0).irqs[irq]++; |
367 | ami_irq_list[irq]->handler(irq, ami_irq_list[irq]->dev_id, fp); | 368 | ami_irq_list[irq-IRQ_USER]->handler(irq, ami_irq_list[irq-IRQ_USER]->dev_id, fp); |
368 | } | 369 | } |
369 | 370 | ||
370 | void amiga_do_irq_list(int irq, struct pt_regs *fp) | 371 | void amiga_do_irq_list(int irq, struct pt_regs *fp) |
371 | { | 372 | { |
372 | irq_node_t *node; | 373 | irq_node_t *node; |
373 | 374 | ||
374 | kstat_cpu(0).irqs[SYS_IRQS + irq]++; | 375 | kstat_cpu(0).irqs[irq]++; |
375 | 376 | ||
376 | amiga_custom.intreq = amiga_intena_vals[irq]; | 377 | amiga_custom.intreq = amiga_intena_vals[irq-IRQ_USER]; |
377 | 378 | ||
378 | for (node = ami_irq_list[irq]; node; node = node->next) | 379 | for (node = ami_irq_list[irq-IRQ_USER]; node; node = node->next) |
379 | node->handler(irq, node->dev_id, fp); | 380 | node->handler(irq, node->dev_id, fp); |
380 | } | 381 | } |
381 | 382 | ||
@@ -498,11 +499,12 @@ int show_amiga_interrupts(struct seq_file *p, void *v) | |||
498 | int i; | 499 | int i; |
499 | irq_node_t *node; | 500 | irq_node_t *node; |
500 | 501 | ||
501 | for (i = 0; i < AMI_STD_IRQS; i++) { | 502 | for (i = IRQ_USER; i < IRQ_AMIGA_CIAA; i++) { |
502 | if (!(node = ami_irq_list[i])) | 503 | node = ami_irq_list[i - IRQ_USER]; |
504 | if (!node) | ||
503 | continue; | 505 | continue; |
504 | seq_printf(p, "ami %2d: %10u ", i, | 506 | seq_printf(p, "ami %2d: %10u ", i, |
505 | kstat_cpu(0).irqs[SYS_IRQS + i]); | 507 | kstat_cpu(0).irqs[i]); |
506 | do { | 508 | do { |
507 | if (node->flags & SA_INTERRUPT) | 509 | if (node->flags & SA_INTERRUPT) |
508 | seq_puts(p, "F "); | 510 | seq_puts(p, "F "); |