⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 dm_debug.h

📁 优龙YLP270开发板 光盘自带的BIOS和实验例程源码 强烈推荐
💻 H
字号:
/******************************************************************************
**
**  COPYRIGHT (C) 2000, 2001 Intel Corporation.
**
**  This software as well as the software described in it is furnished under 
**  license and may only be used or copied in accordance with the terms of the 
**  license. The information in this file is furnished for informational use 
**  only, is subject to change without notice, and should not be construed as 
**  a commitment by Intel Corporation. Intel Corporation assumes no 
**  responsibility or liability for any errors or inaccuracies that may appear 
**  in this document or any software that may be provided in association with 
**  this document. 
**  Except as permitted by such license, no part of this document may be 
**  reproduced, stored in a retrieval system, or transmitted in any form or by 
**  any means without the express written consent of Intel Corporation. 
**
**  FILENAME:      DM_Debug.h
**
**  PURPOSE:       Contains constants, types and variables for various debug
**                  related capabilities of DM.  It includes those capabilities
**                  that are controlled by the various DM_ControlWords
**
**
**  LAST MODIFIED: $Modtime: 7/17/03 1:01p $
******************************************************************************/

#ifndef _DM_DEBUG_H
#define _DM_DEBUG_H

#ifdef  _DEFINING_DM_DEBUG
#define EXTRN
#else
#define EXTRN   extern
#endif

/*
*******************************************************************************
*    Debug macros used for tracing.
*******************************************************************************
*/
#define DM_FUNC(F)      static const char __FUNC__[] = F;

#define DM_ENTER(DBGID)                          \
{                                                \
    DM_CwDbgPrintf(DBGID, ">>>%s", __FUNC__);    \
}

#define DM_LEAVE(DBGID)                          \
{                                                \
    DM_CwDbgPrintf(DBGID, "<<<%s", __FUNC__);    \
}

/*
*******************************************************************************
*******************************************************************************
    Allocations of control bits to module areas: same for all controls
    - Be conservative.  Managing large structures could become awkward.
    - Usage of individual bits in each allocation is determined within the 
        module's private logic.
*******************************************************************************
*******************************************************************************
*/


 /*
*******************************************************************************
    Bit position assignments, not masks!
    When defining or removing a bit, also add a string to or remove one from
        DM_ControlWordsStrings[]
*******************************************************************************
*/

typedef enum DM_ControlWordsBitsE
{
 // Symbol                 decimal id#

    DM_CW_ARP_0,          //   0
    DM_CW_DHCP_0,         //   1
    DM_CW_ETHERNET_0,     //   2
    DM_CW_ICMP_0,         //   3
    DM_CW_INET_0,         //   4
    DM_CW_IP_0,           //   5
    DM_CW_TFTP_0,         //   6
    DM_CW_UDP_0,          //   7
    DM_CW_LAN91C111_0,    //   8
    DM_CW_LAN91C111_1,    //   9
    DM_CW_DP8390_0,       //   10
    DM_CW_DMA_0,          //   11
    DM_CW_XS_AC97_CTRL,   //   12
    DM_CW_UART_0,         //   13
    DM_CW_FIR_0,          //   14   
    DM_CW_SSP,            //   15
    DM_CW_AC97_CODEC,     //   16
    DM_CW_XS_INT_CTRL,    //   17
    DM_CW_FLASH_0,        //   18
    DM_CW_FLASH_1,        //   19
    DM_CW_FLASH_LOADER_0, //   20
    DM_CW_MMC,		      //   21
    DM_CW_XS_PCMCIA_0,    //   22
    DM_CW_SK_PCMCIA_0,    //   23
    DM_CW_USB_CLIENT,     //   24
    DM_CW_USB_HOST_0,     //   25
    DM_CW_USB_HOST_1,     //   26
    DM_CW_SCREEN,         //   27
    DM_CW_EXPANSION_0,    //   28
    DM_CW_MEMEDIT_0,      //   29
    DM_CW_MEM,            //   30
    DM_CW_LED,            //   31
    DM_CW_MSL_0,          //   32
    DM_CW_MSL_1,          //   33
    DM_CW_NETWORK_0,      //   34
    DM_CW_USIM,			  //   35
    DM_CW_MSHC,			  //   36
//  Don't forget to add string to DM_ControlWordsStrings[]

    DM_CW_NUM_BITS_ASSIGNED
    
} DM_ControlWordsBitsT;


#define DM_CONTROL_WORD_SIZE         32
#define DM_CONTROL_WORDS_NUM      ((DM_CW_NUM_BITS_ASSIGNED + \
                               DM_CONTROL_WORD_SIZE-1)  / DM_CONTROL_WORD_SIZE)

