patch-2.2.18 linux/include/asm-m68k/macints.h

Next file: linux/include/asm-m68k/math-emu.h
Previous file: linux/include/asm-m68k/macintosh.h
Back to the patch index
Back to the overall index

diff -u --new-file --recursive --exclude-from /usr/src/exclude v2.2.17/include/asm-m68k/macints.h linux/include/asm-m68k/macints.h
@@ -14,38 +14,49 @@
 
 #include <asm/irq.h>
 
-/*
-** Macintosh Interrupt sources.
-**
-** Note: these are all routed via the generic VIA interrupt routine!
-**
-*/
+/* Setting this prints debugging info for unclaimed interrupts */
+
+#define DEBUG_SPURIOUS
+
+/* Setting this prints debugging info on each autovector interrupt */
+
+/* #define DEBUG_IRQS */
+
+/* Setting this prints debugging info on each Nubus interrupt */
 
-#define SRC_VIA1		0
-#define SRC_VIA2		1
+/* #define DEBUG_NUBUS_INT */
+
+/* Setting this prints debugging info on irqs as they enabled and disabled. */
+
+/* #define DEBUG_IRQUSE */
+
+/*
+ * Base IRQ number for all Mac68K interrupt sources. Each source
+ * has eight indexes (base -> base+7).
+ */
 
 #define VIA1_SOURCE_BASE	8
 #define VIA2_SOURCE_BASE	16
-#define RBV_SOURCE_BASE		24
-#define MAC_SCC_SOURCE_BASE	32
+#define MAC_SCC_SOURCE_BASE	24
+#define PSC3_SOURCE_BASE	24
+#define PSC4_SOURCE_BASE	32
+#define PSC5_SOURCE_BASE	40
+#define PSC6_SOURCE_BASE	48
 #define NUBUS_SOURCE_BASE	56
-#define NUBUS_MAX_SOURCES	8
 
-/* FIXME: sources not contigous ... */
-#define NUM_MAC_SOURCES   (NUBUS_SOURCE_BASE+NUBUS_MAX_SOURCES-VIA1_SOURCE_BASE)
+/*
+ * Maximum IRQ number is NUBUS_SOURCE_BASE + 7,
+ * giving us IRQs up through 63.
+ */
 
-#define IRQ_SRC_MASK (VIA1_SOURCE_BASE|VIA2_SOURCE_BASE|MAC_SCC_SOURCE_BASE)
-#define IRQ_IDX_MASK 7
+#define NUM_MAC_SOURCES		64
 
 /* 
- * quick hack to adapt old MACHSPEC-aware source
+ * clean way to separate IRQ into its source and index
  */
-#define	IRQ_IDX(irq)	(irq)
 
-/* interrupt service types */
-#define IRQ_TYPE_SLOW     0
-#define IRQ_TYPE_FAST     1
-#define IRQ_TYPE_PRIO     2
+#define IRQ_SRC(irq)	(irq >> 3)
+#define	IRQ_IDX(irq)	(irq & 7)
 
 #define	IRQ_SPURIOUS      (0)
 
@@ -59,15 +70,15 @@
 #define IRQ_AUTO_7        (7)
 
 /* VIA1 interrupts */
-#define IRQ_VIA1_0	  (8)	/* one second int. */
-#define IRQ_VIA1_1        (9)	/* VBlank int. */
+#define IRQ_VIA1_0	  (8)		/* one second int. */
+#define IRQ_VIA1_1        (9)		/* VBlank int. */
 #define IRQ_MAC_VBL	  IRQ_VIA1_1
-#define IRQ_VIA1_2 	  (10)	/* ADB SR shifts complete */
+#define IRQ_VIA1_2 	  (10)		/* ADB SR shifts complete */
 #define IRQ_MAC_ADB	  IRQ_VIA1_2
 #define IRQ_MAC_ADB_SR	  IRQ_VIA1_2
-#define IRQ_VIA1_3	  (11)	/* ADB SR CB2 ?? */
+#define IRQ_VIA1_3	  (11)		/* ADB SR CB2 ?? */
 #define IRQ_MAC_ADB_SD	  IRQ_VIA1_3
-#define IRQ_VIA1_4        (12)	/* ADB SR ext. clock pulse */
+#define IRQ_VIA1_4        (12)		/* ADB SR ext. clock pulse */
 #define IRQ_MAC_ADB_CL	  IRQ_VIA1_4
 #define IRQ_VIA1_5	  (13)
 #define IRQ_MAC_TIMER_2	  IRQ_VIA1_5
