1 1.33 matt /* $NetBSD: intr.h,v 1.33 2011/02/20 07:54:11 matt Exp $ */ 2 1.6 soren 3 1.6 soren /* 4 1.6 soren * Copyright (c) 2000 Soren S. Jorvang. All rights reserved. 5 1.6 soren * 6 1.6 soren * Redistribution and use in source and binary forms, with or without 7 1.6 soren * modification, are permitted provided that the following conditions 8 1.6 soren * are met: 9 1.6 soren * 1. Redistributions of source code must retain the above copyright 10 1.6 soren * notice, this list of conditions, and the following disclaimer. 11 1.6 soren * 2. Redistributions in binary form must reproduce the above copyright 12 1.6 soren * notice, this list of conditions and the following disclaimer in the 13 1.6 soren * documentation and/or other materials provided with the distribution. 14 1.6 soren * 15 1.6 soren * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 16 1.6 soren * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17 1.6 soren * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 18 1.6 soren * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 19 1.6 soren * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 20 1.6 soren * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 21 1.6 soren * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 22 1.6 soren * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 23 1.6 soren * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 24 1.6 soren * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 25 1.6 soren * SUCH DAMAGE. 26 1.6 soren */ 27 1.1 soren 28 1.14 tsutsui #ifndef _COBALT_INTR_H_ 29 1.14 tsutsui #define _COBALT_INTR_H_ 30 1.14 tsutsui 31 1.33 matt #include <mips/intr.h> 32 1.1 soren 33 1.3 soren #ifdef _KERNEL 34 1.1 soren #ifndef _LOCORE 35 1.5 soren 36 1.30 ad #include <sys/evcnt.h> 37 1.5 soren #include <mips/cpuregs.h> 38 1.24 yamt 39 1.31 tsutsui #define NCPU_INT 6 40 1.31 tsutsui #define NICU_INT 16 41 1.31 tsutsui 42 1.15 tsutsui struct cobalt_intrhand { 43 1.15 tsutsui LIST_ENTRY(cobalt_intrhand) ih_q; 44 1.15 tsutsui int (*ih_func)(void *); 45 1.15 tsutsui void *ih_arg; 46 1.31 tsutsui int ih_irq; 47 1.19 tsutsui int ih_cookie_type; 48 1.15 tsutsui #define COBALT_COOKIE_TYPE_CPU 0x1 49 1.15 tsutsui #define COBALT_COOKIE_TYPE_ICU 0x2 50 1.15 tsutsui }; 51 1.15 tsutsui 52 1.31 tsutsui void intr_init(void); 53 1.15 tsutsui void *cpu_intr_establish(int, int, int (*)(void *), void *); 54 1.15 tsutsui void *icu_intr_establish(int, int, int, int (*)(void *), void *); 55 1.15 tsutsui void cpu_intr_disestablish(void *); 56 1.15 tsutsui void icu_intr_disestablish(void *); 57 1.1 soren 58 1.3 soren #endif /* !_LOCORE */ 59 1.32 uebayasi #endif /* _KERNEL */ 60 1.14 tsutsui 61 1.14 tsutsui #endif /* !_COBALT_INTR_H_ */ 62