18c2ecf20Sopenharmony_ci/* 28c2ecf20Sopenharmony_ci** amigaints.h -- Amiga Linux interrupt handling structs and prototypes 38c2ecf20Sopenharmony_ci** 48c2ecf20Sopenharmony_ci** Copyright 1992 by Greg Harp 58c2ecf20Sopenharmony_ci** 68c2ecf20Sopenharmony_ci** This file is subject to the terms and conditions of the GNU General Public 78c2ecf20Sopenharmony_ci** License. See the file COPYING in the main directory of this archive 88c2ecf20Sopenharmony_ci** for more details. 98c2ecf20Sopenharmony_ci** 108c2ecf20Sopenharmony_ci** Created 10/2/92 by Greg Harp 118c2ecf20Sopenharmony_ci*/ 128c2ecf20Sopenharmony_ci 138c2ecf20Sopenharmony_ci#ifndef _ASMm68k_AMIGAINTS_H_ 148c2ecf20Sopenharmony_ci#define _ASMm68k_AMIGAINTS_H_ 158c2ecf20Sopenharmony_ci 168c2ecf20Sopenharmony_ci#include <asm/irq.h> 178c2ecf20Sopenharmony_ci 188c2ecf20Sopenharmony_ci/* 198c2ecf20Sopenharmony_ci** Amiga Interrupt sources. 208c2ecf20Sopenharmony_ci** 218c2ecf20Sopenharmony_ci*/ 228c2ecf20Sopenharmony_ci 238c2ecf20Sopenharmony_ci#define AUTO_IRQS (8) 248c2ecf20Sopenharmony_ci#define AMI_STD_IRQS (14) 258c2ecf20Sopenharmony_ci#define CIA_IRQS (5) 268c2ecf20Sopenharmony_ci#define AMI_IRQS (32) /* AUTO_IRQS+AMI_STD_IRQS+2*CIA_IRQS */ 278c2ecf20Sopenharmony_ci 288c2ecf20Sopenharmony_ci/* builtin serial port interrupts */ 298c2ecf20Sopenharmony_ci#define IRQ_AMIGA_TBE (IRQ_USER+0) 308c2ecf20Sopenharmony_ci#define IRQ_AMIGA_RBF (IRQ_USER+11) 318c2ecf20Sopenharmony_ci 328c2ecf20Sopenharmony_ci/* floppy disk interrupts */ 338c2ecf20Sopenharmony_ci#define IRQ_AMIGA_DSKBLK (IRQ_USER+1) 348c2ecf20Sopenharmony_ci#define IRQ_AMIGA_DSKSYN (IRQ_USER+12) 358c2ecf20Sopenharmony_ci 368c2ecf20Sopenharmony_ci/* software interrupts */ 378c2ecf20Sopenharmony_ci#define IRQ_AMIGA_SOFT (IRQ_USER+2) 388c2ecf20Sopenharmony_ci 398c2ecf20Sopenharmony_ci/* interrupts from external hardware */ 408c2ecf20Sopenharmony_ci#define IRQ_AMIGA_PORTS IRQ_AUTO_2 418c2ecf20Sopenharmony_ci#define IRQ_AMIGA_EXTER IRQ_AUTO_6 428c2ecf20Sopenharmony_ci 438c2ecf20Sopenharmony_ci/* copper interrupt */ 448c2ecf20Sopenharmony_ci#define IRQ_AMIGA_COPPER (IRQ_USER+4) 458c2ecf20Sopenharmony_ci 468c2ecf20Sopenharmony_ci/* vertical blanking interrupt */ 478c2ecf20Sopenharmony_ci#define IRQ_AMIGA_VERTB (IRQ_USER+5) 488c2ecf20Sopenharmony_ci 498c2ecf20Sopenharmony_ci/* Blitter done interrupt */ 508c2ecf20Sopenharmony_ci#define IRQ_AMIGA_BLIT (IRQ_USER+6) 518c2ecf20Sopenharmony_ci 528c2ecf20Sopenharmony_ci/* Audio interrupts */ 538c2ecf20Sopenharmony_ci#define IRQ_AMIGA_AUD0 (IRQ_USER+7) 548c2ecf20Sopenharmony_ci#define IRQ_AMIGA_AUD1 (IRQ_USER+8) 558c2ecf20Sopenharmony_ci#define IRQ_AMIGA_AUD2 (IRQ_USER+9) 568c2ecf20Sopenharmony_ci#define IRQ_AMIGA_AUD3 (IRQ_USER+10) 578c2ecf20Sopenharmony_ci 588c2ecf20Sopenharmony_ci/* CIA interrupt sources */ 598c2ecf20Sopenharmony_ci#define IRQ_AMIGA_CIAA (IRQ_USER+14) 608c2ecf20Sopenharmony_ci#define IRQ_AMIGA_CIAA_TA (IRQ_USER+14) 618c2ecf20Sopenharmony_ci#define IRQ_AMIGA_CIAA_TB (IRQ_USER+15) 628c2ecf20Sopenharmony_ci#define IRQ_AMIGA_CIAA_ALRM (IRQ_USER+16) 638c2ecf20Sopenharmony_ci#define IRQ_AMIGA_CIAA_SP (IRQ_USER+17) 648c2ecf20Sopenharmony_ci#define IRQ_AMIGA_CIAA_FLG (IRQ_USER+18) 658c2ecf20Sopenharmony_ci#define IRQ_AMIGA_CIAB (IRQ_USER+19) 668c2ecf20Sopenharmony_ci#define IRQ_AMIGA_CIAB_TA (IRQ_USER+19) 678c2ecf20Sopenharmony_ci#define IRQ_AMIGA_CIAB_TB (IRQ_USER+20) 688c2ecf20Sopenharmony_ci#define IRQ_AMIGA_CIAB_ALRM (IRQ_USER+21) 698c2ecf20Sopenharmony_ci#define IRQ_AMIGA_CIAB_SP (IRQ_USER+22) 708c2ecf20Sopenharmony_ci#define IRQ_AMIGA_CIAB_FLG (IRQ_USER+23) 718c2ecf20Sopenharmony_ci 728c2ecf20Sopenharmony_ci 738c2ecf20Sopenharmony_ci/* INTREQR masks */ 748c2ecf20Sopenharmony_ci#define IF_SETCLR 0x8000 /* set/clr bit */ 758c2ecf20Sopenharmony_ci#define IF_INTEN 0x4000 /* master interrupt bit in INT* registers */ 768c2ecf20Sopenharmony_ci#define IF_EXTER 0x2000 /* external level 6 and CIA B interrupt */ 778c2ecf20Sopenharmony_ci#define IF_DSKSYN 0x1000 /* disk sync interrupt */ 788c2ecf20Sopenharmony_ci#define IF_RBF 0x0800 /* serial receive buffer full interrupt */ 798c2ecf20Sopenharmony_ci#define IF_AUD3 0x0400 /* audio channel 3 done interrupt */ 808c2ecf20Sopenharmony_ci#define IF_AUD2 0x0200 /* audio channel 2 done interrupt */ 818c2ecf20Sopenharmony_ci#define IF_AUD1 0x0100 /* audio channel 1 done interrupt */ 828c2ecf20Sopenharmony_ci#define IF_AUD0 0x0080 /* audio channel 0 done interrupt */ 838c2ecf20Sopenharmony_ci#define IF_BLIT 0x0040 /* blitter done interrupt */ 848c2ecf20Sopenharmony_ci#define IF_VERTB 0x0020 /* vertical blanking interrupt */ 858c2ecf20Sopenharmony_ci#define IF_COPER 0x0010 /* copper interrupt */ 868c2ecf20Sopenharmony_ci#define IF_PORTS 0x0008 /* external level 2 and CIA A interrupt */ 878c2ecf20Sopenharmony_ci#define IF_SOFT 0x0004 /* software initiated interrupt */ 888c2ecf20Sopenharmony_ci#define IF_DSKBLK 0x0002 /* diskblock DMA finished */ 898c2ecf20Sopenharmony_ci#define IF_TBE 0x0001 /* serial transmit buffer empty interrupt */ 908c2ecf20Sopenharmony_ci 918c2ecf20Sopenharmony_ci/* CIA interrupt control register bits */ 928c2ecf20Sopenharmony_ci 938c2ecf20Sopenharmony_ci#define CIA_ICR_TA 0x01 948c2ecf20Sopenharmony_ci#define CIA_ICR_TB 0x02 958c2ecf20Sopenharmony_ci#define CIA_ICR_ALRM 0x04 968c2ecf20Sopenharmony_ci#define CIA_ICR_SP 0x08 978c2ecf20Sopenharmony_ci#define CIA_ICR_FLG 0x10 988c2ecf20Sopenharmony_ci#define CIA_ICR_ALL 0x1f 998c2ecf20Sopenharmony_ci#define CIA_ICR_SETCLR 0x80 1008c2ecf20Sopenharmony_ci 1018c2ecf20Sopenharmony_ciextern void amiga_init_IRQ(void); 1028c2ecf20Sopenharmony_ci 1038c2ecf20Sopenharmony_ci/* to access the interrupt control registers of CIA's use only 1048c2ecf20Sopenharmony_ci** these functions, they behave exactly like the amiga os routines 1058c2ecf20Sopenharmony_ci*/ 1068c2ecf20Sopenharmony_ci 1078c2ecf20Sopenharmony_ciextern struct ciabase ciaa_base, ciab_base; 1088c2ecf20Sopenharmony_ci 1098c2ecf20Sopenharmony_ciextern void cia_init_IRQ(struct ciabase *base); 1108c2ecf20Sopenharmony_ciextern unsigned char cia_set_irq(struct ciabase *base, unsigned char mask); 1118c2ecf20Sopenharmony_ciextern unsigned char cia_able_irq(struct ciabase *base, unsigned char mask); 1128c2ecf20Sopenharmony_ci 1138c2ecf20Sopenharmony_ci#endif /* asm-m68k/amigaints.h */ 114