1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
|
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _SYS_PX_DEBUG_H
#define _SYS_PX_DEBUG_H
#ifdef __cplusplus
extern "C" {
#endif
#include <sys/varargs.h> /* va_list */
#include <sys/promif.h> /* prom_printf */
typedef enum { /* same sequence as px_debug_sym[] */
/* 0 */ DBG_ATTACH,
/* 1 */ DBG_DETACH,
/* 2 */ DBG_MAP,
/* 3 */ DBG_CTLOPS,
/* 4 */ DBG_INTROPS,
/* 5 */ DBG_A_INTX,
/* 6 */ DBG_R_INTX,
/* 7 */ DBG_INTX_INTR,
/* 8 */ DBG_MSIQ,
/* 9 */ DBG_MSIQ_INTR,
/* 10 */ DBG_MSG,
/* 11 */ DBG_MSG_INTR,
/* 12 */ DBG_A_MSIX,
/* 13 */ DBG_R_MSIX,
/* 14 */ DBG_MSIX_INTR,
/* 15 */ DBG_ERR_INTR,
/* 16 */ DBG_DMA_ALLOCH,
/* 17 */ DBG_DMA_FREEH,
/* 18 */ DBG_DMA_BINDH,
/* 19 */ DBG_DMA_UNBINDH,
/* 20 */ DBG_CHK_MOD,
/* 21 */ DBG_BYPASS,
/* 22 */ DBG_FAST_DVMA,
/* 23 */ DBG_INIT_CLD,
/* 24 */ DBG_DMA_MAP,
/* 25 */ DBG_DMA_WIN,
/* 26 */ DBG_MAP_WIN,
/* 27 */ DBG_UNMAP_WIN,
/* 28 */ DBG_DMA_CTL,
/* 29 */ DBG_DMA_SYNC,
/* 30 */ DBG_RSV1,
/* 31 */ DBG_RSV2,
/* 32 */ DBG_IB,
/* 33 */ DBG_CB,
/* 34 */ DBG_DMC,
/* 35 */ DBG_PEC,
/* 36 */ DBG_ILU,
/* 37 */ DBG_TLU,
/* 38 */ DBG_LPU,
/* 39 */ DBG_MMU,
/* 40 */ DBG_OPEN,
/* 41 */ DBG_CLOSE,
/* 42 */ DBG_IOCTL,
/* 43 */ DBG_PWR,
/* 44 */ DBG_LIB_CFG,
/* 45 */ DBG_LIB_INT,
/* 46 */ DBG_LIB_DMA,
/* 47 */ DBG_LIB_MSIQ,
/* 48 */ DBG_LIB_MSI,
/* 49 */ DBG_LIB_MSG,
/* 50 */ DBG_RSV4,
/* 51 */ DBG_RSV5,
/* 52 */ DBG_TOOLS,
/* 53 */ DBG_PHYS_ACC,
/* 54 */ DBG_HP,
/* 55 */ DBG_MPS
} px_debug_bit_t;
#define DBG_BITS 6
#define DBG_CONT (1 << DBG_BITS)
#define DBG_MASK (DBG_CONT - 1)
#define DBG_MSG_SIZE 320
/* Used only during High PIL printing */
typedef struct px_dbg_msg {
boolean_t active;
px_debug_bit_t bit;
dev_info_t *dip;
char msg[DBG_MSG_SIZE];
} px_dbg_msg_t;
extern void px_dbg_attach(dev_info_t *dip, ddi_softint_handle_t *px_dbg_hdl);
extern void px_dbg_detach(dev_info_t *dip, ddi_softint_handle_t *px_dbg_hdl);
#if defined(DEBUG)
#define DBG px_dbg
extern void px_dbg(px_debug_bit_t bit, dev_info_t *dip, char *fmt, ...);
#else /* DEBUG */
#define DBG 0 &&
#endif /* DEBUG */
#ifdef __cplusplus
}
#endif
#endif /* _SYS_PX_DEBUG_H */
|