+/*
+ * Removes an interrupt service routine from an interrupt source.
+ */
+
+void mac_free_irq(unsigned int irq, void *dev_id)
+{
+#ifdef DEBUG_MACINTS
+ printk ("%s: irq %d freed by %p\n", __FUNCTION__, irq, dev_id);
+#endif
+
+ if (irq < VIA1_SOURCE_BASE) {
+ cpu_free_irq(irq, dev_id);
+ return;
+ }
+
+ if (irq >= NUM_MAC_SOURCES) {
+ printk ("%s: unknown irq %d freed\n",
+ __FUNCTION__, irq);
+ return;
+ }
+
+ mac_delete_irq(&mac_irq_list[irq], dev_id);
+
+ /* If the list for this interrupt is */
+ /* empty then disable the source. */
+
+ if (!mac_irq_list[irq]) {
+ mac_disable_irq(irq);
+ }
+}
+
+/*
+ * Generate a pretty listing for /proc/interrupts
+ *
+ * By the time we're called the autovector interrupt list has already been
+ * generated, so we just need to do the machspec interrupts.
+ *
+ * 990506 (jmt) - rewritten to handle chained machspec interrupt handlers.
+ * Also removed display of num_spurious it is already
+ * displayed for us as autovector irq 0.
+ */
+
+int show_mac_interrupts(struct seq_file *p, void *v)
+{
+ int i;
+ irq_node_t *node;
+ char *base;
+
+ /* Don't do Nubus interrupts in this loop; we do them separately */
+ /* below so that we can print slot numbers instead of IRQ numbers */
+
+ for (i = VIA1_SOURCE_BASE ; i < NUM_MAC_SOURCES ; ++i) {
+
+ /* Nonexistant interrupt or nothing registered; skip it. */
+
+ if ((node = mac_irq_list[i]) == NULL) continue;
+ if (node->flags & IRQ_FLG_STD) continue;
+
+ base = "";
+ switch(IRQ_SRC(i)) {
+ case 1: base = "via1";
+ break;
+ case 2: if (oss_present) {
+ base = "oss";
+ } else {
+ base = "via2";
+ }
+ break;
+ case 3:
+ case 4:
+ case 5:
+ case 6: if (psc_present) {
+ base = "psc";
+ } else if (oss_present) {
+ base = "oss";
+ } else {
+ if (IRQ_SRC(i) == 4) base = "scc";
+ }
+ break;
+ case 7: base = "nbus";
+ break;
+ case 8: base = "bbn";
+ break;
+ }
+ seq_printf(p, "%4s %2d: %10u ", base, i, kstat_cpu(0).irqs[i]);
+
+ do {
+ if (node->flags & IRQ_FLG_FAST) {
+ seq_puts(p, "F ");
+ } else if (node->flags & IRQ_FLG_SLOW) {
+ seq_puts(p, "S ");
+ } else {
+ seq_puts(p, " ");
+ }
+ seq_printf(p, "%s\n", node->devname);
+ if ((node = node->next)) {
+ seq_puts(p, " ");
+ }
+ } while(node);
+
+ }
+ return 0;
+}
+
+void mac_default_handler(int irq, void *dev_id, struct pt_regs *regs)
+{
+#ifdef DEBUG_SPURIOUS
+ printk("Unexpected IRQ %d on device %p\n", irq, dev_id);
+#endif
+}
+