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