/*====================================================================*
*
* debug.h - Debugging Definitions and Declarations;
*
* this file is a subset of the original that includes only those
* definitions and declaration needed for toolkit programs;
*
*. Motley Tools by Charles Maier <cmaier@cmassoc.net>;
*: Published 2005 by Charles Maier Associates Limited;
*; Released under the GNU General Public Licence v2 and later;
*
*--------------------------------------------------------------------*/
#ifndef DEBUG_HEADER
#define DEBUG_HEADER
/*====================================================================*
* constants;
*--------------------------------------------------------------------*/
#define INTELLON_DEBUG 1
#define INTELLON_TRACE 1
/*====================================================================*
*
*--------------------------------------------------------------------*/
#if INTELLON_TRACE
#define EVENT(s) printk(KERN_DEBUG "---[ %s ]---\n", (s))
#define ENTER printk(KERN_DEBUG "-->[ %s:%d ]\n", __FUNCTION__,__LINE__)
#define ABORT printk(KERN_DEBUG "<--( %s:%d )\n", __FUNCTION__,__LINE__)
#define LEAVE printk(KERN_DEBUG "<--[ %s:%d ]\n", __FUNCTION__,__LINE__)
#define CRUMB printk(KERN_DEBUG "... %s:%d\n",__FUNCTION__,__LINE__)
#else
#define EVENT {}
#define ENTER {}
#define ABORT {}
#define LEAVE {}
#define CRUMB {}
#endif
/*====================================================================*
*
*--------------------------------------------------------------------*/
#if INTELLON_DEBUG
#define address(e) if (!(e)) { printk ("%s(%d): address %s is null\n",__FUNCTION__,__LINE__,#e); }
#define confirm(e) if (!(e)) { printk ("%s(%d): assertion %s is wrong\n",__FUNCTION__,__LINE__, #e); }
#else
#define address(e) {}
#define confirm(e) {}
#endif
/*====================================================================*
*
*--------------------------------------------------------------------*/
#endif