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