📄 igxbug.h
字号:
#ifdef DEFINE_DEBUG_VAR
ULONG DebugLevel = DBG_DEFAULT;
LARGE_INTEGER lastTime;
LARGE_INTEGER curTime;
#else
extern unsigned char lptRegImage1;
extern unsigned char lptRegImage2;
extern ULONG DebugLevel;
extern LARGE_INTEGER t1Time, t1LastTime, t1CurTime;
extern LARGE_INTEGER t2Time, t2LastTime, t2CurTime;
extern LARGE_INTEGER t3Time, t3LastTime, t3CurTime;
extern LARGE_INTEGER t4Time, t4LastTime, t4CurTime;
extern LARGE_INTEGER t5Time, t5LastTime, t5CurTime;
extern LARGE_INTEGER t6Time, t6LastTime, t6CurTime;
#endif
#endif // #ifdef DBG
NTHALAPI
LARGE_INTEGER
KeQueryPerformanceCounter (
OUT PLARGE_INTEGER PerformanceFrequency OPTIONAL
);
extern LARGE_INTEGER isrTimeDelay;
#ifdef MRVL_USE_DBG
#ifdef UNDER_CE_XSCALE
#define DBGSTROBE_LINE_ON( line )
#define DBGSTROBE_LINE_OFF( line )
#define INITDEBUG()
#else // #ifdef UNDER_CE_XSCALE
// PJG: Parallel port is negative logic. clear the bit to have positive voltage show on scope.
#define DBGSTROBE_LINE_ON( line ) \
{ \
UCHAR regVal; \
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 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
#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(SDIO) || defined (IF_SPI)
#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 //SDIO
#define DbgMrvPrintFile( str )
#else
#if defined SDIO || defined (IF_SPI)
#define HexDump(dbglevel, msg, buf, size)
#endif
#define DBGPRINT(lvl,Str)
#define INITDEBUG()
#define DBGSTROBE_LINE_ON(line)
#define DBGSTROBE_LINE_OFF(line)
#define DbgMrvPrintFile( str )
#endif
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -