xref: /netbsd-src/sys/arch/cobalt/include/intr.h (revision c9fc40b4be5fc5b115deb497c8b92e9c9a7e63e3)
1*c9fc40b4Smatt /*	$NetBSD: intr.h,v 1.33 2011/02/20 07:54:11 matt Exp $	*/
2ee733492Ssoren 
3ee733492Ssoren /*
4ee733492Ssoren  * Copyright (c) 2000 Soren S. Jorvang.  All rights reserved.
5ee733492Ssoren  *
6ee733492Ssoren  * Redistribution and use in source and binary forms, with or without
7ee733492Ssoren  * modification, are permitted provided that the following conditions
8ee733492Ssoren  * are met:
9ee733492Ssoren  * 1. Redistributions of source code must retain the above copyright
10ee733492Ssoren  *    notice, this list of conditions, and the following disclaimer.
11ee733492Ssoren  * 2. Redistributions in binary form must reproduce the above copyright
12ee733492Ssoren  *    notice, this list of conditions and the following disclaimer in the
13ee733492Ssoren  *    documentation and/or other materials provided with the distribution.
14ee733492Ssoren  *
15ee733492Ssoren  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
16ee733492Ssoren  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17ee733492Ssoren  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18ee733492Ssoren  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
19ee733492Ssoren  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20ee733492Ssoren  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21ee733492Ssoren  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22ee733492Ssoren  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23ee733492Ssoren  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24ee733492Ssoren  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25ee733492Ssoren  * SUCH DAMAGE.
26ee733492Ssoren  */
274c547143Ssoren 
283fad9265Stsutsui #ifndef	_COBALT_INTR_H_
293fad9265Stsutsui #define	_COBALT_INTR_H_
303fad9265Stsutsui 
31*c9fc40b4Smatt #include <mips/intr.h>
324c547143Ssoren 
33278498c0Ssoren #ifdef _KERNEL
344c547143Ssoren #ifndef _LOCORE
354c547143Ssoren 
3687a95011Sad #include <sys/evcnt.h>
3799e6adf3Ssoren #include <mips/cpuregs.h>
388bf76628Syamt 
3938e83cc1Stsutsui #define NCPU_INT	6
4038e83cc1Stsutsui #define NICU_INT	16
4138e83cc1Stsutsui 
4214b42ecfStsutsui struct cobalt_intrhand {
4314b42ecfStsutsui 	LIST_ENTRY(cobalt_intrhand) ih_q;
4414b42ecfStsutsui 	int (*ih_func)(void *);
4514b42ecfStsutsui 	void *ih_arg;
4638e83cc1Stsutsui 	int ih_irq;
47bf95794eStsutsui 	int ih_cookie_type;
4814b42ecfStsutsui #define	COBALT_COOKIE_TYPE_CPU	0x1
4914b42ecfStsutsui #define	COBALT_COOKIE_TYPE_ICU	0x2
5014b42ecfStsutsui };
5114b42ecfStsutsui 
5238e83cc1Stsutsui void intr_init(void);
5314b42ecfStsutsui void *cpu_intr_establish(int, int, int (*)(void *), void *);
5414b42ecfStsutsui void *icu_intr_establish(int, int, int, int (*)(void *), void *);
5514b42ecfStsutsui void cpu_intr_disestablish(void *);
5614b42ecfStsutsui void icu_intr_disestablish(void *);
574c547143Ssoren 
58278498c0Ssoren #endif /* !_LOCORE */
5908912a35Suebayasi #endif /* _KERNEL */
603fad9265Stsutsui 
613fad9265Stsutsui #endif	/* !_COBALT_INTR_H_ */
62