xref: /illumos-gate/usr/src/cmd/mdb/i86pc/modules/common/intr_common.h (revision 0a1278f26ea4b7c8c0285d4f2d6c5b680904aa01)
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 (the "License").
6  * You may not use this file except in compliance with the License.
7  *
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.
12  *
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]
18  *
19  * CDDL HEADER END
20  */
21 /*
22  * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
23  */
24 
25 #ifndef _MDB_INTR_COMMON_H
26 #define	_MDB_INTR_COMMON_H
27 
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
31 
32 #include <stddef.h>
33 #include <sys/mdb_modapi.h>
34 #include <mdb/mdb_ks.h>
35 #include <sys/modctl.h>
36 #include <sys/avintr.h>
37 #include <sys/psm_common.h>
38 #include <sys/pic.h>
39 #include <sys/apic.h>
40 #include <sys/apix.h>
41 
42 /*
43  * Function prototypes
44  */
45 void interrupt_help(void);
46 void interrupt_print_isr(uintptr_t, uintptr_t, uintptr_t);
47 void apic_interrupt_dump(apic_irq_t *, struct av_head *, int i,
48 	ushort_t *, char);
49 void apix_interrupt_dump(apix_vector_t *, apic_irq_t *,
50     struct autovec *, ushort_t *, char);
51 void apix_interrupt_ipi_dump(apix_vector_t *, struct autovec *,
52     ushort_t *);
53 int ioapic(uintptr_t, uint_t, int, const mdb_arg_t *);
54 int apic(uintptr_t addr, uint_t flags, int argc, const mdb_arg_t *argv);
55 
56 void soft_interrupt_help(void);
57 int soft_interrupt_dump(uintptr_t, uint_t, int, const mdb_arg_t *);
58 
59 /*
60  * ::interrupts usage related defines and variables
61  * -d and -i options are supported and saved in option_flags
62  */
63 #define	INTR_DISPLAY_DRVR_INST	0x1	/* -d option */
64 #define	INTR_DISPLAY_INTRSTAT	0x2	/* -i option */
65 
66 extern int	option_flags;
67 
68 #define	BUSTYPE_PCI	0x0d
69 #define	BUSTYPE_NONE	0x00
70 
71 /*
72  * gld_intr_addr is used to save address of gld_intr() ISR
73  */
74 extern uintptr_t	gld_intr_addr;
75 
76 #ifdef __cplusplus
77 }
78 #endif
79 
80 #endif	/* _MDB_INTR_COMMON_H */
81