LOGIN   :::   RECOVER PASS   :::   GET ACCOUNT    
Browse
  • Projects
  • Code (CVS)
  • Forums
  • News
  • Articles
  • Polls
  •  
    OpenCores
  • FAQ
  • CVS HowTo
  • Mission
  • Media
  • Tools
  • Advertise
  • Mirrors
  • Logos
  • Contact us
  • Find Resources
  • Job Opportunity
  •  
    Tools
  • Search
      
  • Download Cores (CVSGet)
  •  
    More
  • Wishbone
  • Perlilog
  • EDA tools
  • OpenTech CD
  •  
    Navigation: All forums > Openrisc > Message List > Message Post

    Message

    Reply | Reply all
    Date Prev | Date Next | Thread Prev | Thread Next Date Index | Thread Index

    From: =?unknown-8bit?Q?Gy=F6rgy?= 'nog' Jeney<nog@s...>
    Date: Wed Jun 29 16:56:40 CEST 2005
    Subject: [openrisc] [or1ksim #120] Add macros to get state of debug channels
    Top
    Hi,

    This patch adds macros that get the state of the specified debugging channel/
    debug class. This isn't used yet, but it will be when I submit my spr dumping
    code.

    ChangeLog:
    * Add {TRACE,ERR,FIXME,WARN}_ON macros to get the state of the given debug
    channel.

    nog.
    -------------- next part --------------
    diff -upr --unidirectional-new-file ./support/debug.h /home/nog/or1ksim-ac/support/debug.h
    --- ./support/debug.h 2005-03-25 13:20:53.000000000 +0100
    +++ /home/nog/or1ksim-ac/support/debug.h 2005-05-22 13:11:35.000000000 +0200
    @@ -46,6 +46,13 @@ void parse_dbchs(const char *str);

    #define __ORSIM_DEBUG_LOG(args...) \
    orsim_dbg_log(__dbcl, __dbch, __ORSIM_DBG_USE_FUNC, args); } while(0)
    +
    +#define __ORSIM_GET_DEBUGGING_TRACE(dbch) ((dbch)[0] & (1 << __ORSIM_DBCL_TRACE))
    +#define __ORSIM_GET_DEBUGGING_WARN(dbch) ((dbch)[0] & (1 << __ORSIM_DBCL_WARN))
    +#define __ORSIM_GET_DEBUGGING_FIXME(dbch) ((dbch)[0] & (1 << __ORSIM_DBCL_FIXME))
    +#define __ORSIM_GET_DEBUGGING_ERR(dbch) ((dbch)[0] & (1 << __ORSIM_DBCL_ERR))
    +
    +#define __ORSIM_GET_DEBUGGING(dbcl,dbch) __ORSIM_GET_DEBUGGING##dbcl(dbch)

    #define TRACE_(ch) __ORSIM_DPRINTF(TRACE, __orsim_dbch_##ch)
    #define FIXME_(ch) __ORSIM_DPRINTF(FIXME, __orsim_dbch_##ch)
    @@ -57,6 +64,11 @@ void parse_dbchs(const char *str);
    #define WARN __ORSIM_DPRINTF(WARN, __orsim_dbch___default)
    #define ERR __ORSIM_DPRINTF(ERR, __orsim_dbch___default)

    +#define TRACE_ON(ch) __ORSIM_GET_DEBUGGING(_TRACE,__orsim_dbch_##ch)
    +#define WARN_ON(ch) __ORSIM_GET_DEBUGGING(_WARN,__orsim_dbch_##ch)
    +#define FIXME_ON(ch) __ORSIM_GET_DEBUGGING(_FIXME,__orsim_dbch_##ch)
    +#define ERR_ON(ch) __ORSIM_GET_DEBUGGING(_ERR,__orsim_dbch_##ch)
    +
    #define DEFAULT_DEBUG_CHANNEL(dbch) \
    extern char __orsim_dbch_##dbch[]; \
    static char * const __orsim_dbch___default = __orsim_dbch_##dbch;

     
    Copyright (c) 1999 OPENCORES.ORG. All rights reserved.