| 1 | /* $Id: dbgos2.h,v 1.2 2003/08/08 15:09:03 vladest Exp $ */
 | 
|---|
| 2 | /*
 | 
|---|
| 3 |  * Header for debug functions
 | 
|---|
| 4 |  *
 | 
|---|
| 5 |  * (C) 2000-2002 InnoTek Systemberatung GmbH
 | 
|---|
| 6 |  * (C) 2000-2001 Sander van Leeuwen (sandervl@xs4all.nl)
 | 
|---|
| 7 |  *
 | 
|---|
| 8 |  * This program is free software; you can redistribute it and/or
 | 
|---|
| 9 |  * modify it under the terms of the GNU General Public License as
 | 
|---|
| 10 |  * published by the Free Software Foundation; either version 2 of
 | 
|---|
| 11 |  * the License, or (at your option) any later version.
 | 
|---|
| 12 |  *
 | 
|---|
| 13 |  * This program is distributed in the hope that it will be useful,
 | 
|---|
| 14 |  * but WITHOUT ANY WARRANTY; without even the implied warranty of
 | 
|---|
| 15 |  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 | 
|---|
| 16 |  * GNU General Public License for more details.
 | 
|---|
| 17 |  *
 | 
|---|
| 18 |  * You should have received a copy of the GNU General Public
 | 
|---|
| 19 |  * License along with this program; if not, write to the Free
 | 
|---|
| 20 |  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139,
 | 
|---|
| 21 |  * USA.
 | 
|---|
| 22 |  *
 | 
|---|
| 23 |  */
 | 
|---|
| 24 | 
 | 
|---|
| 25 | #ifndef __COMMDBG_H__
 | 
|---|
| 26 | #define __COMMDBG_H__
 | 
|---|
| 27 | 
 | 
|---|
| 28 | typedef struct {
 | 
|---|
| 29 |         unsigned long ulState;
 | 
|---|
| 30 |         unsigned long ulIntServiced[4];
 | 
|---|
| 31 |         unsigned long ulIntUnserviced[4];
 | 
|---|
| 32 | } DBGINT;
 | 
|---|
| 33 | 
 | 
|---|
| 34 | #ifdef __cplusplus
 | 
|---|
| 35 | extern "C" {
 | 
|---|
| 36 | #endif
 | 
|---|
| 37 | extern int DebugLevel;
 | 
|---|
| 38 | extern int wrOffset;
 | 
|---|
| 39 | extern char *szprintBuf;
 | 
|---|
| 40 | int _cdecl printk(const char * fmt, ...);
 | 
|---|
| 41 | extern void DbgPrintIrq(void);
 | 
|---|
| 42 | #ifdef __cplusplus
 | 
|---|
| 43 | }
 | 
|---|
| 44 | #endif
 | 
|---|
| 45 | 
 | 
|---|
| 46 | 
 | 
|---|
| 47 | /* rprintf always prints to the log buffer, and to SIO if enabled */
 | 
|---|
| 48 | #define rprintf(a) printk a
 | 
|---|
| 49 | 
 | 
|---|
| 50 | /* the dprintf functions only print if DEBUG is defined */
 | 
|---|
| 51 | #ifdef DEBUG
 | 
|---|
| 52 | #define DBG_MAX_BUF_SIZE 0x100000
 | 
|---|
| 53 | #define dprintf(a)      printk a
 | 
|---|
| 54 | #define dprintf1(a)     if(DebugLevel > 0) printk a
 | 
|---|
| 55 | #define dprintf2(a)     if(DebugLevel > 1) printk a
 | 
|---|
| 56 | #define dprintf3(a)     if(DebugLevel > 2) printk a
 | 
|---|
| 57 | #define DebugInt3()     ; //_asm int 3
 | 
|---|
| 58 | //#define DebInt3()     _asm int 3;
 | 
|---|
| 59 | #else
 | 
|---|
| 60 | // not DEBUG
 | 
|---|
| 61 | #define DBG_MAX_BUF_SIZE 0x10000
 | 
|---|
| 62 | #define dprintf(a)
 | 
|---|
| 63 | #define dprintf1(a)
 | 
|---|
| 64 | #define dprintf2(a)
 | 
|---|
| 65 | #define dprintf3(a)
 | 
|---|
| 66 | #define DebugInt3()
 | 
|---|
| 67 | #endif
 | 
|---|
| 68 | 
 | 
|---|
| 69 | #endif //__COMMDBG_H__
 | 
|---|
| 70 | 
 | 
|---|