📄 igxbug.h
字号:
int val = line; \
NdisRawReadPortUchar(DBBASE + 2, ®Val); \
regVal &= ~val; \
NdisRawWritePortUchar(DBBASE + 2, regVal); \
}
// PJG: Parallel port is negative logic. set the bit to have low on scope
#define DBGSTROBE_LINE_OFF( line ) \
{ \
UCHAR regVal; \
int val = line; \
NdisRawReadPortUchar(DBBASE + 2, ®Val); \
regVal |= val; \
NdisRawWritePortUchar(DBBASE + 2, regVal); \
}
#define BUGPRINT(Str) DbgPrint Str
#define INITDEBUG() \
NdisGetCurrentSystemTime(&t1Time); \
NdisGetCurrentSystemTime(&t2Time); \
NdisGetCurrentSystemTime(&t3Time); \
NdisGetCurrentSystemTime(&t4Time); \
NdisGetCurrentSystemTime(&t5Time); \
NdisGetCurrentSystemTime(&t6Time); \
NdisGetCurrentSystemTime(&t1CurTime); \
NdisGetCurrentSystemTime(&t2CurTime); \
NdisGetCurrentSystemTime(&t3CurTime); \
NdisGetCurrentSystemTime(&t4CurTime); \
NdisGetCurrentSystemTime(&t5CurTime); \
NdisGetCurrentSystemTime(&t6CurTime); \
NdisGetCurrentSystemTime(&t1LastTime); \
NdisGetCurrentSystemTime(&t2LastTime); \
NdisGetCurrentSystemTime(&t3LastTime); \
NdisGetCurrentSystemTime(&t4LastTime); \
NdisGetCurrentSystemTime(&t5LastTime); \
NdisGetCurrentSystemTime(&t6LastTime); \
NdisRawReadPortUchar(DBBASE + 1, &lptRegImage1);
#endif // #ifdef UNDER_CE_XSCALE
#ifdef MRVL_PRINT_FILE_MSG
void MrvPrintFileMSG(const char *fmt, ...);
#endif
#define DBGPRINT(lvl, Str) \
{ \
ULONG __lvl = lvl; \
if ( DebugLevel & (__lvl & ~DBG_DONTCARE)) \
{ \
if ( lvl & DBG_CRLF ) \
{ \
PrintMacro("\n"); \
} \
if ( __lvl & DBG_TIMESTAMPS) \
{ \
if ( __lvl & DBG_T1 ) \
{ \
NdisGetCurrentSystemTime(&t1CurTime); \
PrintMacro("T1:%I64d - ",t1CurTime.QuadPart - t1LastTime.QuadPart); \
t1LastTime.QuadPart = t1CurTime.QuadPart; \
} \
else if ( __lvl & DBG_T2 ) \
{ \
NdisGetCurrentSystemTime(&t2CurTime); \
PrintMacro("T2:%I64d - ",t2CurTime.QuadPart - t2LastTime.QuadPart); \
t2LastTime.QuadPart = t2CurTime.QuadPart; \
} \
else if ( __lvl & DBG_T3 ) \
{ \
NdisGetCurrentSystemTime(&t3CurTime); \
PrintMacro("T3:%I64d - ",t3CurTime.QuadPart - t3LastTime.QuadPart); \
t3LastTime.QuadPart = t3CurTime.QuadPart; \
} \
else if ( __lvl & DBG_T4 ) \
{ \
NdisGetCurrentSystemTime(&t4CurTime); \
PrintMacro("T4:%I64d - ",t4CurTime.QuadPart - t4LastTime.QuadPart); \
t4LastTime.QuadPart = t4CurTime.QuadPart; \
} \
else if ( __lvl & DBG_T5 ) \
{ \
NdisGetCurrentSystemTime(&t5CurTime); \
PrintMacro("T5:%I64d - ",t5CurTime.QuadPart - t5LastTime.QuadPart); \
t5LastTime.QuadPart = t5CurTime.QuadPart; \
} \
else if ( __lvl & DBG_T6) \
{ \
NdisGetCurrentSystemTime(&t6CurTime); \
PrintMacro("T6:%I64d - ",t6CurTime.QuadPart - t6LastTime.QuadPart); \
t6LastTime.QuadPart = t6CurTime.QuadPart; \
} \
} \
PrintMacro Str; \
}}
#if defined(IF_SDIO) || defined (IF_GSPI)
#define MRV_DRV_LINE_LENGTH 16
static __inline
void HexDump ( UINT dbgLevel, char *msg, PUCHAR buf, int len)
{
int ii = 0, jj;
UCHAR lastBuf[MRV_DRV_LINE_LENGTH];
if ( msg ) DBGPRINT(dbgLevel,("%s\n",msg));
// new version that prints out correctly in dbgview
jj = len / MRV_DRV_LINE_LENGTH;
for (ii = 0; ii < jj; ii ++ )
{
// note: if MRV_DRV_LINE_LENGTH changes, the following format
// needs to change as well
DBGPRINT(dbgLevel, ("%02x %02x %02x %02x %02x %02x %02x %02x - "
"%02x %02x %02x %02x %02x %02x %02x %02x\n",
(ULONG)(LONG)(UCHAR)*buf,
(ULONG)(LONG)(UCHAR)*(buf+1),
(ULONG)(LONG)(UCHAR)*(buf+2),
(ULONG)(LONG)(UCHAR)*(buf+3),
(ULONG)(LONG)(UCHAR)*(buf+4),
(ULONG)(LONG)(UCHAR)*(buf+5),
(ULONG)(LONG)(UCHAR)*(buf+6),
(ULONG)(LONG)(UCHAR)*(buf+7),
(ULONG)(LONG)(UCHAR)*(buf+8),
(ULONG)(LONG)(UCHAR)*(buf+9),
(ULONG)(LONG)(UCHAR)*(buf+10),
(ULONG)(LONG)(UCHAR)*(buf+11),
(ULONG)(LONG)(UCHAR)*(buf+12),
(ULONG)(LONG)(UCHAR)*(buf+13),
(ULONG)(LONG)(UCHAR)*(buf+14),
(ULONG)(LONG)(UCHAR)*(buf+15)));
buf+= MRV_DRV_LINE_LENGTH;
}
jj = len % MRV_DRV_LINE_LENGTH;
if ( jj != 0 )
{
for ( ii = 0; ii < jj; ii++ )
{
lastBuf[ii] = *(buf+ii);
}
for ( ii=jj; ii < MRV_DRV_LINE_LENGTH; ii++ )
{
lastBuf[ii] = 0;
}
DBGPRINT(dbgLevel, ("%02x %02x %02x %02x %02x %02x %02x %02x - "
"%02x %02x %02x %02x %02x %02x %02x %02x\n",
(ULONG)(LONG)(UCHAR)lastBuf[0],
(ULONG)(LONG)(UCHAR)lastBuf[1],
(ULONG)(LONG)(UCHAR)lastBuf[2],
(ULONG)(LONG)(UCHAR)lastBuf[3],
(ULONG)(LONG)(UCHAR)lastBuf[4],
(ULONG)(LONG)(UCHAR)lastBuf[5],
(ULONG)(LONG)(UCHAR)lastBuf[6],
(ULONG)(LONG)(UCHAR)lastBuf[7],
(ULONG)(LONG)(UCHAR)lastBuf[8],
(ULONG)(LONG)(UCHAR)lastBuf[9],
(ULONG)(LONG)(UCHAR)lastBuf[10],
(ULONG)(LONG)(UCHAR)lastBuf[11],
(ULONG)(LONG)(UCHAR)lastBuf[12],
(ULONG)(LONG)(UCHAR)lastBuf[13],
(ULONG)(LONG)(UCHAR)lastBuf[14],
(ULONG)(LONG)(UCHAR)lastBuf[15]));
}
}
#endif //IF_SDIO
#define DbgMrvPrintFile( str )
#else
#if defined IF_SDIO || defined (IF_GSPI)
#define HexDump(dbglevel, msg, buf, size)
#define MRV_DRV_LINE_LENGTH 16
static __inline
void HexDump1 ( UINT dbgLevel, char *msg, PUCHAR buf, int len)
{
int ii = 0, jj;
UCHAR lastBuf[MRV_DRV_LINE_LENGTH];
///if ( msg ) RETAILMSG(dbgLevel,(TEXT("%s\n"),msg));
RETAILMSG(dbgLevel,(TEXT("HEX(%d):\n"), len));
// new version that prints out correctly in dbgview
jj = len / MRV_DRV_LINE_LENGTH;
for (ii = 0; ii < jj; ii ++ )
{
// note: if MRV_DRV_LINE_LENGTH changes, the following format
// needs to change as well
RETAILMSG(1, (TEXT("%02x %02x %02x %02x %02x %02x %02x %02x - %02x %02x %02x %02x %02x %02x %02x %02x\n"),
(ULONG)(LONG)(UCHAR)*buf,
(ULONG)(LONG)(UCHAR)*(buf+1),
(ULONG)(LONG)(UCHAR)*(buf+2),
(ULONG)(LONG)(UCHAR)*(buf+3),
(ULONG)(LONG)(UCHAR)*(buf+4),
(ULONG)(LONG)(UCHAR)*(buf+5),
(ULONG)(LONG)(UCHAR)*(buf+6),
(ULONG)(LONG)(UCHAR)*(buf+7),
(ULONG)(LONG)(UCHAR)*(buf+8),
(ULONG)(LONG)(UCHAR)*(buf+9),
(ULONG)(LONG)(UCHAR)*(buf+10),
(ULONG)(LONG)(UCHAR)*(buf+11),
(ULONG)(LONG)(UCHAR)*(buf+12),
(ULONG)(LONG)(UCHAR)*(buf+13),
(ULONG)(LONG)(UCHAR)*(buf+14),
(ULONG)(LONG)(UCHAR)*(buf+15) ));
buf+= MRV_DRV_LINE_LENGTH;
}
jj = len % MRV_DRV_LINE_LENGTH;
if ( jj != 0 )
{
for ( ii = 0; ii < jj; ii++ )
{
lastBuf[ii] = *(buf+ii);
}
for ( ii=jj; ii < MRV_DRV_LINE_LENGTH; ii++ )
{
lastBuf[ii] = 0;
}
RETAILMSG(1, (TEXT("%02x %02x %02x %02x %02x %02x %02x %02x - %02x %02x %02x %02x %02x %02x %02x %02x\n"),
(ULONG)(LONG)(UCHAR)lastBuf[0],
(ULONG)(LONG)(UCHAR)lastBuf[1],
(ULONG)(LONG)(UCHAR)lastBuf[2],
(ULONG)(LONG)(UCHAR)lastBuf[3],
(ULONG)(LONG)(UCHAR)lastBuf[4],
(ULONG)(LONG)(UCHAR)lastBuf[5],
(ULONG)(LONG)(UCHAR)lastBuf[6],
(ULONG)(LONG)(UCHAR)lastBuf[7],
(ULONG)(LONG)(UCHAR)lastBuf[8],
(ULONG)(LONG)(UCHAR)lastBuf[9],
(ULONG)(LONG)(UCHAR)lastBuf[10],
(ULONG)(LONG)(UCHAR)lastBuf[11],
(ULONG)(LONG)(UCHAR)lastBuf[12],
(ULONG)(LONG)(UCHAR)lastBuf[13],
(ULONG)(LONG)(UCHAR)lastBuf[14],
(ULONG)(LONG)(UCHAR)lastBuf[15]));
}
}
#endif
#define DBGPRINT(lvl,Str)
#define INITDEBUG()
#define DBGSTROBE_LINE_ON(line)
#define DBGSTROBE_LINE_OFF(line)
#define DbgMrvPrintFile( str )
#endif
void AllenPrintFile(const char *fmt, ...);
#define AllenDBGPRINT(lvl, Str) \
{ \
AllenPrintFile Str; \
}
#endif
#ifdef UNDER_CE
// BEGIN *** #ifdef MRVL_PRINT_DBG_MSG ***
#ifdef MRVL_PRINT_DBG_MSG
void MrvPrintFile(const char *fmt, ...);
#define PrintMacro MrvPrintFile
#else
#define PrintMacro
#endif
// END *** #ifdef MRVL_PRINT_DBG_MSG ***
#else
#define PrintMacro DbgPrint
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -