xref: /onnv-gate/usr/src/uts/sun4/io/px/px_debug.h (revision 27:c1f182000c0a)
10Sstevel@tonic-gate /*
20Sstevel@tonic-gate  * CDDL HEADER START
30Sstevel@tonic-gate  *
40Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
50Sstevel@tonic-gate  * Common Development and Distribution License, Version 1.0 only
60Sstevel@tonic-gate  * (the "License").  You may not use this file except in compliance
70Sstevel@tonic-gate  * with the License.
80Sstevel@tonic-gate  *
90Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
100Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
110Sstevel@tonic-gate  * See the License for the specific language governing permissions
120Sstevel@tonic-gate  * and limitations under the License.
130Sstevel@tonic-gate  *
140Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
150Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
160Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
170Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
180Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
190Sstevel@tonic-gate  *
200Sstevel@tonic-gate  * CDDL HEADER END
210Sstevel@tonic-gate  */
220Sstevel@tonic-gate /*
230Sstevel@tonic-gate  * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
240Sstevel@tonic-gate  * Use is subject to license terms.
250Sstevel@tonic-gate  */
260Sstevel@tonic-gate 
270Sstevel@tonic-gate #ifndef	_SYS_PX_DEBUG_H
280Sstevel@tonic-gate #define	_SYS_PX_DEBUG_H
290Sstevel@tonic-gate 
300Sstevel@tonic-gate #pragma ident	"%Z%%M%	%I%	%E% SMI"
310Sstevel@tonic-gate 
320Sstevel@tonic-gate #ifdef	__cplusplus
330Sstevel@tonic-gate extern "C" {
340Sstevel@tonic-gate #endif
350Sstevel@tonic-gate 
360Sstevel@tonic-gate #include <sys/varargs.h>	/* va_list */
370Sstevel@tonic-gate #include <sys/promif.h>		/* prom_printf */
380Sstevel@tonic-gate 
390Sstevel@tonic-gate typedef enum {	/* same sequence as px_debug_sym[] */
400Sstevel@tonic-gate 	/*  0 */ DBG_ATTACH,
410Sstevel@tonic-gate 	/*  1 */ DBG_DETACH,
420Sstevel@tonic-gate 	/*  2 */ DBG_MAP,
430Sstevel@tonic-gate 	/*  3 */ DBG_CTLOPS,
440Sstevel@tonic-gate 
450Sstevel@tonic-gate 	/*  4 */ DBG_INTROPS,
460Sstevel@tonic-gate 	/*  5 */ DBG_A_INTX,
470Sstevel@tonic-gate 	/*  6 */ DBG_R_INTX,
480Sstevel@tonic-gate 	/*  7 */ DBG_INTX_INTR,
490Sstevel@tonic-gate 
500Sstevel@tonic-gate 	/*  8 */ DBG_MSIQ,
510Sstevel@tonic-gate 	/*  9 */ DBG_MSIQ_INTR,
520Sstevel@tonic-gate 	/* 10 */ DBG_MSG,
530Sstevel@tonic-gate 	/* 11 */ DBG_MSG_INTR,
540Sstevel@tonic-gate 
550Sstevel@tonic-gate 	/* 12 */ DBG_A_MSIX,
560Sstevel@tonic-gate 	/* 13 */ DBG_R_MSIX,
570Sstevel@tonic-gate 	/* 14 */ DBG_MSIX_INTR,
580Sstevel@tonic-gate 	/* 15 */ DBG_ERR_INTR,
590Sstevel@tonic-gate 
600Sstevel@tonic-gate 	/* 16 */ DBG_DMA_ALLOCH,
610Sstevel@tonic-gate 	/* 17 */ DBG_DMA_FREEH,
620Sstevel@tonic-gate 	/* 18 */ DBG_DMA_BINDH,
630Sstevel@tonic-gate 	/* 19 */ DBG_DMA_UNBINDH,
640Sstevel@tonic-gate 
650Sstevel@tonic-gate 	/* 20 */ DBG_CHK_MOD,
660Sstevel@tonic-gate 	/* 21 */ DBG_BYPASS,
670Sstevel@tonic-gate 	/* 22 */ DBG_FAST_DVMA,
680Sstevel@tonic-gate 	/* 23 */ DBG_INIT_CLD,
690Sstevel@tonic-gate 
700Sstevel@tonic-gate 	/* 24 */ DBG_DMA_MAP,
710Sstevel@tonic-gate 	/* 25 */ DBG_DMA_WIN,
720Sstevel@tonic-gate 	/* 26 */ DBG_MAP_WIN,
730Sstevel@tonic-gate 	/* 27 */ DBG_UNMAP_WIN,
740Sstevel@tonic-gate 
750Sstevel@tonic-gate 	/* 28 */ DBG_DMA_CTL,
760Sstevel@tonic-gate 	/* 29 */ DBG_DMA_SYNC,
770Sstevel@tonic-gate 	/* 30 */ DBG_RSV1,
780Sstevel@tonic-gate 	/* 31 */ DBG_RSV2,
790Sstevel@tonic-gate 
800Sstevel@tonic-gate 	/* 32 */ DBG_IB,
810Sstevel@tonic-gate 	/* 33 */ DBG_CB,
820Sstevel@tonic-gate 	/* 34 */ DBG_DMC,
830Sstevel@tonic-gate 	/* 35 */ DBG_PEC,
840Sstevel@tonic-gate 
850Sstevel@tonic-gate 	/* 36 */ DBG_ILU,
860Sstevel@tonic-gate 	/* 37 */ DBG_TLU,
870Sstevel@tonic-gate 	/* 38 */ DBG_LPU,
88*27Sjchu 	/* 39 */ DBG_MMU,
890Sstevel@tonic-gate 
900Sstevel@tonic-gate 	/* 40 */ DBG_OPEN,
910Sstevel@tonic-gate 	/* 41 */ DBG_CLOSE,
920Sstevel@tonic-gate 	/* 42 */ DBG_IOCTL,
930Sstevel@tonic-gate 	/* 43 */ DBG_PWR,
940Sstevel@tonic-gate 
950Sstevel@tonic-gate 	/* 44 */ DBG_LIB_CFG,
960Sstevel@tonic-gate 	/* 45 */ DBG_LIB_INT,
970Sstevel@tonic-gate 	/* 46 */ DBG_LIB_DMA,
980Sstevel@tonic-gate 	/* 47 */ DBG_LIB_MSIQ,
990Sstevel@tonic-gate 
1000Sstevel@tonic-gate 	/* 48 */ DBG_LIB_MSI,
1010Sstevel@tonic-gate 	/* 49 */ DBG_LIB_MSG,
1020Sstevel@tonic-gate 	/* 50 */ DBG_RSV4,
1030Sstevel@tonic-gate 	/* 51 */ DBG_RSV5,
1040Sstevel@tonic-gate 
1050Sstevel@tonic-gate 	/* 52 */ DBG_TOOLS,
1060Sstevel@tonic-gate 	/* 53 */ DBG_PHYS_ACC
1070Sstevel@tonic-gate } px_debug_bit_t;
1080Sstevel@tonic-gate 
1090Sstevel@tonic-gate #define	DBG_BITS	6
1100Sstevel@tonic-gate #define	DBG_CONT	(1 << DBG_BITS)
1110Sstevel@tonic-gate #define	DBG_MASK	(DBG_CONT - 1)
1120Sstevel@tonic-gate 
1130Sstevel@tonic-gate #if defined(DEBUG)
1140Sstevel@tonic-gate 
1150Sstevel@tonic-gate #define	LOG px_dbg
1160Sstevel@tonic-gate #define	DBG px_dbg
1170Sstevel@tonic-gate extern void px_dbg(px_debug_bit_t bit, dev_info_t *dip, char *fmt, ...);
1180Sstevel@tonic-gate 
1190Sstevel@tonic-gate #else	/* DEBUG */
1200Sstevel@tonic-gate 
1210Sstevel@tonic-gate #define	LOG px_log2ce
1220Sstevel@tonic-gate #define	DBG 0 &&
1230Sstevel@tonic-gate extern void px_log2ce(px_debug_bit_t bit, dev_info_t *dip, char *fmt, ...);
1240Sstevel@tonic-gate 
1250Sstevel@tonic-gate #endif	/* DEBUG */
1260Sstevel@tonic-gate 
1270Sstevel@tonic-gate #ifdef	__cplusplus
1280Sstevel@tonic-gate }
1290Sstevel@tonic-gate #endif
1300Sstevel@tonic-gate 
1310Sstevel@tonic-gate #endif	/* _SYS_PX_DEBUG_H */
132