1*5e124f3aSmatt /* $NetBSD: intr.h,v 1.34 2011/02/20 07:50:25 matt Exp $ */ 2015e898cSperry 36975dc93Sjonathan /* 46975dc93Sjonathan * Copyright (c) 1998 Jonathan Stone. All rights reserved. 56975dc93Sjonathan * 66975dc93Sjonathan * Redistribution and use in source and binary forms, with or without 76975dc93Sjonathan * modification, are permitted provided that the following conditions 86975dc93Sjonathan * are met: 96975dc93Sjonathan * 1. Redistributions of source code must retain the above copyright 106975dc93Sjonathan * notice, this list of conditions and the following disclaimer. 116975dc93Sjonathan * 2. Redistributions in binary form must reproduce the above copyright 126975dc93Sjonathan * notice, this list of conditions and the following disclaimer in the 136975dc93Sjonathan * documentation and/or other materials provided with the distribution. 146975dc93Sjonathan * 3. All advertising materials mentioning features or use of this software 156975dc93Sjonathan * must display the following acknowledgement: 166975dc93Sjonathan * This product includes software developed by Jonathan Stone for 176975dc93Sjonathan * the NetBSD Project. 186975dc93Sjonathan * 4. The name of the author may not be used to endorse or promote products 196975dc93Sjonathan * derived from this software without specific prior written permission. 206975dc93Sjonathan * 216975dc93Sjonathan * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 226975dc93Sjonathan * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 236975dc93Sjonathan * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 246975dc93Sjonathan * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 256975dc93Sjonathan * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 266975dc93Sjonathan * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 276975dc93Sjonathan * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 286975dc93Sjonathan * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 296975dc93Sjonathan * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 306975dc93Sjonathan * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 316975dc93Sjonathan */ 3264a77940Sjonathan 3364a77940Sjonathan #ifndef _PMAX_INTR_H_ 3464a77940Sjonathan #define _PMAX_INTR_H_ 356975dc93Sjonathan 360269f24dSad #include <sys/evcnt.h> 37d3320a15Snisimura #include <sys/queue.h> 38d3320a15Snisimura 39*5e124f3aSmatt #include <mips/intr.h> 40d3320a15Snisimura 41e37ce1c5Snisimura #ifdef _KERNEL 42e37ce1c5Snisimura #ifndef _LOCORE 43e37ce1c5Snisimura 44014ba724Snisimura #define MIPS_SPLHIGH (MIPS_INT_MASK) 45*5e124f3aSmatt #define MIPS_SPL0 (MIPS_INT_MASK_0|MIPS_SOFT_INT_MASK) 46*5e124f3aSmatt #define MIPS_SPL1 (MIPS_INT_MASK_1|MIPS_SOFT_INT_MASK) 47*5e124f3aSmatt #define MIPS_SPL3 (MIPS_INT_MASK_3|MIPS_SOFT_INT_MASK) 48014ba724Snisimura #define MIPS_SPL_0_1 (MIPS_INT_MASK_1|MIPS_SPL0) 49014ba724Snisimura #define MIPS_SPL_0_1_2 (MIPS_INT_MASK_2|MIPS_SPL_0_1) 50014ba724Snisimura #define MIPS_SPL_0_1_3 (MIPS_INT_MASK_3|MIPS_SPL_0_1) 51014ba724Snisimura #define MIPS_SPL_0_1_2_3 (MIPS_INT_MASK_3|MIPS_SPL_0_1_2) 52fff42c01Sjonathan 53bdf420bdSsimonb struct intrhand { 5402cdf4d2Sdsl int (*ih_func)(void *); 55bdf420bdSsimonb void *ih_arg; 56f645983fSsimonb struct evcnt ih_count; 57bdf420bdSsimonb }; 58bdf420bdSsimonb extern struct intrhand intrtab[]; 59bdf420bdSsimonb 60f645983fSsimonb #define SYS_DEV_SCC0 0 61f645983fSsimonb #define SYS_DEV_SCC1 1 62f645983fSsimonb #define SYS_DEV_LANCE 2 63f645983fSsimonb #define SYS_DEV_SCSI 3 64f645983fSsimonb #define SYS_DEV_OPT0 4 65f645983fSsimonb #define SYS_DEV_OPT1 5 66f645983fSsimonb #define SYS_DEV_OPT2 6 67f645983fSsimonb #define SYS_DEV_DTOP 7 68f645983fSsimonb #define SYS_DEV_ISDN 8 69f645983fSsimonb #define SYS_DEV_FDC 9 70582e9de2Snisimura #define SYS_DEV_BOGUS -1 71df657b51Snisimura #define MAX_DEV_NCOOKIES 10 72df657b51Snisimura 73d3320a15Snisimura struct pmax_intrhand { 74d3320a15Snisimura LIST_ENTRY(pmax_intrhand) ih_q; 75d3320a15Snisimura int (*ih_func)(void *); 76d3320a15Snisimura void *ih_arg; 77d3320a15Snisimura }; 783dd5742bSnisimura 79d3320a15Snisimura extern struct evcnt pmax_clock_evcnt; 80d3320a15Snisimura extern struct evcnt pmax_fpu_evcnt; 81df657b51Snisimura extern struct evcnt pmax_memerr_evcnt; 823dd5742bSnisimura 83f645983fSsimonb void intr_init(void); 84e37ce1c5Snisimura #endif /* !_LOCORE */ 85e37ce1c5Snisimura #endif /* _KERNEL */ 866975dc93Sjonathan 8764a77940Sjonathan #endif /* !_PMAX_INTR_H_ */ 88