xref: /illumos-gate/usr/src/uts/common/sys/fd_debug.h (revision 86d949f9497332fe19be6b5d711d265eb957439f)
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 (c) 1989-1997, by Sun Microsystems, Inc.
24  */
25 
26 #ifndef	_SYS_FD_DEBUG_H
27 #define	_SYS_FD_DEBUG_H
28 
29 #ifdef	__cplusplus
30 extern "C" {
31 #endif
32 
33 /*
34  * flags/masks for error printing.
35  * the levels are for severity
36  */
37 #define	FDEP_L0		0	/* chatty as can be - for debug! */
38 #define	FDEP_L1		1	/* best for debug */
39 #define	FDEP_L2		2	/* minor errors - retries, etc. */
40 #define	FDEP_L3		3	/* major errors */
41 #define	FDEP_L4		4	/* catastrophic errors, don't mask! */
42 #define	FDEP_LMAX	4	/* catastrophic errors, don't mask! */
43 
44 #ifdef DEBUG
45 #define	FDERRPRINT(l, m, args)	\
46 	{ if (((l) >= fderrlevel) && ((m) & fderrmask)) cmn_err args; }
47 #define	FCERRPRINT(l, m, args)	\
48 	{ if (((l) >= fcerrlevel) && ((m) & fcerrmask)) cmn_err args; }
49 #else
50 #define	FDERRPRINT(l, m, args)	{ }
51 #define	FCERRPRINT(l, m, args)	{ }
52 #endif /* DEBUG */
53 
54 /*
55  * for each function, we can mask off its printing by clearing its bit in
56  * the fderrmask.  Some functions (attach, ident) share a mask bit
57  */
58 #define	FDEM_IDEN 0x00000001	/* fdidentify */
59 #define	FDEM_ATTA 0x00000001	/* fdattach */
60 #define	FDEM_SIZE 0x00000002	/* fdsize */
61 #define	FDEM_OPEN 0x00000004	/* fdopen */
62 #define	FDEM_GETL 0x00000008	/* fdgetlabel */
63 #define	FDEM_CLOS 0x00000010	/* fdclose */
64 #define	FDEM_STRA 0x00000020	/* fdstrategy */
65 #define	FDEM_STRT 0x00000040	/* fdstart */
66 #define	FDEM_RDWR 0x00000080	/* fdrdwr */
67 #define	FDEM_CMD  0x00000100	/* fdcmd */
68 #define	FDEM_EXEC 0x00000200	/* fdexec */
69 #define	FDEM_RECO 0x00000400	/* fdrecover */
70 #define	FDEM_INTR 0x00000800	/* fdintr */
71 #define	FDEM_WATC 0x00001000	/* fdwatch */
72 #define	FDEM_IOCT 0x00002000	/* fdioctl */
73 #define	FDEM_RAWI 0x00004000	/* fdrawioctl */
74 #define	FDEM_PROP 0x00008000	/* fd_prop_op */
75 #define	FDEM_GETC 0x00010000	/* fdgetcsb */
76 #define	FDEM_RETC 0x00020000	/* fdretcsb */
77 #define	FDEM_RESE 0x00040000	/* fdreset */
78 #define	FDEM_RECA 0x00080000	/* fdrecalseek */
79 #define	FDEM_FORM 0x00100000	/* fdformat */
80 #define	FDEM_RW   0x00200000	/* fdrw */
81 #define	FDEM_CHEK 0x00400000	/* fdcheckdisk */
82 #define	FDEM_DSEL 0x00800000	/* fdselect */
83 #define	FDEM_EJEC 0x01000000	/* fdeject */
84 #define	FDEM_SCHG 0x02000000	/* fdsense_chng */
85 #define	FDEM_PACK 0x04000000	/* fdpacklabel */
86 #define	FDEM_MODS 0x08000000	/* _init, _info, _fini */
87 #define	FDEM_ALL  0xFFFFFFFF	/* all */
88 
89 #ifdef	__cplusplus
90 }
91 #endif
92 
93 #endif	/* !_SYS_FD_DEBUG_H */
94