18 #ifndef _LINUX_ATARIINTS_H_
19 #define _LINUX_ATARIINTS_H_
29 #define STMFP_SOURCE_BASE 8
30 #define TTMFP_SOURCE_BASE 24
31 #define SCC_SOURCE_BASE 40
32 #define VME_SOURCE_BASE 56
33 #define VME_MAX_SOURCES 16
35 #define NUM_ATARI_SOURCES (VME_SOURCE_BASE+VME_MAX_SOURCES-STMFP_SOURCE_BASE)
38 #define IRQ_VECTOR_TO_SOURCE(v) ((v) - ((v) < 0x20 ? 0x18 : (0x40-8)))
41 #define IRQ_SOURCE_TO_VECTOR(i) ((i) + ((i) < 8 ? 0x18 : (0x40-8)))
44 #define IRQ_TYPE_SLOW 0
45 #define IRQ_TYPE_FAST 1
46 #define IRQ_TYPE_PRIO 2
49 #define IRQ_MFP_BUSY (8)
50 #define IRQ_MFP_DCD (9)
51 #define IRQ_MFP_CTS (10)
52 #define IRQ_MFP_GPU (11)
53 #define IRQ_MFP_TIMD (12)
54 #define IRQ_MFP_TIMC (13)
55 #define IRQ_MFP_ACIA (14)
56 #define IRQ_MFP_FDC (15)
57 #define IRQ_MFP_ACSI IRQ_MFP_FDC
58 #define IRQ_MFP_FSCSI IRQ_MFP_FDC
59 #define IRQ_MFP_IDE IRQ_MFP_FDC
60 #define IRQ_MFP_TIMB (16)
61 #define IRQ_MFP_SERERR (17)
62 #define IRQ_MFP_SEREMPT (18)
63 #define IRQ_MFP_RECERR (19)
64 #define IRQ_MFP_RECFULL (20)
65 #define IRQ_MFP_TIMA (21)
66 #define IRQ_MFP_RI (22)
67 #define IRQ_MFP_MMD (23)
70 #define IRQ_TT_MFP_IO0 (24)
71 #define IRQ_TT_MFP_IO1 (25)
72 #define IRQ_TT_MFP_SCC (26)
73 #define IRQ_TT_MFP_RI (27)
74 #define IRQ_TT_MFP_TIMD (28)
75 #define IRQ_TT_MFP_TIMC (29)
76 #define IRQ_TT_MFP_DRVRDY (30)
77 #define IRQ_TT_MFP_SCSIDMA (31)
78 #define IRQ_TT_MFP_TIMB (32)
79 #define IRQ_TT_MFP_SERERR (33)
80 #define IRQ_TT_MFP_SEREMPT (34)
81 #define IRQ_TT_MFP_RECERR (35)
82 #define IRQ_TT_MFP_RECFULL (36)
83 #define IRQ_TT_MFP_TIMA (37)
84 #define IRQ_TT_MFP_RTC (38)
85 #define IRQ_TT_MFP_SCSI (39)
88 #define IRQ_SCCB_TX (40)
89 #define IRQ_SCCB_STAT (42)
90 #define IRQ_SCCB_RX (44)
91 #define IRQ_SCCB_SPCOND (46)
92 #define IRQ_SCCA_TX (48)
93 #define IRQ_SCCA_STAT (50)
94 #define IRQ_SCCA_RX (52)
95 #define IRQ_SCCA_SPCOND (54)
103 #define MFP_PENDING 1
104 #define MFP_SERVICE 2
111 static inline int get_mfp_bit(
unsigned irq,
int type )
115 mask = 1 << (irq & 7);
116 reg = (
unsigned char *)&
st_mfp.int_en_a + type*4 +
117 ((irq & 8) >> 2) + (((irq-8) & 16) << 3);
118 return( *reg & mask );
121 static inline void set_mfp_bit(
unsigned irq,
int type )
125 mask = 1 << (irq & 7);
126 reg = (
unsigned char *)&
st_mfp.int_en_a + type*4 +
127 ((irq & 8) >> 2) + (((irq-8) & 16) << 3);
128 __asm__ __volatile__ (
"orb %0,%1"
129 : :
"di" (mask),
"m" (*reg) :
"memory" );
132 static inline void clear_mfp_bit(
unsigned irq,
int type )
136 mask = ~(1 << (irq & 7));
137 reg = (
unsigned char *)&
st_mfp.int_en_a + type*4 +
138 ((irq & 8) >> 2) + (((irq-8) & 16) << 3);
140 __asm__ __volatile__ (
"moveb %0,%1"
141 : :
"di" (mask),
"m" (*reg) :
"memory" );
143 __asm__ __volatile__ (
"andb %0,%1"
144 : :
"di" (mask),
"m" (*reg) :
"memory" );
153 static inline void atari_enable_irq(
unsigned irq )
160 static inline void atari_disable_irq(
unsigned irq )
172 static inline void atari_turnon_irq(
unsigned irq )
179 static inline void atari_turnoff_irq(
unsigned irq )
187 static inline void atari_clear_pending_irq(
unsigned irq )
194 static inline int atari_irq_pending(
unsigned irq )