xref: /netbsd-src/sys/arch/algor/include/intr.h (revision 927b8a6c6e0a05cf5a7f5ca770e178765c87fba2)
1*927b8a6cSmatt /*	$NetBSD: intr.h,v 1.16 2012/07/28 23:08:56 matt Exp $	*/
216b9c606Sthorpej 
316b9c606Sthorpej /*-
416b9c606Sthorpej  * Copyright (c) 2000, 2001 The NetBSD Foundation, Inc.
516b9c606Sthorpej  * All rights reserved.
616b9c606Sthorpej  *
716b9c606Sthorpej  * This code is derived from software contributed to The NetBSD Foundation
816b9c606Sthorpej  * by Jason R. Thorpe.
916b9c606Sthorpej  *
1016b9c606Sthorpej  * Redistribution and use in source and binary forms, with or without
1116b9c606Sthorpej  * modification, are permitted provided that the following conditions
1216b9c606Sthorpej  * are met:
1316b9c606Sthorpej  * 1. Redistributions of source code must retain the above copyright
1416b9c606Sthorpej  *    notice, this list of conditions and the following disclaimer.
1516b9c606Sthorpej  * 2. Redistributions in binary form must reproduce the above copyright
1616b9c606Sthorpej  *    notice, this list of conditions and the following disclaimer in the
1716b9c606Sthorpej  *    documentation and/or other materials provided with the distribution.
1816b9c606Sthorpej  *
1916b9c606Sthorpej  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
2016b9c606Sthorpej  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
2116b9c606Sthorpej  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
2216b9c606Sthorpej  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
2316b9c606Sthorpej  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
2416b9c606Sthorpej  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
2516b9c606Sthorpej  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
2616b9c606Sthorpej  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
2716b9c606Sthorpej  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
2816b9c606Sthorpej  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
2916b9c606Sthorpej  * POSSIBILITY OF SUCH DAMAGE.
3016b9c606Sthorpej  */
3116b9c606Sthorpej 
3216b9c606Sthorpej #ifndef _ALGOR_INTR_H_
3316b9c606Sthorpej #define _ALGOR_INTR_H_
3416b9c606Sthorpej 
3587a95011Sad #include <sys/evcnt.h>
3616b9c606Sthorpej #include <sys/queue.h>
3716b9c606Sthorpej 
38ea810943Smatt #include <mips/intr.h>
3916b9c606Sthorpej 
4016b9c606Sthorpej #ifdef	_KERNEL
4116b9c606Sthorpej 
42f5439ed7Smatt struct evbmips_intrhand {
43f5439ed7Smatt 	LIST_ENTRY(evbmips_intrhand) ih_q;
44ea810943Smatt 	const void *ih_irqmap;
457c074dc8Sthorpej 	int (*ih_func)(void *);
467c074dc8Sthorpej 	void *ih_arg;
477c074dc8Sthorpej 	int ih_irq;		/* mostly for ISA */
48f5439ed7Smatt 	int ih_ipl;
497c074dc8Sthorpej };
507c074dc8Sthorpej 
51ce66bf08Sthorpej extern struct evcnt mips_int5_evcnt;
52*927b8a6cSmatt extern void *(*algor_intr_establish)(int, int (*)(void *), void *);
53*927b8a6cSmatt extern void (*algor_intr_disestablish)(void *);
54ce66bf08Sthorpej 
55ce66bf08Sthorpej void	intr_init(void);
56ce66bf08Sthorpej 
5716b9c606Sthorpej #endif /* _KERNEL */
5816b9c606Sthorpej #endif /* ! _ALGOR_INTR_H_ */
59