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

TOMOYO Linux Cross Reference
Linux/arch/m68k/amiga/amiints.c

Version: ~ [ linux-6.11.5 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.58 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.114 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.169 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.228 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.284 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.322 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /*
  2  * Amiga Linux interrupt handling code
  3  *
  4  * This file is subject to the terms and conditions of the GNU General Public
  5  * License.  See the file COPYING in the main directory of this archive
  6  * for more details.
  7  */
  8 
  9 #include <linux/init.h>
 10 #include <linux/interrupt.h>
 11 #include <linux/errno.h>
 12 #include <linux/irq.h>
 13 
 14 #include <asm/irq.h>
 15 #include <asm/traps.h>
 16 #include <asm/amigahw.h>
 17 #include <asm/amigaints.h>
 18 #include <asm/amipcmcia.h>
 19 
 20 
 21 /*
 22  * Enable/disable a particular machine specific interrupt source.
 23  * Note that this may affect other interrupts in case of a shared interrupt.
 24  * This function should only be called for a _very_ short time to change some
 25  * internal data, that may not be changed by the interrupt at the same time.
 26  */
 27 
 28 static void amiga_irq_enable(struct irq_data *data)
 29 {
 30         amiga_custom.intena = IF_SETCLR | (1 << (data->irq - IRQ_USER));
 31 }
 32 
 33 static void amiga_irq_disable(struct irq_data *data)
 34 {
 35         amiga_custom.intena = 1 << (data->irq - IRQ_USER);
 36 }
 37 
 38 static struct irq_chip amiga_irq_chip = {
 39         .name           = "amiga",
 40         .irq_enable     = amiga_irq_enable,
 41         .irq_disable    = amiga_irq_disable,
 42 };
 43 
 44 
 45 /*
 46  * The builtin Amiga hardware interrupt handlers.
 47  */
 48 
 49 static void ami_int1(struct irq_desc *desc)
 50 {
 51         unsigned short ints = amiga_custom.intreqr & amiga_custom.intenar;
 52 
 53         /* if serial transmit buffer empty, interrupt */
 54         if (ints & IF_TBE) {
 55                 amiga_custom.intreq = IF_TBE;
 56                 generic_handle_irq(IRQ_AMIGA_TBE);
 57         }
 58 
 59         /* if floppy disk transfer complete, interrupt */
 60         if (ints & IF_DSKBLK) {
 61                 amiga_custom.intreq = IF_DSKBLK;
 62                 generic_handle_irq(IRQ_AMIGA_DSKBLK);
 63         }
 64 
 65         /* if software interrupt set, interrupt */
 66         if (ints & IF_SOFT) {
 67                 amiga_custom.intreq = IF_SOFT;
 68                 generic_handle_irq(IRQ_AMIGA_SOFT);
 69         }
 70 }
 71 
 72 static void ami_int3(struct irq_desc *desc)
 73 {
 74         unsigned short ints = amiga_custom.intreqr & amiga_custom.intenar;
 75 
 76         /* if a blitter interrupt */
 77         if (ints & IF_BLIT) {
 78                 amiga_custom.intreq = IF_BLIT;
 79                 generic_handle_irq(IRQ_AMIGA_BLIT);
 80         }
 81 
 82         /* if a copper interrupt */
 83         if (ints & IF_COPER) {
 84                 amiga_custom.intreq = IF_COPER;
 85                 generic_handle_irq(IRQ_AMIGA_COPPER);
 86         }
 87 
 88         /* if a vertical blank interrupt */
 89         if (ints & IF_VERTB) {
 90                 amiga_custom.intreq = IF_VERTB;
 91                 generic_handle_irq(IRQ_AMIGA_VERTB);
 92         }
 93 }
 94 
 95 static void ami_int4(struct irq_desc *desc)
 96 {
 97         unsigned short ints = amiga_custom.intreqr & amiga_custom.intenar;
 98 
 99         /* if audio 0 interrupt */
100         if (ints & IF_AUD0) {
101                 amiga_custom.intreq = IF_AUD0;
102                 generic_handle_irq(IRQ_AMIGA_AUD0);
103         }
104 
105         /* if audio 1 interrupt */
106         if (ints & IF_AUD1) {
107                 amiga_custom.intreq = IF_AUD1;
108                 generic_handle_irq(IRQ_AMIGA_AUD1);
109         }
110 
111         /* if audio 2 interrupt */
112         if (ints & IF_AUD2) {
113                 amiga_custom.intreq = IF_AUD2;
114                 generic_handle_irq(IRQ_AMIGA_AUD2);
115         }
116 
117         /* if audio 3 interrupt */
118         if (ints & IF_AUD3) {
119                 amiga_custom.intreq = IF_AUD3;
120                 generic_handle_irq(IRQ_AMIGA_AUD3);
121         }
122 }
123 
124 static void ami_int5(struct irq_desc *desc)
125 {
126         unsigned short ints = amiga_custom.intreqr & amiga_custom.intenar;
127 
128         /* if serial receive buffer full interrupt */
129         if (ints & IF_RBF) {
130                 /* acknowledge of IF_RBF must be done by the serial interrupt */
131                 generic_handle_irq(IRQ_AMIGA_RBF);
132         }
133 
134         /* if a disk sync interrupt */
135         if (ints & IF_DSKSYN) {
136                 amiga_custom.intreq = IF_DSKSYN;
137                 generic_handle_irq(IRQ_AMIGA_DSKSYN);
138         }
139 }
140 
141 
142 /*
143  * void amiga_init_IRQ(void)
144  *
145  * Parameters:  None
146  *
147  * Returns:     Nothing
148  *
149  * This function should be called during kernel startup to initialize
150  * the amiga IRQ handling routines.
151  */
152 
153 void __init amiga_init_IRQ(void)
154 {
155         m68k_setup_irq_controller(&amiga_irq_chip, handle_simple_irq, IRQ_USER,
156                                   AMI_STD_IRQS);
157 
158         irq_set_chained_handler(IRQ_AUTO_1, ami_int1);
159         irq_set_chained_handler(IRQ_AUTO_3, ami_int3);
160         irq_set_chained_handler(IRQ_AUTO_4, ami_int4);
161         irq_set_chained_handler(IRQ_AUTO_5, ami_int5);
162 
163         /* turn off PCMCIA interrupts */
164         if (AMIGAHW_PRESENT(PCMCIA))
165                 gayle.inten = GAYLE_IRQ_IDE;
166 
167         /* turn off all interrupts and enable the master interrupt bit */
168         amiga_custom.intena = 0x7fff;
169         amiga_custom.intreq = 0x7fff;
170         amiga_custom.intena = IF_SETCLR | IF_INTEN;
171 
172         cia_init_IRQ(&ciaa_base);
173         cia_init_IRQ(&ciab_base);
174 }
175 

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

kernel.org | git.kernel.org | LWN.net | Project Home | 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.

sflogo.php