EXTRN PCHAR DM_ControlWordsStrings[DM_CW_NUM_BITS_ASSIGNED+1]
#ifdef  _DEFINING_DM_DEBUG
    = 
    {
    "DM_CW_ARP_0",          //   0
    "DM_CW_DHCP_0",         //   1
    "DM_CW_ETHERNET_0",     //   2
    "DM_CW_ICMP_0",         //   3
    "DM_CW_INET_0",         //   4
    "DM_CW_IP_0",           //   5
    "DM_CW_TFTP_0",         //   6
    "DM_CW_UDP_0",          //   7
    "DM_CW_LAN91C111_0",    //   8
    "DM_CW_LAN91C111_1",    //   9
    "DM_CW_DP8390_0",       //   10
    "DM_CW_DMA_0",          //   11
    "DM_CW_XS_AC97_CTRL",   //   12
    "DM_CW_UART_0",         //   13
    "DM_CW_FIR_0",          //   14   
    "DM_CW_SSP",            //   15
    "DM_CW_AC97_CODEC",     //   16
    "DM_CW_XS_INT_CTRL",    //   17
    "DM_CW_FLASH_0",        //   18
    "DM_CW_FLASH_1",        //   19
    "DM_CW_FLASH_LOADER_0", //   20
    "DM_CW_MMC",            //   21
    "DM_CW_XS_PCMCIA_0",    //   22
    "DM_CW_SK_PCMCIA_0",    //   23
    "DM_CW_USB_CLIENT",     //   24
    "DM_CW_USB_HOST_0",     //   25
    "DM_CW_USB_HOST_1",     //   26
    "DM_CW_SCREEN",         //   27
    "DM_CW_EXPANSION_0",    //   28
    "DM_CW_MEMEDIT_0",      //   29
    "DM_CW_MEM",            //   30
    "DM_CW_LED",            //   31
    "DM_CW_MSL_0",          //   32
    "DM_CW_MSL_1",          //   33
    "DM_CW_NETWORK_0",      //   34
    "DM_CW_USIM",           //   35
    "DM_CW_MSHC",           //   36
    ""
    }  
#endif 
; 

/*
*******************************************************************************
    Control word arrays.  For new ones, also add to DM_ControlWordsClear()
*******************************************************************************
*/

EXTRN UINT32 DM_ControlWordsDebugPrint[DM_CONTROL_WORDS_NUM];
EXTRN UINT32 DM_ControlWordsWarnPrint[DM_CONTROL_WORDS_NUM];
EXTRN UINT32 DM_ControlWordsErrPrint[DM_CONTROL_WORDS_NUM];

/*
*******************************************************************************
    Function prototypes
*******************************************************************************
*/

void DM_ControlWordsClear (void);
void DM_ControlWordsCalcIndices      (DM_ControlWordsBitsT, PINT, PINT);
INT  DM_ControlWordsDebugPrintGetBit (DM_ControlWordsBitsT);
void DM_ControlWordsDebugPrintPutBit (DM_ControlWordsBitsT, INT);
INT  DM_ControlWordsWarnPrintGetBit  (DM_ControlWordsBitsT);
void DM_ControlWordsWarnPrintPutBit  (DM_ControlWordsBitsT, INT);
INT  DM_ControlWordsErrPrintGetBit   (DM_ControlWordsBitsT);
void DM_ControlWordsErrPrintPutBit   (DM_ControlWordsBitsT, INT);

void DM_CwDbgPrintf  (DM_ControlWordsBitsT, char *, ...);
void DM_CwDbgSerialPrintf  (DM_ControlWordsBitsT, char *, ...);
void DM_CwWarnPrintf (DM_ControlWordsBitsT, char *, ...);
void DM_CwWarnSerialPrintf (DM_ControlWordsBitsT, char *, ...);
void DM_CwErrPrintf  (DM_ControlWordsBitsT, char *, ...);
void DM_CwErrSerialPrintf  (DM_ControlWordsBitsT, char *, ...);

VOID DM_CwDisplayCurrSwitchInfo (PVOID, PCHAR);
//VOID DM_CwSelectBit (PVOID, PCHAR);
VOID DM_CwSelectNextBit (PVOID, PCHAR);
VOID DM_CwSelectPrevBit (PVOID, PCHAR);
VOID DM_CwDebugPrintfCtrlToggle (PVOID, PCHAR);
VOID DM_CwWarnPrintfCtrlToggle (PVOID, PCHAR);
VOID DM_CwErrPrintfCtrlToggle (PVOID, PCHAR);
VOID DM_CwDebugPrintfCtrlShow (PVOID, PCHAR);
VOID DM_CwWarnPrintfCtrlShow (PVOID, PCHAR);
VOID DM_CwErrPrintfCtrlShow (PVOID, PCHAR);
VOID DM_CwNameControlWordBits (PVOID, PCHAR);
VOID DM_CwDisplayCurrSwitchInfo (PVOID, PCHAR);
VOID DM_CwDisableAllControlWordBits (PVOID, PCHAR);
VOID DumpRegistersDbg (PUINT32 regP, INT numReg);

#undef EXTRN
#endif // _DM_DEBUG_H

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -