• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * osDebug.h
3  *
4  * Copyright(c) 1998 - 2009 Texas Instruments. All rights reserved.
5  * All rights reserved.
6  *
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted provided that the following conditions
9  * are met:
10  *
11  *  * Redistributions of source code must retain the above copyright
12  *    notice, this list of conditions and the following disclaimer.
13  *  * Redistributions in binary form must reproduce the above copyright
14  *    notice, this list of conditions and the following disclaimer in
15  *    the documentation and/or other materials provided with the
16  *    distribution.
17  *  * Neither the name Texas Instruments nor the names of its
18  *    contributors may be used to endorse or promote products derived
19  *    from this software without specific prior written permission.
20  *
21  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
24  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
25  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32  */
33 
34 
35 #ifndef __OSDEBUG_H_
36 #define __OSDEBUG_H_
37 
38 #ifdef TI_DBG
39 #ifndef _WINDOWS
40 #include "windows_types.h"
41 #endif /*_WINDOWS*/
42 
43 
44 #define IF_TIDEBUG(f)  if (!((TiDebugFlag & (f))^(f)))
45 extern unsigned long TiDebugFlag;
46 
47 #define PRINT(F, A)		IF_TIDEBUG( F ) { os_printf(A); }
48 #define PRINTF(F, A)	IF_TIDEBUG( F ) { os_printf A; }
49 
50 #define DBG_INIT				0x0001
51 #define DBG_REGISTRY			0x0002
52 #define DBG_NDIS_CALLS			0x0004
53 #define DBG_NDIS_OIDS			0x0008
54 #define DBG_PCI_RES				0x0010
55 #define DBG_INTERRUPT			0x0020
56 #define DBG_IOCTL				0x0040
57 #define DBG_RECV				0x0080
58 #define DBG_SEND				0x0100
59 
60 #define DBG_SEV_INFO			0x0001
61 #define DBG_SEV_LOUD			0x0002
62 #define DBG_SEV_VERY_LOUD		0x0004
63 #define DBG_SEV_WARNING			0x0008
64 #define DBG_SEV_ERROR			0x0010
65 #define DBG_SEV_FATAL_ERROR		0x0020
66 
67 
68 #define DBG_INIT_INFO				((DBG_INIT << 16) | DBG_SEV_INFO)
69 #define DBG_INIT_LOUD				((DBG_INIT << 16) | DBG_SEV_LOUD)
70 #define DBG_INIT_VERY_LOUD			((DBG_INIT << 16) | DBG_SEV_VERY_LOUD)
71 #define DBG_INIT_WARNING			((DBG_INIT << 16) | DBG_SEV_WARNING)
72 #define DBG_INIT_ERROR				((DBG_INIT << 16) | DBG_SEV_ERROR)
73 #define DBG_INIT_FATAL_ERROR		((DBG_INIT << 16) | DBG_SEV_FATAL_ERROR)
74 
75 #define DBG_REGISTRY_INFO			((DBG_REGISTRY << 16) | DBG_SEV_INFO)
76 #define DBG_REGISTRY_LOUD			((DBG_REGISTRY << 16) | DBG_SEV_LOUD)
77 #define DBG_REGISTRY_VERY_LOUD		((DBG_REGISTRY << 16) | DBG_SEV_VERY_LOUD)
78 #define DBG_REGISTRY_WARNING		((DBG_REGISTRY << 16) | DBG_SEV_WARNING)
79 #define DBG_REGISTRY_ERROR			((DBG_REGISTRY << 16) | DBG_SEV_ERROR)
80 #define DBG_REGISTRY_FATAL_ERROR	((DBG_REGISTRY << 16) | DBG_SEV_FATAL_ERROR)
81 
82 #define DBG_NDIS_CALLS_INFO			((DBG_NDIS_CALLS << 16) | DBG_SEV_INFO)
83 #define DBG_NDIS_CALLS_LOUD			((DBG_NDIS_CALLS << 16) | DBG_SEV_LOUD)
84 #define DBG_NDIS_CALLS_VERY_LOUD	((DBG_NDIS_CALLS << 16) | DBG_SEV_VERY_LOUD)
85 #define DBG_NDIS_CALLS_WARNING		((DBG_NDIS_CALLS << 16) | DBG_SEV_WARNING)
86 #define DBG_NDIS_CALLS_ERROR		((DBG_NDIS_CALLS << 16) | DBG_SEV_ERROR)
87 #define DBG_NDIS_CALLS_FATAL_ERROR	((DBG_NDIS_CALLS << 16) | DBG_SEV_FATAL_ERROR)
88 
89 #define DBG_NDIS_OIDS_INFO			((DBG_NDIS_OIDS << 16) | DBG_SEV_INFO)
90 #define DBG_NDIS_OIDS_LOUD			((DBG_NDIS_OIDS << 16) | DBG_SEV_LOUD)
91 #define DBG_NDIS_OIDS_VERY_LOUD		((DBG_NDIS_OIDS << 16) | DBG_SEV_VERY_LOUD)
92 #define DBG_NDIS_OIDS_WARNING		((DBG_NDIS_OIDS << 16) | DBG_SEV_WARNING)
93 #define DBG_NDIS_OIDS_ERROR			((DBG_NDIS_OIDS << 16) | DBG_SEV_ERROR)
94 #define DBG_NDIS_OIDS_FATAL_ERROR	((DBG_NDIS_OIDS << 16) | DBG_SEV_FATAL_ERROR)
95 
96 #define DBG_PCI_RES_INFO			((DBG_PCI_RES << 16) | DBG_SEV_INFO)
97 #define DBG_PCI_RES_LOUD			((DBG_PCI_RES << 16) | DBG_SEV_LOUD)
98 #define DBG_PCI_RES_VERY_LOUD		((DBG_PCI_RES << 16) | DBG_SEV_VERY_LOUD)
99 #define DBG_PCI_RES_WARNING			((DBG_PCI_RES << 16) | DBG_SEV_WARNING)
100 #define DBG_PCI_RES_ERROR			((DBG_PCI_RES << 16) | DBG_SEV_ERROR)
101 #define DBG_PCI_RES_FATAL_ERROR		((DBG_PCI_RES << 16) | DBG_SEV_FATAL_ERROR)
102 
103 #define DBG_INTERRUPT_INFO			((DBG_INTERRUPT << 16) | DBG_SEV_INFO)
104 #define DBG_INTERRUPT_LOUD			((DBG_INTERRUPT << 16) | DBG_SEV_LOUD)
105 #define DBG_INTERRUPT_VERY_LOUD		((DBG_INTERRUPT << 16) | DBG_SEV_VERY_LOUD)
106 #define DBG_INTERRUPT_WARNING		((DBG_INTERRUPT << 16) | DBG_SEV_WARNING)
107 #define DBG_INTERRUPT_ERROR			((DBG_INTERRUPT << 16) | DBG_SEV_ERROR)
108 #define DBG_INTERRUPT_FATAL_ERROR	((DBG_INTERRUPT << 16) | DBG_SEV_FATAL_ERROR)
109 
110 #define DBG_IOCTL_INFO				((DBG_IOCTL << 16) | DBG_SEV_INFO)
111 #define DBG_IOCTL_LOUD				((DBG_IOCTL << 16) | DBG_SEV_LOUD)
112 #define DBG_IOCTL_VERY_LOUD			((DBG_IOCTL << 16) | DBG_SEV_VERY_LOUD)
113 #define DBG_IOCTL_WARNING			((DBG_IOCTL << 16) | DBG_SEV_WARNING)
114 #define DBG_IOCTL_ERROR				((DBG_IOCTL << 16) | DBG_SEV_ERROR)
115 #define DBG_IOCTL_FATAL_ERROR		((DBG_IOCTL << 16) | DBG_SEV_FATAL_ERROR)
116 
117 #define DBG_RECV_INFO				((DBG_RECV << 16) | DBG_SEV_INFO)
118 #define DBG_RECV_LOUD				((DBG_RECV << 16) | DBG_SEV_LOUD)
119 #define DBG_RECV_VERY_LOUD			((DBG_RECV << 16) | DBG_SEV_VERY_LOUD)
120 #define DBG_RECV_WARNING			((DBG_RECV << 16) | DBG_SEV_WARNING)
121 #define DBG_RECV_ERROR				((DBG_RECV << 16) | DBG_SEV_ERROR)
122 #define DBG_RECV_FATAL_ERROR		((DBG_RECV << 16) | DBG_SEV_FATAL_ERROR)
123 
124 #define DBG_SEND_INFO				((DBG_SEND << 16) | DBG_SEV_INFO)
125 #define DBG_SEND_LOUD				((DBG_SEND << 16) | DBG_SEV_LOUD)
126 #define DBG_SEND_VERY_LOUD			((DBG_SEND << 16) | DBG_SEV_VERY_LOUD)
127 #define DBG_SEND_WARNING			((DBG_SEND << 16) | DBG_SEV_WARNING)
128 #define DBG_SEND_ERROR				((DBG_SEND << 16) | DBG_SEV_ERROR)
129 #define DBG_SEND_FATAL_ERROR		((DBG_SEND << 16) | DBG_SEV_FATAL_ERROR)
130 
131 
132 #else
133 
134 #define PRINT(F, A)
135 #define PRINTF(F, A)
136 
137 #endif
138 
139 
140 #endif /* __OSDEBUG_H_*/
141 
142