Commit 9c5f4afdfbe72d5d1c814ad7286a4524d00c7b96
Committed by
Linus Torvalds
1 parent
35353bb8b8
Exists in
master
and in
4 other branches
[PATCH] m68k: convert mac irq code
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>
Showing 12 changed files with 159 additions and 425 deletions Side-by-side Diff
arch/m68k/mac/baboon.c
... | ... | @@ -81,7 +81,7 @@ |
81 | 81 | for (i = 0, irq_bit = 1 ; i < 3 ; i++, irq_bit <<= 1) { |
82 | 82 | if (events & irq_bit/* & baboon_active*/) { |
83 | 83 | baboon_active &= ~irq_bit; |
84 | - mac_do_irq_list(IRQ_BABOON_0 + i, regs); | |
84 | + m68k_handle_int(IRQ_BABOON_0 + i, regs); | |
85 | 85 | baboon_active |= irq_bit; |
86 | 86 | baboon->mb_ifr &= ~irq_bit; |
87 | 87 | } |
arch/m68k/mac/config.c
... | ... | @@ -169,12 +169,7 @@ |
169 | 169 | |
170 | 170 | mach_sched_init = mac_sched_init; |
171 | 171 | mach_init_IRQ = mac_init_IRQ; |
172 | - mach_request_irq = mac_request_irq; | |
173 | - mach_free_irq = mac_free_irq; | |
174 | - enable_irq = mac_enable_irq; | |
175 | - disable_irq = mac_disable_irq; | |
176 | 172 | mach_get_model = mac_get_model; |
177 | - mach_get_irq_list = show_mac_interrupts; | |
178 | 173 | mach_gettimeoffset = mac_gettimeoffset; |
179 | 174 | #warning move to adb/via init |
180 | 175 | #if 0 |
arch/m68k/mac/iop.c
... | ... | @@ -317,7 +317,7 @@ |
317 | 317 | { |
318 | 318 | if (iop_ism_present) { |
319 | 319 | if (oss_present) { |
320 | - cpu_request_irq(OSS_IRQLEV_IOPISM, iop_ism_irq, | |
320 | + request_irq(OSS_IRQLEV_IOPISM, iop_ism_irq, | |
321 | 321 | IRQ_FLG_LOCK, "ISM IOP", |
322 | 322 | (void *) IOP_NUM_ISM); |
323 | 323 | oss_irq_enable(IRQ_MAC_ADB); |
arch/m68k/mac/macints.c
... | ... | @@ -137,14 +137,6 @@ |
137 | 137 | #define DEBUG_SPURIOUS |
138 | 138 | #define SHUTUP_SONIC |
139 | 139 | |
140 | -/* | |
141 | - * The mac_irq_list array is an array of linked lists of irq_node_t nodes. | |
142 | - * Each node contains one handler to be called whenever the interrupt | |
143 | - * occurs, with fast handlers listed before slow handlers. | |
144 | - */ | |
145 | - | |
146 | -irq_node_t *mac_irq_list[NUM_MAC_SOURCES]; | |
147 | - | |
148 | 140 | /* SCC interrupt mask */ |
149 | 141 | |
150 | 142 | static int scc_mask; |
... | ... | @@ -209,8 +201,8 @@ |
209 | 201 | * SCC interrupt routines |
210 | 202 | */ |
211 | 203 | |
212 | -static void scc_irq_enable(int); | |
213 | -static void scc_irq_disable(int); | |
204 | +static void scc_irq_enable(unsigned int); | |
205 | +static void scc_irq_disable(unsigned int); | |
214 | 206 | |
215 | 207 | /* |
216 | 208 | * console_loglevel determines NMI handler function |
217 | 209 | |
218 | 210 | |
219 | 211 | |
... | ... | @@ -221,21 +213,25 @@ |
221 | 213 | |
222 | 214 | /* #define DEBUG_MACINTS */ |
223 | 215 | |
216 | +static void mac_enable_irq(unsigned int irq); | |
217 | +static void mac_disable_irq(unsigned int irq); | |
218 | + | |
219 | +static struct irq_controller mac_irq_controller = { | |
220 | + .name = "mac", | |
221 | + .lock = SPIN_LOCK_UNLOCKED, | |
222 | + .enable = mac_enable_irq, | |
223 | + .disable = mac_disable_irq, | |
224 | +}; | |
225 | + | |
224 | 226 | void mac_init_IRQ(void) |
225 | 227 | { |
226 | - int i; | |
227 | - | |
228 | 228 | #ifdef DEBUG_MACINTS |
229 | 229 | printk("mac_init_IRQ(): Setting things up...\n"); |
230 | 230 | #endif |
231 | - /* Initialize the IRQ handler lists. Initially each list is empty, */ | |
232 | - | |
233 | - for (i = 0; i < NUM_MAC_SOURCES; i++) { | |
234 | - mac_irq_list[i] = NULL; | |
235 | - } | |
236 | - | |
237 | 231 | scc_mask = 0; |
238 | 232 | |
233 | + m68k_setup_irq_controller(&mac_irq_controller, IRQ_USER, | |
234 | + NUM_MAC_SOURCES - IRQ_USER); | |
239 | 235 | /* Make sure the SONIC interrupt is cleared or things get ugly */ |
240 | 236 | #ifdef SHUTUP_SONIC |
241 | 237 | printk("Killing onboard sonic... "); |
242 | 238 | |
243 | 239 | |
244 | 240 | |
... | ... | @@ -252,15 +248,16 @@ |
252 | 248 | * at levels 1-7. Most of the work is done elsewhere. |
253 | 249 | */ |
254 | 250 | |
255 | - if (oss_present) { | |
251 | + if (oss_present) | |
256 | 252 | oss_register_interrupts(); |
257 | - } else { | |
253 | + else | |
258 | 254 | via_register_interrupts(); |
259 | - } | |
260 | - if (psc_present) psc_register_interrupts(); | |
261 | - if (baboon_present) baboon_register_interrupts(); | |
255 | + if (psc_present) | |
256 | + psc_register_interrupts(); | |
257 | + if (baboon_present) | |
258 | + baboon_register_interrupts(); | |
262 | 259 | iop_register_interrupts(); |
263 | - cpu_request_irq(7, mac_nmi_handler, IRQ_FLG_LOCK, "NMI", | |
260 | + request_irq(IRQ_AUTO_7, mac_nmi_handler, 0, "NMI", | |
264 | 261 | mac_nmi_handler); |
265 | 262 | #ifdef DEBUG_MACINTS |
266 | 263 | printk("mac_init_IRQ(): Done!\n"); |
... | ... | @@ -268,104 +265,6 @@ |
268 | 265 | } |
269 | 266 | |
270 | 267 | /* |
271 | - * Routines to work with irq_node_t's on linked lists lifted from | |
272 | - * the Amiga code written by Roman Zippel. | |
273 | - */ | |
274 | - | |
275 | -static inline void mac_insert_irq(irq_node_t **list, irq_node_t *node) | |
276 | -{ | |
277 | - unsigned long flags; | |
278 | - irq_node_t *cur; | |
279 | - | |
280 | - if (!node->dev_id) | |
281 | - printk("%s: Warning: dev_id of %s is zero\n", | |
282 | - __FUNCTION__, node->devname); | |
283 | - | |
284 | - local_irq_save(flags); | |
285 | - | |
286 | - cur = *list; | |
287 | - | |
288 | - if (node->flags & IRQ_FLG_FAST) { | |
289 | - node->flags &= ~IRQ_FLG_SLOW; | |
290 | - while (cur && cur->flags & IRQ_FLG_FAST) { | |
291 | - list = &cur->next; | |
292 | - cur = cur->next; | |
293 | - } | |
294 | - } else if (node->flags & IRQ_FLG_SLOW) { | |
295 | - while (cur) { | |
296 | - list = &cur->next; | |
297 | - cur = cur->next; | |
298 | - } | |
299 | - } else { | |
300 | - while (cur && !(cur->flags & IRQ_FLG_SLOW)) { | |
301 | - list = &cur->next; | |
302 | - cur = cur->next; | |
303 | - } | |
304 | - } | |
305 | - | |
306 | - node->next = cur; | |
307 | - *list = node; | |
308 | - | |
309 | - local_irq_restore(flags); | |
310 | -} | |
311 | - | |
312 | -static inline void mac_delete_irq(irq_node_t **list, void *dev_id) | |
313 | -{ | |
314 | - unsigned long flags; | |
315 | - irq_node_t *node; | |
316 | - | |
317 | - local_irq_save(flags); | |
318 | - | |
319 | - for (node = *list; node; list = &node->next, node = *list) { | |
320 | - if (node->dev_id == dev_id) { | |
321 | - *list = node->next; | |
322 | - /* Mark it as free. */ | |
323 | - node->handler = NULL; | |
324 | - local_irq_restore(flags); | |
325 | - return; | |
326 | - } | |
327 | - } | |
328 | - local_irq_restore(flags); | |
329 | - printk ("%s: tried to remove invalid irq\n", __FUNCTION__); | |
330 | -} | |
331 | - | |
332 | -/* | |
333 | - * Call all the handlers for a given interrupt. Fast handlers are called | |
334 | - * first followed by slow handlers. | |
335 | - * | |
336 | - * This code taken from the original Amiga code written by Roman Zippel. | |
337 | - */ | |
338 | - | |
339 | -void mac_do_irq_list(int irq, struct pt_regs *fp) | |
340 | -{ | |
341 | - irq_node_t *node, *slow_nodes; | |
342 | - unsigned long flags; | |
343 | - | |
344 | - kstat_cpu(0).irqs[irq]++; | |
345 | - | |
346 | -#ifdef DEBUG_SPURIOUS | |
347 | - if (!mac_irq_list[irq] && (console_loglevel > 7)) { | |
348 | - printk("mac_do_irq_list: spurious interrupt %d!\n", irq); | |
349 | - return; | |
350 | - } | |
351 | -#endif | |
352 | - | |
353 | - /* serve first fast and normal handlers */ | |
354 | - for (node = mac_irq_list[irq]; | |
355 | - node && (!(node->flags & IRQ_FLG_SLOW)); | |
356 | - node = node->next) | |
357 | - node->handler(irq, node->dev_id, fp); | |
358 | - if (!node) return; | |
359 | - local_save_flags(flags); | |
360 | - local_irq_restore((flags & ~0x0700) | (fp->sr & 0x0700)); | |
361 | - /* if slow handlers exists, serve them now */ | |
362 | - slow_nodes = node; | |
363 | - for (; node; node = node->next) { | |
364 | - node->handler(irq, node->dev_id, fp); | |
365 | - } | |
366 | -} | |
367 | - | |
368 | -/* | |
369 | 268 | * mac_enable_irq - enable an interrupt source |
370 | 269 | * mac_disable_irq - disable an interrupt source |
371 | 270 | * mac_clear_irq - clears a pending interrupt |
372 | 271 | |
373 | 272 | |
374 | 273 | |
375 | 274 | |
376 | 275 | |
377 | 276 | |
378 | 277 | |
379 | 278 | |
380 | 279 | |
381 | 280 | |
... | ... | @@ -374,269 +273,124 @@ |
374 | 273 | * These routines are just dispatchers to the VIA/OSS/PSC routines. |
375 | 274 | */ |
376 | 275 | |
377 | -void mac_enable_irq (unsigned int irq) | |
276 | +static void mac_enable_irq(unsigned int irq) | |
378 | 277 | { |
379 | - int irq_src = IRQ_SRC(irq); | |
278 | + int irq_src = IRQ_SRC(irq); | |
380 | 279 | |
381 | 280 | switch(irq_src) { |
382 | - case 1: via_irq_enable(irq); | |
383 | - break; | |
384 | - case 2: | |
385 | - case 7: if (oss_present) { | |
386 | - oss_irq_enable(irq); | |
387 | - } else { | |
388 | - via_irq_enable(irq); | |
389 | - } | |
390 | - break; | |
391 | - case 3: | |
392 | - case 4: | |
393 | - case 5: | |
394 | - case 6: if (psc_present) { | |
395 | - psc_irq_enable(irq); | |
396 | - } else if (oss_present) { | |
397 | - oss_irq_enable(irq); | |
398 | - } else if (irq_src == 4) { | |
399 | - scc_irq_enable(irq); | |
400 | - } | |
401 | - break; | |
402 | - case 8: if (baboon_present) { | |
403 | - baboon_irq_enable(irq); | |
404 | - } | |
405 | - break; | |
281 | + case 1: | |
282 | + via_irq_enable(irq); | |
283 | + break; | |
284 | + case 2: | |
285 | + case 7: | |
286 | + if (oss_present) | |
287 | + oss_irq_enable(irq); | |
288 | + else | |
289 | + via_irq_enable(irq); | |
290 | + break; | |
291 | + case 3: | |
292 | + case 4: | |
293 | + case 5: | |
294 | + case 6: | |
295 | + if (psc_present) | |
296 | + psc_irq_enable(irq); | |
297 | + else if (oss_present) | |
298 | + oss_irq_enable(irq); | |
299 | + else if (irq_src == 4) | |
300 | + scc_irq_enable(irq); | |
301 | + break; | |
302 | + case 8: | |
303 | + if (baboon_present) | |
304 | + baboon_irq_enable(irq); | |
305 | + break; | |
406 | 306 | } |
407 | 307 | } |
408 | 308 | |
409 | -void mac_disable_irq (unsigned int irq) | |
309 | +static void mac_disable_irq(unsigned int irq) | |
410 | 310 | { |
411 | - int irq_src = IRQ_SRC(irq); | |
311 | + int irq_src = IRQ_SRC(irq); | |
412 | 312 | |
413 | 313 | switch(irq_src) { |
414 | - case 1: via_irq_disable(irq); | |
415 | - break; | |
416 | - case 2: | |
417 | - case 7: if (oss_present) { | |
418 | - oss_irq_disable(irq); | |
419 | - } else { | |
420 | - via_irq_disable(irq); | |
421 | - } | |
422 | - break; | |
423 | - case 3: | |
424 | - case 4: | |
425 | - case 5: | |
426 | - case 6: if (psc_present) { | |
427 | - psc_irq_disable(irq); | |
428 | - } else if (oss_present) { | |
429 | - oss_irq_disable(irq); | |
430 | - } else if (irq_src == 4) { | |
431 | - scc_irq_disable(irq); | |
432 | - } | |
433 | - break; | |
434 | - case 8: if (baboon_present) { | |
435 | - baboon_irq_disable(irq); | |
436 | - } | |
437 | - break; | |
314 | + case 1: | |
315 | + via_irq_disable(irq); | |
316 | + break; | |
317 | + case 2: | |
318 | + case 7: | |
319 | + if (oss_present) | |
320 | + oss_irq_disable(irq); | |
321 | + else | |
322 | + via_irq_disable(irq); | |
323 | + break; | |
324 | + case 3: | |
325 | + case 4: | |
326 | + case 5: | |
327 | + case 6: | |
328 | + if (psc_present) | |
329 | + psc_irq_disable(irq); | |
330 | + else if (oss_present) | |
331 | + oss_irq_disable(irq); | |
332 | + else if (irq_src == 4) | |
333 | + scc_irq_disable(irq); | |
334 | + break; | |
335 | + case 8: | |
336 | + if (baboon_present) | |
337 | + baboon_irq_disable(irq); | |
338 | + break; | |
438 | 339 | } |
439 | 340 | } |
440 | 341 | |
441 | -void mac_clear_irq( unsigned int irq ) | |
342 | +void mac_clear_irq(unsigned int irq) | |
442 | 343 | { |
443 | 344 | switch(IRQ_SRC(irq)) { |
444 | - case 1: via_irq_clear(irq); | |
445 | - break; | |
446 | - case 2: | |
447 | - case 7: if (oss_present) { | |
448 | - oss_irq_clear(irq); | |
449 | - } else { | |
450 | - via_irq_clear(irq); | |
451 | - } | |
452 | - break; | |
453 | - case 3: | |
454 | - case 4: | |
455 | - case 5: | |
456 | - case 6: if (psc_present) { | |
457 | - psc_irq_clear(irq); | |
458 | - } else if (oss_present) { | |
459 | - oss_irq_clear(irq); | |
460 | - } | |
461 | - break; | |
462 | - case 8: if (baboon_present) { | |
463 | - baboon_irq_clear(irq); | |
464 | - } | |
465 | - break; | |
345 | + case 1: | |
346 | + via_irq_clear(irq); | |
347 | + break; | |
348 | + case 2: | |
349 | + case 7: | |
350 | + if (oss_present) | |
351 | + oss_irq_clear(irq); | |
352 | + else | |
353 | + via_irq_clear(irq); | |
354 | + break; | |
355 | + case 3: | |
356 | + case 4: | |
357 | + case 5: | |
358 | + case 6: | |
359 | + if (psc_present) | |
360 | + psc_irq_clear(irq); | |
361 | + else if (oss_present) | |
362 | + oss_irq_clear(irq); | |
363 | + break; | |
364 | + case 8: | |
365 | + if (baboon_present) | |
366 | + baboon_irq_clear(irq); | |
367 | + break; | |
466 | 368 | } |
467 | 369 | } |
468 | 370 | |
469 | -int mac_irq_pending( unsigned int irq ) | |
371 | +int mac_irq_pending(unsigned int irq) | |
470 | 372 | { |
471 | 373 | switch(IRQ_SRC(irq)) { |
472 | - case 1: return via_irq_pending(irq); | |
473 | - case 2: | |
474 | - case 7: if (oss_present) { | |
475 | - return oss_irq_pending(irq); | |
476 | - } else { | |
477 | - return via_irq_pending(irq); | |
478 | - } | |
479 | - case 3: | |
480 | - case 4: | |
481 | - case 5: | |
482 | - case 6: if (psc_present) { | |
483 | - return psc_irq_pending(irq); | |
484 | - } else if (oss_present) { | |
485 | - return oss_irq_pending(irq); | |
486 | - } | |
374 | + case 1: | |
375 | + return via_irq_pending(irq); | |
376 | + case 2: | |
377 | + case 7: | |
378 | + if (oss_present) | |
379 | + return oss_irq_pending(irq); | |
380 | + else | |
381 | + return via_irq_pending(irq); | |
382 | + case 3: | |
383 | + case 4: | |
384 | + case 5: | |
385 | + case 6: | |
386 | + if (psc_present) | |
387 | + return psc_irq_pending(irq); | |
388 | + else if (oss_present) | |
389 | + return oss_irq_pending(irq); | |
487 | 390 | } |
488 | 391 | return 0; |
489 | 392 | } |
490 | 393 | |
491 | -/* | |
492 | - * Add an interrupt service routine to an interrupt source. | |
493 | - * Returns 0 on success. | |
494 | - * | |
495 | - * FIXME: You can register interrupts on nonexistent source (ie PSC4 on a | |
496 | - * non-PSC machine). We should return -EINVAL in those cases. | |
497 | - */ | |
498 | - | |
499 | -int mac_request_irq(unsigned int irq, | |
500 | - irqreturn_t (*handler)(int, void *, struct pt_regs *), | |
501 | - unsigned long flags, const char *devname, void *dev_id) | |
502 | -{ | |
503 | - irq_node_t *node; | |
504 | - | |
505 | -#ifdef DEBUG_MACINTS | |
506 | - printk ("%s: irq %d requested for %s\n", __FUNCTION__, irq, devname); | |
507 | -#endif | |
508 | - | |
509 | - if (irq < VIA1_SOURCE_BASE) { | |
510 | - return cpu_request_irq(irq, handler, flags, devname, dev_id); | |
511 | - } | |
512 | - | |
513 | - if (irq >= NUM_MAC_SOURCES) { | |
514 | - printk ("%s: unknown irq %d requested by %s\n", | |
515 | - __FUNCTION__, irq, devname); | |
516 | - } | |
517 | - | |
518 | - /* Get a node and stick it onto the right list */ | |
519 | - | |
520 | - if (!(node = new_irq_node())) return -ENOMEM; | |
521 | - | |
522 | - node->handler = handler; | |
523 | - node->flags = flags; | |
524 | - node->dev_id = dev_id; | |
525 | - node->devname = devname; | |
526 | - node->next = NULL; | |
527 | - mac_insert_irq(&mac_irq_list[irq], node); | |
528 | - | |
529 | - /* Now enable the IRQ source */ | |
530 | - | |
531 | - mac_enable_irq(irq); | |
532 | - | |
533 | - return 0; | |
534 | -} | |
535 | - | |
536 | -/* | |
537 | - * Removes an interrupt service routine from an interrupt source. | |
538 | - */ | |
539 | - | |
540 | -void mac_free_irq(unsigned int irq, void *dev_id) | |
541 | -{ | |
542 | -#ifdef DEBUG_MACINTS | |
543 | - printk ("%s: irq %d freed by %p\n", __FUNCTION__, irq, dev_id); | |
544 | -#endif | |
545 | - | |
546 | - if (irq < VIA1_SOURCE_BASE) { | |
547 | - cpu_free_irq(irq, dev_id); | |
548 | - return; | |
549 | - } | |
550 | - | |
551 | - if (irq >= NUM_MAC_SOURCES) { | |
552 | - printk ("%s: unknown irq %d freed\n", | |
553 | - __FUNCTION__, irq); | |
554 | - return; | |
555 | - } | |
556 | - | |
557 | - mac_delete_irq(&mac_irq_list[irq], dev_id); | |
558 | - | |
559 | - /* If the list for this interrupt is */ | |
560 | - /* empty then disable the source. */ | |
561 | - | |
562 | - if (!mac_irq_list[irq]) { | |
563 | - mac_disable_irq(irq); | |
564 | - } | |
565 | -} | |
566 | - | |
567 | -/* | |
568 | - * Generate a pretty listing for /proc/interrupts | |
569 | - * | |
570 | - * By the time we're called the autovector interrupt list has already been | |
571 | - * generated, so we just need to do the machspec interrupts. | |
572 | - * | |
573 | - * 990506 (jmt) - rewritten to handle chained machspec interrupt handlers. | |
574 | - * Also removed display of num_spurious it is already | |
575 | - * displayed for us as autovector irq 0. | |
576 | - */ | |
577 | - | |
578 | -int show_mac_interrupts(struct seq_file *p, void *v) | |
579 | -{ | |
580 | - int i; | |
581 | - irq_node_t *node; | |
582 | - char *base; | |
583 | - | |
584 | - /* Don't do Nubus interrupts in this loop; we do them separately */ | |
585 | - /* below so that we can print slot numbers instead of IRQ numbers */ | |
586 | - | |
587 | - for (i = VIA1_SOURCE_BASE ; i < NUM_MAC_SOURCES ; ++i) { | |
588 | - | |
589 | - /* Nonexistant interrupt or nothing registered; skip it. */ | |
590 | - | |
591 | - if ((node = mac_irq_list[i]) == NULL) continue; | |
592 | - if (node->flags & IRQ_FLG_STD) continue; | |
593 | - | |
594 | - base = ""; | |
595 | - switch(IRQ_SRC(i)) { | |
596 | - case 1: base = "via1"; | |
597 | - break; | |
598 | - case 2: if (oss_present) { | |
599 | - base = "oss"; | |
600 | - } else { | |
601 | - base = "via2"; | |
602 | - } | |
603 | - break; | |
604 | - case 3: | |
605 | - case 4: | |
606 | - case 5: | |
607 | - case 6: if (psc_present) { | |
608 | - base = "psc"; | |
609 | - } else if (oss_present) { | |
610 | - base = "oss"; | |
611 | - } else { | |
612 | - if (IRQ_SRC(i) == 4) base = "scc"; | |
613 | - } | |
614 | - break; | |
615 | - case 7: base = "nbus"; | |
616 | - break; | |
617 | - case 8: base = "bbn"; | |
618 | - break; | |
619 | - } | |
620 | - seq_printf(p, "%4s %2d: %10u ", base, i, kstat_cpu(0).irqs[i]); | |
621 | - | |
622 | - do { | |
623 | - if (node->flags & IRQ_FLG_FAST) { | |
624 | - seq_puts(p, "F "); | |
625 | - } else if (node->flags & IRQ_FLG_SLOW) { | |
626 | - seq_puts(p, "S "); | |
627 | - } else { | |
628 | - seq_puts(p, " "); | |
629 | - } | |
630 | - seq_printf(p, "%s\n", node->devname); | |
631 | - if ((node = node->next)) { | |
632 | - seq_puts(p, " "); | |
633 | - } | |
634 | - } while(node); | |
635 | - | |
636 | - } | |
637 | - return 0; | |
638 | -} | |
639 | - | |
640 | 394 | static int num_debug[8]; |
641 | 395 | |
642 | 396 | irqreturn_t mac_debug_handler(int irq, void *dev_id, struct pt_regs *regs) |
... | ... | @@ -676,7 +430,7 @@ |
676 | 430 | while (nmi_hold == 1) |
677 | 431 | udelay(1000); |
678 | 432 | |
679 | - if ( console_loglevel >= 8 ) { | |
433 | + if (console_loglevel >= 8) { | |
680 | 434 | #if 0 |
681 | 435 | show_state(); |
682 | 436 | printk("PC: %08lx\nSR: %04x SP: %p\n", fp->pc, fp->sr, fp); |
683 | 437 | |
... | ... | @@ -705,14 +459,16 @@ |
705 | 459 | * done in hardware (only the PSC can do that.) |
706 | 460 | */ |
707 | 461 | |
708 | -static void scc_irq_enable(int irq) { | |
709 | - int irq_idx = IRQ_IDX(irq); | |
462 | +static void scc_irq_enable(unsigned int irq) | |
463 | +{ | |
464 | + int irq_idx = IRQ_IDX(irq); | |
710 | 465 | |
711 | 466 | scc_mask |= (1 << irq_idx); |
712 | 467 | } |
713 | 468 | |
714 | -static void scc_irq_disable(int irq) { | |
715 | - int irq_idx = IRQ_IDX(irq); | |
469 | +static void scc_irq_disable(unsigned int irq) | |
470 | +{ | |
471 | + int irq_idx = IRQ_IDX(irq); | |
716 | 472 | |
717 | 473 | scc_mask &= ~(1 << irq_idx); |
718 | 474 | } |
... | ... | @@ -747,7 +503,9 @@ |
747 | 503 | /* and since they're autovector interrupts they */ |
748 | 504 | /* pretty much kill the system. */ |
749 | 505 | |
750 | - if (reg & 0x38) mac_do_irq_list(IRQ_SCCA, regs); | |
751 | - if (reg & 0x07) mac_do_irq_list(IRQ_SCCB, regs); | |
506 | + if (reg & 0x38) | |
507 | + m68k_handle_int(IRQ_SCCA, regs); | |
508 | + if (reg & 0x07) | |
509 | + m68k_handle_int(IRQ_SCCB, regs); | |
752 | 510 | } |
arch/m68k/mac/oss.c
... | ... | @@ -67,15 +67,15 @@ |
67 | 67 | |
68 | 68 | void __init oss_register_interrupts(void) |
69 | 69 | { |
70 | - cpu_request_irq(OSS_IRQLEV_SCSI, oss_irq, IRQ_FLG_LOCK, | |
70 | + request_irq(OSS_IRQLEV_SCSI, oss_irq, IRQ_FLG_LOCK, | |
71 | 71 | "scsi", (void *) oss); |
72 | - cpu_request_irq(OSS_IRQLEV_IOPSCC, mac_scc_dispatch, IRQ_FLG_LOCK, | |
72 | + request_irq(OSS_IRQLEV_IOPSCC, mac_scc_dispatch, IRQ_FLG_LOCK, | |
73 | 73 | "scc", mac_scc_dispatch); |
74 | - cpu_request_irq(OSS_IRQLEV_NUBUS, oss_nubus_irq, IRQ_FLG_LOCK, | |
74 | + request_irq(OSS_IRQLEV_NUBUS, oss_nubus_irq, IRQ_FLG_LOCK, | |
75 | 75 | "nubus", (void *) oss); |
76 | - cpu_request_irq(OSS_IRQLEV_SOUND, oss_irq, IRQ_FLG_LOCK, | |
76 | + request_irq(OSS_IRQLEV_SOUND, oss_irq, IRQ_FLG_LOCK, | |
77 | 77 | "sound", (void *) oss); |
78 | - cpu_request_irq(OSS_IRQLEV_VIA1, via1_irq, IRQ_FLG_LOCK, | |
78 | + request_irq(OSS_IRQLEV_VIA1, via1_irq, IRQ_FLG_LOCK, | |
79 | 79 | "via1", (void *) via1); |
80 | 80 | } |
81 | 81 | |
... | ... | @@ -113,7 +113,7 @@ |
113 | 113 | oss->irq_pending &= ~OSS_IP_SOUND; |
114 | 114 | } else if (events & OSS_IP_SCSI) { |
115 | 115 | oss->irq_level[OSS_SCSI] = OSS_IRQLEV_DISABLED; |
116 | - mac_do_irq_list(IRQ_MAC_SCSI, regs); | |
116 | + m68k_handle_int(IRQ_MAC_SCSI, regs); | |
117 | 117 | oss->irq_pending &= ~OSS_IP_SCSI; |
118 | 118 | oss->irq_level[OSS_SCSI] = OSS_IRQLEV_SCSI; |
119 | 119 | } else { |
... | ... | @@ -146,7 +146,7 @@ |
146 | 146 | for (i = 0, irq_bit = 1 ; i < 6 ; i++, irq_bit <<= 1) { |
147 | 147 | if (events & irq_bit) { |
148 | 148 | oss->irq_level[i] = OSS_IRQLEV_DISABLED; |
149 | - mac_do_irq_list(NUBUS_SOURCE_BASE + i, regs); | |
149 | + m68k_handle_int(NUBUS_SOURCE_BASE + i, regs); | |
150 | 150 | oss->irq_pending &= ~irq_bit; |
151 | 151 | oss->irq_level[i] = OSS_IRQLEV_NUBUS; |
152 | 152 | } |
arch/m68k/mac/psc.c
... | ... | @@ -117,10 +117,10 @@ |
117 | 117 | |
118 | 118 | void __init psc_register_interrupts(void) |
119 | 119 | { |
120 | - cpu_request_irq(3, psc_irq, IRQ_FLG_LOCK, "psc3", (void *) 0x30); | |
121 | - cpu_request_irq(4, psc_irq, IRQ_FLG_LOCK, "psc4", (void *) 0x40); | |
122 | - cpu_request_irq(5, psc_irq, IRQ_FLG_LOCK, "psc5", (void *) 0x50); | |
123 | - cpu_request_irq(6, psc_irq, IRQ_FLG_LOCK, "psc6", (void *) 0x60); | |
120 | + request_irq(IRQ_AUTO_3, psc_irq, 0, "psc3", (void *) 0x30); | |
121 | + request_irq(IRQ_AUTO_4, psc_irq, 0, "psc4", (void *) 0x40); | |
122 | + request_irq(IRQ_AUTO_5, psc_irq, 0, "psc5", (void *) 0x50); | |
123 | + request_irq(IRQ_AUTO_6, psc_irq, 0, "psc6", (void *) 0x60); | |
124 | 124 | } |
125 | 125 | |
126 | 126 | /* |
... | ... | @@ -149,7 +149,7 @@ |
149 | 149 | for (i = 0, irq_bit = 1 ; i < 4 ; i++, irq_bit <<= 1) { |
150 | 150 | if (events & irq_bit) { |
151 | 151 | psc_write_byte(pIER, irq_bit); |
152 | - mac_do_irq_list(base_irq + i, regs); | |
152 | + m68k_handle_int(base_irq + i, regs); | |
153 | 153 | psc_write_byte(pIFR, irq_bit); |
154 | 154 | psc_write_byte(pIER, irq_bit | 0x80); |
155 | 155 | } |
arch/m68k/mac/via.c
... | ... | @@ -253,21 +253,21 @@ |
253 | 253 | void __init via_register_interrupts(void) |
254 | 254 | { |
255 | 255 | if (via_alt_mapping) { |
256 | - cpu_request_irq(IRQ_AUTO_1, via1_irq, | |
256 | + request_irq(IRQ_AUTO_1, via1_irq, | |
257 | 257 | IRQ_FLG_LOCK|IRQ_FLG_FAST, "software", |
258 | 258 | (void *) via1); |
259 | - cpu_request_irq(IRQ_AUTO_6, via1_irq, | |
259 | + request_irq(IRQ_AUTO_6, via1_irq, | |
260 | 260 | IRQ_FLG_LOCK|IRQ_FLG_FAST, "via1", |
261 | 261 | (void *) via1); |
262 | 262 | } else { |
263 | - cpu_request_irq(IRQ_AUTO_1, via1_irq, | |
263 | + request_irq(IRQ_AUTO_1, via1_irq, | |
264 | 264 | IRQ_FLG_LOCK|IRQ_FLG_FAST, "via1", |
265 | 265 | (void *) via1); |
266 | 266 | } |
267 | - cpu_request_irq(IRQ_AUTO_2, via2_irq, IRQ_FLG_LOCK|IRQ_FLG_FAST, | |
267 | + request_irq(IRQ_AUTO_2, via2_irq, IRQ_FLG_LOCK|IRQ_FLG_FAST, | |
268 | 268 | "via2", (void *) via2); |
269 | 269 | if (!psc_present) { |
270 | - cpu_request_irq(IRQ_AUTO_4, mac_scc_dispatch, IRQ_FLG_LOCK, | |
270 | + request_irq(IRQ_AUTO_4, mac_scc_dispatch, IRQ_FLG_LOCK, | |
271 | 271 | "scc", mac_scc_dispatch); |
272 | 272 | } |
273 | 273 | request_irq(IRQ_MAC_NUBUS, via_nubus_irq, IRQ_FLG_LOCK|IRQ_FLG_FAST, |
... | ... | @@ -424,7 +424,7 @@ |
424 | 424 | for (i = 0, irq_bit = 1 ; i < 7 ; i++, irq_bit <<= 1) |
425 | 425 | if (events & irq_bit) { |
426 | 426 | via1[vIER] = irq_bit; |
427 | - mac_do_irq_list(VIA1_SOURCE_BASE + i, regs); | |
427 | + m68k_handle_int(VIA1_SOURCE_BASE + i, regs); | |
428 | 428 | via1[vIFR] = irq_bit; |
429 | 429 | via1[vIER] = irq_bit | 0x80; |
430 | 430 | } |
... | ... | @@ -439,7 +439,7 @@ |
439 | 439 | /* No, it won't be set. that's why we're doing this. */ |
440 | 440 | via_irq_disable(IRQ_MAC_NUBUS); |
441 | 441 | via_irq_clear(IRQ_MAC_NUBUS); |
442 | - mac_do_irq_list(IRQ_MAC_NUBUS, regs); | |
442 | + m68k_handle_int(IRQ_MAC_NUBUS, regs); | |
443 | 443 | via_irq_enable(IRQ_MAC_NUBUS); |
444 | 444 | } |
445 | 445 | #endif |
... | ... | @@ -459,7 +459,7 @@ |
459 | 459 | if (events & irq_bit) { |
460 | 460 | via2[gIER] = irq_bit; |
461 | 461 | via2[gIFR] = irq_bit | rbv_clear; |
462 | - mac_do_irq_list(VIA2_SOURCE_BASE + i, regs); | |
462 | + m68k_handle_int(VIA2_SOURCE_BASE + i, regs); | |
463 | 463 | via2[gIER] = irq_bit | 0x80; |
464 | 464 | } |
465 | 465 | return IRQ_HANDLED; |
... | ... | @@ -481,7 +481,7 @@ |
481 | 481 | for (i = 0, irq_bit = 1 ; i < 7 ; i++, irq_bit <<= 1) { |
482 | 482 | if (events & irq_bit) { |
483 | 483 | via_irq_disable(NUBUS_SOURCE_BASE + i); |
484 | - mac_do_irq_list(NUBUS_SOURCE_BASE + i, regs); | |
484 | + m68k_handle_int(NUBUS_SOURCE_BASE + i, regs); | |
485 | 485 | via_irq_enable(NUBUS_SOURCE_BASE + i); |
486 | 486 | } |
487 | 487 | } |
drivers/scsi/mac_esp.c
... | ... | @@ -43,9 +43,6 @@ |
43 | 43 | |
44 | 44 | /* #define DEBUG_MAC_ESP */ |
45 | 45 | |
46 | -#define mac_turnon_irq(x) mac_enable_irq(x) | |
47 | -#define mac_turnoff_irq(x) mac_disable_irq(x) | |
48 | - | |
49 | 46 | extern void esp_handle(struct NCR_ESP *esp); |
50 | 47 | extern void mac_esp_intr(int irq, void *dev_id, struct pt_regs *pregs); |
51 | 48 | |
52 | 49 | |
... | ... | @@ -639,13 +636,13 @@ |
639 | 636 | |
640 | 637 | static void dma_ints_off(struct NCR_ESP * esp) |
641 | 638 | { |
642 | - mac_turnoff_irq(esp->irq); | |
639 | + disable_irq(esp->irq); | |
643 | 640 | } |
644 | 641 | |
645 | 642 | |
646 | 643 | static void dma_ints_on(struct NCR_ESP * esp) |
647 | 644 | { |
648 | - mac_turnon_irq(esp->irq); | |
645 | + enable_irq(esp->irq); | |
649 | 646 | } |
650 | 647 | |
651 | 648 | /* |
drivers/scsi/mac_scsi.c
... | ... | @@ -65,9 +65,6 @@ |
65 | 65 | #define RESET_BOOT |
66 | 66 | #define DRIVER_SETUP |
67 | 67 | |
68 | -#define ENABLE_IRQ() mac_enable_irq( IRQ_MAC_SCSI ); | |
69 | -#define DISABLE_IRQ() mac_disable_irq( IRQ_MAC_SCSI ); | |
70 | - | |
71 | 68 | extern void via_scsi_clear(void); |
72 | 69 | |
73 | 70 | #ifdef RESET_BOOT |
... | ... | @@ -351,7 +348,7 @@ |
351 | 348 | printk(KERN_INFO "Macintosh SCSI: resetting the SCSI bus..." ); |
352 | 349 | |
353 | 350 | /* switch off SCSI IRQ - catch an interrupt without IRQ bit set else */ |
354 | - mac_disable_irq(IRQ_MAC_SCSI); | |
351 | + disable_irq(IRQ_MAC_SCSI); | |
355 | 352 | |
356 | 353 | /* get in phase */ |
357 | 354 | NCR5380_write( TARGET_COMMAND_REG, |
... | ... | @@ -369,7 +366,7 @@ |
369 | 366 | barrier(); |
370 | 367 | |
371 | 368 | /* switch on SCSI IRQ again */ |
372 | - mac_enable_irq(IRQ_MAC_SCSI); | |
369 | + enable_irq(IRQ_MAC_SCSI); | |
373 | 370 | |
374 | 371 | printk(KERN_INFO " done\n" ); |
375 | 372 | } |
include/asm-m68k/mac_oss.h
... | ... | @@ -69,12 +69,12 @@ |
69 | 69 | |
70 | 70 | #define OSS_IRQLEV_DISABLED 0 |
71 | 71 | #define OSS_IRQLEV_IOPISM 1 /* ADB? */ |
72 | -#define OSS_IRQLEV_SCSI 2 | |
73 | -#define OSS_IRQLEV_NUBUS 3 /* keep this on its own level */ | |
74 | -#define OSS_IRQLEV_IOPSCC 4 /* matches VIA alternate mapping */ | |
75 | -#define OSS_IRQLEV_SOUND 5 /* matches VIA alternate mapping */ | |
72 | +#define OSS_IRQLEV_SCSI IRQ_AUTO_2 | |
73 | +#define OSS_IRQLEV_NUBUS IRQ_AUTO_3 /* keep this on its own level */ | |
74 | +#define OSS_IRQLEV_IOPSCC IRQ_AUTO_4 /* matches VIA alternate mapping */ | |
75 | +#define OSS_IRQLEV_SOUND IRQ_AUTO_5 /* matches VIA alternate mapping */ | |
76 | 76 | #define OSS_IRQLEV_60HZ 6 /* matches VIA alternate mapping */ |
77 | -#define OSS_IRQLEV_VIA1 6 /* matches VIA alternate mapping */ | |
77 | +#define OSS_IRQLEV_VIA1 IRQ_AUTO_6 /* matches VIA alternate mapping */ | |
78 | 78 | #define OSS_IRQLEV_PARITY 7 /* matches VIA alternate mapping */ |
79 | 79 | |
80 | 80 | #ifndef __ASSEMBLY__ |
include/asm-m68k/macintosh.h
... | ... | @@ -11,17 +11,7 @@ |
11 | 11 | extern void mac_reset(void); |
12 | 12 | extern void mac_poweroff(void); |
13 | 13 | extern void mac_init_IRQ(void); |
14 | -extern int mac_request_irq (unsigned int, irqreturn_t (*)(int, void *, | |
15 | - struct pt_regs *), | |
16 | - unsigned long, const char *, void *); | |
17 | -extern void mac_free_irq(unsigned int, void *); | |
18 | -extern void mac_enable_irq(unsigned int); | |
19 | -extern void mac_disable_irq(unsigned int); | |
20 | 14 | extern int mac_irq_pending(unsigned int); |
21 | -extern int show_mac_interrupts(struct seq_file *, void *); | |
22 | -#if 0 | |
23 | -extern void mac_default_handler(int irq); | |
24 | -#endif | |
25 | 15 | extern void mac_identify(void); |
26 | 16 | extern void mac_report_hardware(void); |
27 | 17 | extern void mac_debugging_penguin(int); |
include/asm-m68k/macints.h
... | ... | @@ -152,8 +152,5 @@ |
152 | 152 | #define INT_CLK 24576 /* CLK while int_clk =2.456MHz and divide = 100 */ |
153 | 153 | #define INT_TICKS 246 /* to make sched_time = 99.902... HZ */ |
154 | 154 | |
155 | -extern irq_node_t *mac_irq_list[NUM_MAC_SOURCES]; | |
156 | -extern void mac_do_irq_list(int irq, struct pt_regs *); | |
157 | - | |
158 | 155 | #endif /* asm/macints.h */ |