@@ -75,7 +86,7 @@
 #define IRQ_MAC_TIMER_1	  IRQ_VIA1_6
 #define IRQ_VIA1_7        (15)
 
-/* VIA2 interrupts */
+/* VIA2/RBV interrupts */
 #define IRQ_VIA2_0	  (16)
 #define IRQ_MAC_SCSIDRQ	  IRQ_VIA2_0
 #define IRQ_VIA2_1        (17)
@@ -88,18 +99,6 @@
 #define IRQ_VIA2_6	  (22)
 #define IRQ_VIA2_7        (23)
 
-#if 0
-/* RBV interrupts */
-#define IRQ_RBV_0	  (24)
-#define IRQ_RBV_1	  (25)
-#define IRQ_RBV_2 	  (26)
-#define IRQ_RBV_3	  (27)
-#define IRQ_RBV_4	  (28)
-#define IRQ_RBV_5	  (29)
-#define IRQ_RBV_6	  (30)
-#define IRQ_RBV_7	  (31)
-#endif
-
 /* Level 3 (PSC, AV Macs only) interrupts */
 #define IRQ_PSC3_0	  (24)
 #define IRQ_MAC_MACE	  IRQ_PSC3_0
@@ -109,8 +108,8 @@
 
 /* Level 4 (SCC) interrupts */
 #define IRQ_SCC 	     (32)
-#define IRQ_SCCB	     (33)
-#define IRQ_SCCA	     (34)
+#define IRQ_SCCA	     (33)
+#define IRQ_SCCB	     (34)
 #if 0 /* FIXME: are there multiple interrupt conditions on the SCC ?? */
 /* SCC interrupts */
 #define IRQ_SCCB_TX	     (32)
@@ -143,40 +142,21 @@
 #define IRQ_PSC6_3	  (51)
 
 /* Nubus interrupts (cascaded to VIA2) */
-#define IRQ_NUBUS_1	  (56)
+#define IRQ_NUBUS_9	  (56)
+#define IRQ_NUBUS_A	  (57)
+#define IRQ_NUBUS_B	  (58)
+#define IRQ_NUBUS_C	  (59)
+#define IRQ_NUBUS_D	  (60)
+#define IRQ_NUBUS_E	  (61)
+#define IRQ_NUBUS_F	  (62)
+
+#define SLOT2IRQ(x)	  (x + 47)
+#define IRQ2SLOT(x)	  (x - 47)
 
 #define INT_CLK   24576	    /* CLK while int_clk =2.456MHz and divide = 100 */
 #define INT_TICKS 246	    /* to make sched_time = 99.902... HZ */
 
-
-#define VIA_ENABLE	0
-#define VIA_PENDING	1
-#define VIA_SERVICE	2
-#define VIA_MASK	3
-
-/* 
- * Utility functions for setting/clearing bits in the interrupt registers of
- * the VIA. 
- */
-
-void mac_enable_irq( unsigned irq );
-void mac_disable_irq( unsigned irq );
-void mac_turnon_irq( unsigned irq );
-void mac_turnoff_irq( unsigned irq );
-void mac_clear_pending_irq( unsigned irq );
-int  mac_irq_pending( unsigned irq );
-int  nubus_request_irq(int slot, void *dev_id, void (*handler)(int,void *,struct pt_regs *));
-int  nubus_free_irq(int slot);
-
-unsigned long mac_register_nubus_int( void );
-void mac_unregister_nubus_int( unsigned long );
-
-extern void mac_default_handler(int irq, void *dev_id, struct pt_regs *regs);
-extern void via1_irq(int irq, void *dev_id, struct pt_regs *regs);
-extern void via2_irq(int irq, void *dev_id, struct pt_regs *regs);
-extern void  rbv_irq(int irq, void *dev_id, struct pt_regs *regs);
-extern void mac_bang(int irq, void *dev_id, struct pt_regs *regs);
-		
-extern void mac_SCC_handler(int irq, void *dev_id, struct pt_regs *regs);
+extern irq_node_t *mac_irq_list[NUM_MAC_SOURCES];
+extern void mac_do_irq_list(int irq, struct pt_regs *);
 
 #endif /* asm/macints.h */

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)