/*
** atariints.h -- Atari Linux interrupt handling structs and prototypes
**
** Copyright 1994 by Bj”rn Brauel
**
** 5/2/94 Roman Hodek:
**   TT interupt definitions added.
**
** This file is subject to the terms and conditions of the GNU General Public
** License.  See the file README.legal in the main directory of this archive
** for more details.
**
*/

#ifndef _LINUX_ATARIINTS_H_
#define _LINUX_ATARIINTS_H_

/*
** Atari Interrupt sources.
**
*/

#define IRQ_MFP_BUSY      (8)
#define IRQ_MFP_DCD       (9)
#define IRQ_MFP_CTS  	  (10)
#define IRQ_MFP_GPU 	  (11)
#define IRQ_MFP_TIMD      (12)
#define IRQ_MFP_TIMC	  (13)
#define IRQ_MFP_ACIA	  (14)
#define IRQ_MFP_FDC       (15)
#define IRQ_MFP_TIMB      (16)
#define IRQ_MFP_SERERR    (17)
#define IRQ_MFP_SEREMPT   (18)
#define IRQ_MFP_RECERR    (19)
#define IRQ_MFP_RECFULL   (20)
#define IRQ_MFP_TIMA      (21)
#define IRQ_MFP_RI        (22)
#define IRQ_MFP_MMD       (23)

#define IRQ_FLOPPY	    IRQ_MFP_FDC

#define IRQ_TT_MFP_IO0       (24)
#define IRQ_TT_MFP_IO1       (25)
#define IRQ_TT_MFP_SCC  	 (26)
#define IRQ_TT_MFP_RI 	     (27)
#define IRQ_TT_MFP_TIMD      (28)
#define IRQ_TT_MFP_TIMC	     (29)
#define IRQ_TT_MFP_DRVRDY    (30)
#define IRQ_TT_MFP_SCSIDMA   (31)
#define IRQ_TT_MFP_TIMB      (32)
#define IRQ_TT_MFP_SERERR    (33)
#define IRQ_TT_MFP_SEREMPT   (34)
#define IRQ_TT_MFP_RECERR    (35)
#define IRQ_TT_MFP_RECFULL   (36)
#define IRQ_TT_MFP_TIMA      (37)
#define IRQ_TT_MFP_RTC       (38)
#define IRQ_TT_MFP_SCSI      (39)

#define	IRQ_SCCB_TX			 (40)
#define	IRQ_SCCB_STAT		 (42)
#define	IRQ_SCCB_RX			 (44)
#define	IRQ_SCCB_SPCOND		 (46)
#define	IRQ_SCCA_TX			 (48)
#define	IRQ_SCCA_STAT		 (50)
#define	IRQ_SCCA_RX			 (52)
#define	IRQ_SCCA_SPCOND		 (54)

/* INTREQR masks */
#define IRQ1_MASK   0x0007	/* INTREQR mask for IRQ 1 */
#define IRQ2_MASK   0x0008	/* INTREQR mask for IRQ 2 */
#define IRQ3_MASK   0x0070	/* INTREQR mask for IRQ 3 */
#define IRQ4_MASK   0x0780	/* INTREQR mask for IRQ 4 */
#define IRQ5_MASK   0x1800	/* INTREQR mask for IRQ 5 */
#define IRQ6_MASK   0x2000	/* INTREQR mask for IRQ 6 */
#define IRQ7_MASK   0x4000	/* INTREQR mask for IRQ 7 */

#define IF_SETCLR   0x8000      /* set/clr bit */
#define IF_INTEN  0x4000	
#define IF_I1     0x2000	
#define IF_I2     0x1000	
#define IF_I3	    0x0800	
#define IF_I4     0x0400	
#define IF_I5     0x0200	
#define IF_I6     0x0100	
#define IF_I7     0x0080	
#define IF_I8     0x0040	
#define IF_I9     0x0020	
#define IF_I10    0x0010	
#define IF_I11    0x0008	
#define IF_I12    0x0004	
#define IF_I13    0x0002	
#define IF_I14    0x0001	

#define INT_CLK   24576  /* CLK while int_clk =2.456MHz and divide = 100 */
#define INT_TICKS 246    /* to make sched_time = 99.9024 HZ */

#endif /* linux/atariints.h */
