xref: /titanic_51/usr/src/uts/sun4/io/px/px_debug.h (revision 733ed7372ce52463509c62783a184105d3f1a618)
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 2006 Sun Microsystems, Inc.  All rights reserved.
23  * Use is subject to license terms.
24  */
25 
26 #ifndef	_SYS_PX_DEBUG_H
27 #define	_SYS_PX_DEBUG_H
28 
29 #pragma ident	"%Z%%M%	%I%	%E% SMI"
30 
31 #ifdef	__cplusplus
32 extern "C" {
33 #endif
34 
35 #include <sys/varargs.h>	/* va_list */
36 #include <sys/promif.h>		/* prom_printf */
37 
38 typedef enum {	/* same sequence as px_debug_sym[] */
39 	/*  0 */ DBG_ATTACH,
40 	/*  1 */ DBG_DETACH,
41 	/*  2 */ DBG_MAP,
42 	/*  3 */ DBG_CTLOPS,
43 
44 	/*  4 */ DBG_INTROPS,
45 	/*  5 */ DBG_A_INTX,
46 	/*  6 */ DBG_R_INTX,
47 	/*  7 */ DBG_INTX_INTR,
48 
49 	/*  8 */ DBG_MSIQ,
50 	/*  9 */ DBG_MSIQ_INTR,
51 	/* 10 */ DBG_MSG,
52 	/* 11 */ DBG_MSG_INTR,
53 
54 	/* 12 */ DBG_A_MSIX,
55 	/* 13 */ DBG_R_MSIX,
56 	/* 14 */ DBG_MSIX_INTR,
57 	/* 15 */ DBG_ERR_INTR,
58 
59 	/* 16 */ DBG_DMA_ALLOCH,
60 	/* 17 */ DBG_DMA_FREEH,
61 	/* 18 */ DBG_DMA_BINDH,
62 	/* 19 */ DBG_DMA_UNBINDH,
63 
64 	/* 20 */ DBG_CHK_MOD,
65 	/* 21 */ DBG_BYPASS,
66 	/* 22 */ DBG_FAST_DVMA,
67 	/* 23 */ DBG_INIT_CLD,
68 
69 	/* 24 */ DBG_DMA_MAP,
70 	/* 25 */ DBG_DMA_WIN,
71 	/* 26 */ DBG_MAP_WIN,
72 	/* 27 */ DBG_UNMAP_WIN,
73 
74 	/* 28 */ DBG_DMA_CTL,
75 	/* 29 */ DBG_DMA_SYNC,
76 	/* 30 */ DBG_RSV1,
77 	/* 31 */ DBG_RSV2,
78 
79 	/* 32 */ DBG_IB,
80 	/* 33 */ DBG_CB,
81 	/* 34 */ DBG_DMC,
82 	/* 35 */ DBG_PEC,
83 
84 	/* 36 */ DBG_ILU,
85 	/* 37 */ DBG_TLU,
86 	/* 38 */ DBG_LPU,
87 	/* 39 */ DBG_MMU,
88 
89 	/* 40 */ DBG_OPEN,
90 	/* 41 */ DBG_CLOSE,
91 	/* 42 */ DBG_IOCTL,
92 	/* 43 */ DBG_PWR,
93 
94 	/* 44 */ DBG_LIB_CFG,
95 	/* 45 */ DBG_LIB_INT,
96 	/* 46 */ DBG_LIB_DMA,
97 	/* 47 */ DBG_LIB_MSIQ,
98 
99 	/* 48 */ DBG_LIB_MSI,
100 	/* 49 */ DBG_LIB_MSG,
101 	/* 50 */ DBG_RSV4,
102 	/* 51 */ DBG_RSV5,
103 
104 	/* 52 */ DBG_TOOLS,
105 	/* 53 */ DBG_PHYS_ACC,
106 
107 	/* 54 */ DBG_HP
108 } px_debug_bit_t;
109 
110 #define	DBG_BITS	6
111 #define	DBG_CONT	(1 << DBG_BITS)
112 #define	DBG_MASK	(DBG_CONT - 1)
113 
114 #if defined(DEBUG)
115 
116 #define	DBG px_dbg
117 extern void px_dbg(px_debug_bit_t bit, dev_info_t *dip, char *fmt, ...);
118 
119 #else	/* DEBUG */
120 
121 #define	DBG 0 &&
122 
123 #endif	/* DEBUG */
124 
125 #ifdef	__cplusplus
126 }
127 #endif
128 
129 #endif	/* _SYS_PX_DEBUG_H */
130