4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
22 * Copyright 2014 Garrett D'Amore <garrett@damore.org>
23 * Copyright (c) 1992, 2010, Oracle and/or its affiliates. All rights reserved.
30 #include <sys/mutex.h>
31 #include <sys/dditypes.h>
32 #include <sys/ddi_intr.h>
39 * Period of autovector structures (add this in to get the next level).
42 #define INT_IPL(x) (x)
43 #define AV_INT_SPURIOUS -1
45 typedef uint_t (*avfunc
)(caddr_t
, caddr_t
);
50 * Interrupt handler and argument to pass to it.
53 struct autovec
*av_link
; /* pointer to next on in chain */
54 uint_t (*av_vector
)();
58 uint_t av_prilevel
; /* priority level */
61 * Interrupt handle/id (like intrspec structure pointer) used to
62 * identify a specific instance of interrupt handler in case we
63 * have to remove the interrupt handler later.
68 ushort_t av_flags
; /* pending flags */
69 struct autovec
*av_ipl_link
; /* pointer to next on ipl chain */
72 #define AV_PENTRY_VECTMASK 0xff /* low 8 bit used for irqno */
73 #define AV_PENTRY_PEND 0x100 /* pending hardware interrupt */
74 #define AV_PENTRY_ONPROC 0x200 /* being serviced by CPU */
75 #define AV_PENTRY_LEVEL 0x8000 /* level-triggered interrupt */
78 struct autovec
*avh_link
;
83 /* softing contains a bit field of software interrupts which are pending */
90 extern kmutex_t av_lock
;
91 extern ddi_softint_hdl_impl_t softlevel_hdl
[];
92 extern ddi_softint_hdl_impl_t softlevel1_hdl
;
93 extern int add_avintr(void *intr_id
, int lvl
, avfunc xxintr
, char *name
,
94 int vect
, caddr_t arg1
, caddr_t arg2
, uint64_t *, dev_info_t
*);
95 extern int add_nmintr(int lvl
, avfunc nmintr
, char *name
, caddr_t arg
);
96 extern int add_avsoftintr(void *intr_id
, int lvl
, avfunc xxintr
,
97 char *name
, caddr_t arg1
, caddr_t arg2
);
98 extern int rem_avsoftintr(void *intr_id
, int lvl
, avfunc xxintr
);
99 extern int av_softint_movepri(void *intr_id
, int old_lvl
);
100 extern void update_avsoftintr_args(void *intr_id
, int lvl
, caddr_t arg2
);
101 extern void rem_avintr(void *intr_id
, int lvl
, avfunc xxintr
, int vect
);
102 extern void wait_till_seen(int ipl
);
103 extern uint_t
softlevel1(caddr_t
, caddr_t
);
111 #endif /* _SYS_AVINTR_H */