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 51786Sjj156685 * Common Development and Distribution License (the "License"). 61786Sjj156685 * You may not use this file except in compliance with the License. 70Sstevel@tonic-gate * 80Sstevel@tonic-gate * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 90Sstevel@tonic-gate * or http://www.opensolaris.org/os/licensing. 100Sstevel@tonic-gate * See the License for the specific language governing permissions 110Sstevel@tonic-gate * and limitations under the License. 120Sstevel@tonic-gate * 130Sstevel@tonic-gate * When distributing Covered Code, include this CDDL HEADER in each 140Sstevel@tonic-gate * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 150Sstevel@tonic-gate * If applicable, add the following below this CDDL HEADER, with the 160Sstevel@tonic-gate * fields enclosed by brackets "[]" replaced with your own identifying 170Sstevel@tonic-gate * information: Portions Copyright [yyyy] [name of copyright owner] 180Sstevel@tonic-gate * 190Sstevel@tonic-gate * CDDL HEADER END 200Sstevel@tonic-gate */ 210Sstevel@tonic-gate /* 22*7596SAlan.Adamson@Sun.COM * Copyright 2008 Sun Microsystems, Inc. All rights reserved. 230Sstevel@tonic-gate * Use is subject to license terms. 240Sstevel@tonic-gate */ 250Sstevel@tonic-gate 260Sstevel@tonic-gate #ifndef _SYS_PX_DEBUG_H 270Sstevel@tonic-gate #define _SYS_PX_DEBUG_H 280Sstevel@tonic-gate 290Sstevel@tonic-gate #ifdef __cplusplus 300Sstevel@tonic-gate extern "C" { 310Sstevel@tonic-gate #endif 320Sstevel@tonic-gate 330Sstevel@tonic-gate #include <sys/varargs.h> /* va_list */ 340Sstevel@tonic-gate #include <sys/promif.h> /* prom_printf */ 350Sstevel@tonic-gate 360Sstevel@tonic-gate typedef enum { /* same sequence as px_debug_sym[] */ 370Sstevel@tonic-gate /* 0 */ DBG_ATTACH, 380Sstevel@tonic-gate /* 1 */ DBG_DETACH, 390Sstevel@tonic-gate /* 2 */ DBG_MAP, 400Sstevel@tonic-gate /* 3 */ DBG_CTLOPS, 410Sstevel@tonic-gate 420Sstevel@tonic-gate /* 4 */ DBG_INTROPS, 430Sstevel@tonic-gate /* 5 */ DBG_A_INTX, 440Sstevel@tonic-gate /* 6 */ DBG_R_INTX, 450Sstevel@tonic-gate /* 7 */ DBG_INTX_INTR, 460Sstevel@tonic-gate 470Sstevel@tonic-gate /* 8 */ DBG_MSIQ, 480Sstevel@tonic-gate /* 9 */ DBG_MSIQ_INTR, 490Sstevel@tonic-gate /* 10 */ DBG_MSG, 500Sstevel@tonic-gate /* 11 */ DBG_MSG_INTR, 510Sstevel@tonic-gate 520Sstevel@tonic-gate /* 12 */ DBG_A_MSIX, 530Sstevel@tonic-gate /* 13 */ DBG_R_MSIX, 540Sstevel@tonic-gate /* 14 */ DBG_MSIX_INTR, 550Sstevel@tonic-gate /* 15 */ DBG_ERR_INTR, 560Sstevel@tonic-gate 570Sstevel@tonic-gate /* 16 */ DBG_DMA_ALLOCH, 580Sstevel@tonic-gate /* 17 */ DBG_DMA_FREEH, 590Sstevel@tonic-gate /* 18 */ DBG_DMA_BINDH, 600Sstevel@tonic-gate /* 19 */ DBG_DMA_UNBINDH, 610Sstevel@tonic-gate 620Sstevel@tonic-gate /* 20 */ DBG_CHK_MOD, 630Sstevel@tonic-gate /* 21 */ DBG_BYPASS, 640Sstevel@tonic-gate /* 22 */ DBG_FAST_DVMA, 650Sstevel@tonic-gate /* 23 */ DBG_INIT_CLD, 660Sstevel@tonic-gate 670Sstevel@tonic-gate /* 24 */ DBG_DMA_MAP, 680Sstevel@tonic-gate /* 25 */ DBG_DMA_WIN, 690Sstevel@tonic-gate /* 26 */ DBG_MAP_WIN, 700Sstevel@tonic-gate /* 27 */ DBG_UNMAP_WIN, 710Sstevel@tonic-gate 720Sstevel@tonic-gate /* 28 */ DBG_DMA_CTL, 730Sstevel@tonic-gate /* 29 */ DBG_DMA_SYNC, 740Sstevel@tonic-gate /* 30 */ DBG_RSV1, 750Sstevel@tonic-gate /* 31 */ DBG_RSV2, 760Sstevel@tonic-gate 770Sstevel@tonic-gate /* 32 */ DBG_IB, 780Sstevel@tonic-gate /* 33 */ DBG_CB, 790Sstevel@tonic-gate /* 34 */ DBG_DMC, 800Sstevel@tonic-gate /* 35 */ DBG_PEC, 810Sstevel@tonic-gate 820Sstevel@tonic-gate /* 36 */ DBG_ILU, 830Sstevel@tonic-gate /* 37 */ DBG_TLU, 840Sstevel@tonic-gate /* 38 */ DBG_LPU, 8527Sjchu /* 39 */ DBG_MMU, 860Sstevel@tonic-gate 870Sstevel@tonic-gate /* 40 */ DBG_OPEN, 880Sstevel@tonic-gate /* 41 */ DBG_CLOSE, 890Sstevel@tonic-gate /* 42 */ DBG_IOCTL, 900Sstevel@tonic-gate /* 43 */ DBG_PWR, 910Sstevel@tonic-gate 920Sstevel@tonic-gate /* 44 */ DBG_LIB_CFG, 930Sstevel@tonic-gate /* 45 */ DBG_LIB_INT, 940Sstevel@tonic-gate /* 46 */ DBG_LIB_DMA, 950Sstevel@tonic-gate /* 47 */ DBG_LIB_MSIQ, 960Sstevel@tonic-gate 970Sstevel@tonic-gate /* 48 */ DBG_LIB_MSI, 980Sstevel@tonic-gate /* 49 */ DBG_LIB_MSG, 990Sstevel@tonic-gate /* 50 */ DBG_RSV4, 1000Sstevel@tonic-gate /* 51 */ DBG_RSV5, 1010Sstevel@tonic-gate 1020Sstevel@tonic-gate /* 52 */ DBG_TOOLS, 1031786Sjj156685 /* 53 */ DBG_PHYS_ACC, 104*7596SAlan.Adamson@Sun.COM /* 54 */ DBG_HP, 105*7596SAlan.Adamson@Sun.COM /* 55 */ DBG_MPS 1061786Sjj156685 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) 1123274Set142600 #define DBG_MSG_SIZE 320 1133274Set142600 1143274Set142600 /* Used only during High PIL printing */ 1153274Set142600 typedef struct px_dbg_msg { 1163274Set142600 boolean_t active; 1173274Set142600 px_debug_bit_t bit; 1183274Set142600 dev_info_t *dip; 1193274Set142600 char msg[DBG_MSG_SIZE]; 1203274Set142600 } px_dbg_msg_t; 1213274Set142600 1223274Set142600 extern void px_dbg_attach(dev_info_t *dip, ddi_softint_handle_t *px_dbg_hdl); 1233274Set142600 extern void px_dbg_detach(dev_info_t *dip, ddi_softint_handle_t *px_dbg_hdl); 1240Sstevel@tonic-gate 1250Sstevel@tonic-gate #if defined(DEBUG) 1260Sstevel@tonic-gate 1270Sstevel@tonic-gate #define DBG px_dbg 1280Sstevel@tonic-gate extern void px_dbg(px_debug_bit_t bit, dev_info_t *dip, char *fmt, ...); 1290Sstevel@tonic-gate 1300Sstevel@tonic-gate #else /* DEBUG */ 1310Sstevel@tonic-gate 1320Sstevel@tonic-gate #define DBG 0 && 1330Sstevel@tonic-gate 1340Sstevel@tonic-gate #endif /* DEBUG */ 1350Sstevel@tonic-gate 1360Sstevel@tonic-gate #ifdef __cplusplus 1370Sstevel@tonic-gate } 1380Sstevel@tonic-gate #endif 1390Sstevel@tonic-gate 1400Sstevel@tonic-gate #endif /* _SYS_PX_DEBUG_H */ 141