xref: /onnv-gate/usr/src/uts/intel/sys/fd_debug.h (revision 0:68f95e015346)
1*0Sstevel@tonic-gate /*
2*0Sstevel@tonic-gate  * CDDL HEADER START
3*0Sstevel@tonic-gate  *
4*0Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
5*0Sstevel@tonic-gate  * Common Development and Distribution License, Version 1.0 only
6*0Sstevel@tonic-gate  * (the "License").  You may not use this file except in compliance
7*0Sstevel@tonic-gate  * with the License.
8*0Sstevel@tonic-gate  *
9*0Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10*0Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
11*0Sstevel@tonic-gate  * See the License for the specific language governing permissions
12*0Sstevel@tonic-gate  * and limitations under the License.
13*0Sstevel@tonic-gate  *
14*0Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
15*0Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16*0Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
17*0Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
18*0Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
19*0Sstevel@tonic-gate  *
20*0Sstevel@tonic-gate  * CDDL HEADER END
21*0Sstevel@tonic-gate  */
22*0Sstevel@tonic-gate /*
23*0Sstevel@tonic-gate  * Copyright (c) 1989-1997,1999 by Sun Microsystems, Inc.
24*0Sstevel@tonic-gate  * All rights reserved.
25*0Sstevel@tonic-gate  */
26*0Sstevel@tonic-gate 
27*0Sstevel@tonic-gate #ifndef	_SYS_FD_DEBUG_H
28*0Sstevel@tonic-gate #define	_SYS_FD_DEBUG_H
29*0Sstevel@tonic-gate 
30*0Sstevel@tonic-gate #pragma ident	"%Z%%M%	%I%	%E% SMI"
31*0Sstevel@tonic-gate 
32*0Sstevel@tonic-gate #ifdef	__cplusplus
33*0Sstevel@tonic-gate extern "C" {
34*0Sstevel@tonic-gate #endif
35*0Sstevel@tonic-gate 
36*0Sstevel@tonic-gate /*
37*0Sstevel@tonic-gate  * flags/masks for error printing.
38*0Sstevel@tonic-gate  * the levels are for severity
39*0Sstevel@tonic-gate  */
40*0Sstevel@tonic-gate #define	FDEP_L0		0	/* chatty as can be - for debug! */
41*0Sstevel@tonic-gate #define	FDEP_L1		1	/* best for debug */
42*0Sstevel@tonic-gate #define	FDEP_L2		2	/* minor errors - retries, etc. */
43*0Sstevel@tonic-gate #define	FDEP_L3		3	/* major errors */
44*0Sstevel@tonic-gate #define	FDEP_L4		4	/* catastrophic errors, don't mask! */
45*0Sstevel@tonic-gate #define	FDEP_LMAX	4	/* catastrophic errors, don't mask! */
46*0Sstevel@tonic-gate 
47*0Sstevel@tonic-gate #ifdef DEBUG
48*0Sstevel@tonic-gate #define	FDERRPRINT(l, m, args)	\
49*0Sstevel@tonic-gate 	{ if (((l) >= fderrlevel) && ((m) & fderrmask)) cmn_err args; }
50*0Sstevel@tonic-gate #define	FCERRPRINT(l, m, args)	\
51*0Sstevel@tonic-gate 	{ if (((l) >= fcerrlevel) && ((m) & fcerrmask)) cmn_err args; }
52*0Sstevel@tonic-gate #else
53*0Sstevel@tonic-gate #define	FDERRPRINT(l, m, args)	{ }
54*0Sstevel@tonic-gate #define	FCERRPRINT(l, m, args)	{ }
55*0Sstevel@tonic-gate #endif /* DEBUG */
56*0Sstevel@tonic-gate 
57*0Sstevel@tonic-gate /*
58*0Sstevel@tonic-gate  * for each function, we can mask off its printing by clearing its bit in
59*0Sstevel@tonic-gate  * the fderrmask.  Some functions (attach, ident) share a mask bit
60*0Sstevel@tonic-gate  */
61*0Sstevel@tonic-gate #define	FDEM_IDEN 0x00000001	/* fdidentify */
62*0Sstevel@tonic-gate #define	FDEM_ATTA 0x00000001	/* fdattach */
63*0Sstevel@tonic-gate #define	FDEM_SIZE 0x00000002	/* fdsize */
64*0Sstevel@tonic-gate #define	FDEM_OPEN 0x00000004	/* fdopen */
65*0Sstevel@tonic-gate #define	FDEM_GETL 0x00000008	/* fdgetlabel */
66*0Sstevel@tonic-gate #define	FDEM_CLOS 0x00000010	/* fdclose */
67*0Sstevel@tonic-gate #define	FDEM_STRA 0x00000020	/* fdstrategy */
68*0Sstevel@tonic-gate #define	FDEM_STRT 0x00000040	/* fdstart */
69*0Sstevel@tonic-gate #define	FDEM_RDWR 0x00000080	/* fdrdwr */
70*0Sstevel@tonic-gate #define	FDEM_CMD  0x00000100	/* fdcmd */
71*0Sstevel@tonic-gate #define	FDEM_EXEC 0x00000200	/* fdexec */
72*0Sstevel@tonic-gate #define	FDEM_RECO 0x00000400	/* fdrecover */
73*0Sstevel@tonic-gate #define	FDEM_INTR 0x00000800	/* fdintr */
74*0Sstevel@tonic-gate #define	FDEM_WATC 0x00001000	/* fdwatch */
75*0Sstevel@tonic-gate #define	FDEM_IOCT 0x00002000	/* fdioctl */
76*0Sstevel@tonic-gate #define	FDEM_RAWI 0x00004000	/* fdrawioctl */
77*0Sstevel@tonic-gate #define	FDEM_PROP 0x00008000	/* fd_prop_op */
78*0Sstevel@tonic-gate #define	FDEM_GETC 0x00010000	/* fdgetcsb */
79*0Sstevel@tonic-gate #define	FDEM_RETC 0x00020000	/* fdretcsb */
80*0Sstevel@tonic-gate #define	FDEM_RESE 0x00040000	/* fdreset */
81*0Sstevel@tonic-gate #define	FDEM_RECA 0x00080000	/* fdrecalseek */
82*0Sstevel@tonic-gate #define	FDEM_FORM 0x00100000	/* fdformat */
83*0Sstevel@tonic-gate #define	FDEM_RW   0x00200000	/* fdrw */
84*0Sstevel@tonic-gate #define	FDEM_CHEK 0x00400000	/* fdcheckdisk */
85*0Sstevel@tonic-gate #define	FDEM_DSEL 0x00800000	/* fdselect */
86*0Sstevel@tonic-gate #define	FDEM_EJEC 0x01000000	/* fdeject */
87*0Sstevel@tonic-gate #define	FDEM_SCHG 0x02000000	/* fdsense_chng */
88*0Sstevel@tonic-gate #define	FDEM_PACK 0x04000000	/* fdpacklabel */
89*0Sstevel@tonic-gate #define	FDEM_MODS 0x08000000	/* _init, _info, _fini */
90*0Sstevel@tonic-gate #define	FDEM_ALL  0xFFFFFFFF	/* all */
91*0Sstevel@tonic-gate 
92*0Sstevel@tonic-gate #ifdef	__cplusplus
93*0Sstevel@tonic-gate }
94*0Sstevel@tonic-gate #endif
95*0Sstevel@tonic-gate 
96*0Sstevel@tonic-gate #endif	/* !_SYS_FD_DEBUG_H */
97