xref: /titanic_52/usr/src/uts/sun4/sys/ivintr.h (revision bdfc6d18da790deeec2e0eb09c625902defe2498)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License, Version 1.0 only
6  * (the "License").  You may not use this file except in compliance
7  * with the License.
8  *
9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10  * or http://www.opensolaris.org/os/licensing.
11  * See the License for the specific language governing permissions
12  * and limitations under the License.
13  *
14  * When distributing Covered Code, include this CDDL HEADER in each
15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16  * If applicable, add the following below this CDDL HEADER, with the
17  * fields enclosed by brackets "[]" replaced with your own identifying
18  * information: Portions Copyright [yyyy] [name of copyright owner]
19  *
20  * CDDL HEADER END
21  */
22 /*
23  * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
24  * Use is subject to license terms.
25  */
26 
27 #ifndef	_SYS_IVINTR_H
28 #define	_SYS_IVINTR_H
29 
30 #pragma ident	"%Z%%M%	%I%	%E% SMI"
31 
32 #ifdef	__cplusplus
33 extern "C" {
34 #endif
35 
36 typedef uint_t (*intrfunc)(caddr_t);
37 typedef uint_t (*softintrfunc)(caddr_t, caddr_t);
38 
39 /*
40  * Interrupt Vector Table Entry
41  *
42  *	The interrupt vector table is dynamically allocated during
43  *	startup. An interrupt number is an index to the interrupt
44  *	vector table representing unique interrupt source to the system.
45  */
46 struct intr_vector {
47 	intrfunc	iv_handler;	/* interrupt handler */
48 	caddr_t		iv_arg;		/* interrupt argument */
49 	ushort_t	iv_pil;		/* interrupt request level */
50 	ushort_t	iv_pending;	/* pending softint flag */
51 	caddr_t		iv_payload_buf;	/* pointer to 64-byte mondo payload */
52 	caddr_t		iv_softint_arg2; /* softint argument #2 */
53 	void		*iv_pad[3];	/* makes structure power-of-2 size */
54 };
55 
56 extern struct intr_vector intr_vector[];
57 
58 extern uint_t nohandler(caddr_t);
59 extern void init_ivintr(void);
60 extern int add_ivintr(uint_t, uint_t, intrfunc, caddr_t, caddr_t);
61 extern void rem_ivintr(uint_t, struct intr_vector *);
62 #define	GET_IVINTR(inum)  (intr_vector[inum].iv_handler != nohandler)
63 
64 extern uint_t add_softintr(uint_t, softintrfunc, caddr_t);
65 extern void rem_softintr(uint_t);
66 extern int update_softint_arg2(uint_t, caddr_t);
67 extern int update_softint_pri(uint_t, int);
68 
69 #ifdef	__cplusplus
70 }
71 #endif
72 
73 #endif	/* _SYS_IVINTR_H */
74