~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/arch/m68k/include/asm/atariints.h

Version: ~ [ linux-5.6 ] ~ [ linux-5.5.13 ] ~ [ linux-5.4.28 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.113 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.174 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.217 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.217 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.19.8 ] ~ [ linux-3.18.140 ] ~ [ linux-3.17.8 ] ~ [ linux-3.16.82 ] ~ [ linux-3.15.10 ] ~ [ linux-3.14.79 ] ~ [ linux-3.13.11 ] ~ [ linux-3.12.74 ] ~ [ linux-3.11.10 ] ~ [ linux-3.10.108 ] ~ [ linux-3.9.11 ] ~ [ linux-3.8.13 ] ~ [ linux-3.7.10 ] ~ [ linux-3.6.11 ] ~ [ linux-3.5.7 ] ~ [ linux-3.4.113 ] ~ [ linux-3.3.8 ] ~ [ linux-3.2.102 ] ~ [ linux-3.1.10 ] ~ [ linux-3.0.101 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.5 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /*
  2 ** atariints.h -- Atari Linux interrupt handling structs and prototypes
  3 **
  4 ** Copyright 1994 by Björn Brauel
  5 **
  6 ** 5/2/94 Roman Hodek:
  7 **   TT interrupt definitions added.
  8 **
  9 ** 12/02/96: (Roman)
 10 **   Adapted to new int handling scheme (see ataints.c); revised numbering
 11 **
 12 ** This file is subject to the terms and conditions of the GNU General Public
 13 ** License.  See the file COPYING in the main directory of this archive
 14 ** for more details.
 15 **
 16 */
 17 
 18 #ifndef _LINUX_ATARIINTS_H_
 19 #define _LINUX_ATARIINTS_H_
 20 
 21 #include <asm/irq.h>
 22 #include <asm/atarihw.h>
 23 
 24 /*
 25 ** Atari Interrupt sources.
 26 **
 27 */
 28 
 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
 34 
 35 #define NUM_ATARI_SOURCES  141
 36 
 37 /* convert vector number to int source number */
 38 #define IRQ_VECTOR_TO_SOURCE(v) ((v) - ((v) < 0x20 ? 0x18 : (0x40-8)))
 39 
 40 /* convert irq_handler index to vector number */
 41 #define IRQ_SOURCE_TO_VECTOR(i) ((i) + ((i) < 8 ? 0x18 : (0x40-8)))
 42 
 43 /* interrupt service types */
 44 #define IRQ_TYPE_SLOW     0
 45 #define IRQ_TYPE_FAST     1
 46 #define IRQ_TYPE_PRIO     2
 47 
 48 /* ST-MFP interrupts */
 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)
 68 
 69 /* TT-MFP interrupts */
 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)
 86 
 87 /* SCC interrupts */
 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)
 96 
 97 /* shared MFP timer D interrupts - hires timer for EtherNEC et al. */
 98 #define IRQ_MFP_TIMER1       (64)
 99 #define IRQ_MFP_TIMER2       (65)
100 #define IRQ_MFP_TIMER3       (66)
101 #define IRQ_MFP_TIMER4       (67)
102 #define IRQ_MFP_TIMER5       (68)
103 #define IRQ_MFP_TIMER6       (69)
104 #define IRQ_MFP_TIMER7       (70)
105 #define IRQ_MFP_TIMER8       (71)
106 
107 #define INT_CLK   24576     /* CLK while int_clk =2.456MHz and divide = 100 */
108 #define INT_TICKS 246       /* to make sched_time = 99.902... HZ */
109 
110 
111 #define MFP_ENABLE      0
112 #define MFP_PENDING     1
113 #define MFP_SERVICE     2
114 #define MFP_MASK        3
115 
116 /* Utility functions for setting/clearing bits in the interrupt registers of
117  * the MFP. 'type' should be constant, if 'irq' is constant, too, code size is
118  * reduced. set_mfp_bit() is nonsense for PENDING and SERVICE registers. */
119 
120 static inline int get_mfp_bit( unsigned irq, int type )
121 
122 {       unsigned char   mask, *reg;
123 
124         mask = 1 << (irq & 7);
125         reg = (unsigned char *)&st_mfp.int_en_a + type*4 +
126                   ((irq & 8) >> 2) + (((irq-8) & 16) << 3);
127         return( *reg & mask );
128 }
129 
130 static inline void set_mfp_bit( unsigned irq, int type )
131 
132 {       unsigned char   mask, *reg;
133 
134         mask = 1 << (irq & 7);
135         reg = (unsigned char *)&st_mfp.int_en_a + type*4 +
136                   ((irq & 8) >> 2) + (((irq-8) & 16) << 3);
137         __asm__ __volatile__ ( "orb %0,%1"
138                               : : "di" (mask), "m" (*reg) : "memory" );
139 }
140 
141 static inline void clear_mfp_bit( unsigned irq, int type )
142 
143 {       unsigned char   mask, *reg;
144 
145         mask = ~(1 << (irq & 7));
146         reg = (unsigned char *)&st_mfp.int_en_a + type*4 +
147                   ((irq & 8) >> 2) + (((irq-8) & 16) << 3);
148         if (type == MFP_PENDING || type == MFP_SERVICE)
149                 __asm__ __volatile__ ( "moveb %0,%1"
150                                       : : "di" (mask), "m" (*reg) : "memory" );
151         else
152                 __asm__ __volatile__ ( "andb %0,%1"
153                                       : : "di" (mask), "m" (*reg) : "memory" );
154 }
155 
156 /*
157  * {en,dis}able_irq have the usual semantics of temporary blocking the
158  * interrupt, but not losing requests that happen between disabling and
159  * enabling. This is done with the MFP mask registers.
160  */
161 
162 static inline void atari_enable_irq( unsigned irq )
163 
164 {
165         if (irq < STMFP_SOURCE_BASE || irq >= SCC_SOURCE_BASE) return;
166         set_mfp_bit( irq, MFP_MASK );
167 }
168 
169 static inline void atari_disable_irq( unsigned irq )
170 
171 {
172         if (irq < STMFP_SOURCE_BASE || irq >= SCC_SOURCE_BASE) return;
173         clear_mfp_bit( irq, MFP_MASK );
174 }
175 
176 /*
177  * In opposite to {en,dis}able_irq, requests between turn{off,on}_irq are not
178  * "stored"
179  */
180 
181 static inline void atari_turnon_irq( unsigned irq )
182 
183 {
184         if (irq < STMFP_SOURCE_BASE || irq >= SCC_SOURCE_BASE) return;
185         set_mfp_bit( irq, MFP_ENABLE );
186 }
187 
188 static inline void atari_turnoff_irq( unsigned irq )
189 
190 {
191         if (irq < STMFP_SOURCE_BASE || irq >= SCC_SOURCE_BASE) return;
192         clear_mfp_bit( irq, MFP_ENABLE );
193         clear_mfp_bit( irq, MFP_PENDING );
194 }
195 
196 static inline void atari_clear_pending_irq( unsigned irq )
197 
198 {
199         if (irq < STMFP_SOURCE_BASE || irq >= SCC_SOURCE_BASE) return;
200         clear_mfp_bit( irq, MFP_PENDING );
201 }
202 
203 static inline int atari_irq_pending( unsigned irq )
204 
205 {
206         if (irq < STMFP_SOURCE_BASE || irq >= SCC_SOURCE_BASE) return( 0 );
207         return( get_mfp_bit( irq, MFP_PENDING ) );
208 }
209 
210 unsigned int atari_register_vme_int(void);
211 void atari_unregister_vme_int(unsigned int);
212 
213 #endif /* linux/atariints.h */
214 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | Wiki (Japanese) | Wiki (English) | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

osdn.jp