gonzui


Format: Advanced Search

mtkernel_3/include/tk/dbgspt.hbare sourcepermlink (0.05 seconds)

Search this content:

    1: /*
    2:  *----------------------------------------------------------------------
    3:  *    micro T-Kernel 3.00.03
    4:  *
    5:  *    Copyright (C) 2006-2021 by Ken Sakamura.
    6:  *    This software is distributed under the T-License 2.2.
    7:  *----------------------------------------------------------------------
    8:  *
    9:  *    Released by TRON Forum(http://www.tron.org) at 2021/03/31.
   10:  *
   11:  *----------------------------------------------------------------------
   12:  */
   13: 
   14: /*
   15:  *      dbgspt.h
   16:  *
   17:  *      micro T-Kernel Debugger Support
   18:  */
   19: 
   20: #ifndef __TK_DBGSPT_H__
   21: #define __TK_DBGSPT_H__
   22: 
   23: #include "tkernel.h"
   24: 
   25: #ifdef __cplusplus
   26: extern "C" {
   27: #endif
   28: 
   29: /* System dependencies */
   30: #define DBGSPT_PATH_(a)         #a
   31: #define DBGSPT_PATH(a)          DBGSPT_PATH_(a)
   32: #define DBGSPT_SYSDEP()         DBGSPT_PATH(sysdepend/TARGET_DIR/dbgspt.h)
   33: #include DBGSPT_SYSDEP()
   34: 
   35: /*
   36:  * Object name information              td_ref_dsname, td_set_dsname
   37:  */
   38: #define TN_TSK 0x01
   39: #define TN_SEM 0x02
   40: #define TN_FLG 0x03
   41: #define TN_MBX 0x04
   42: #define TN_MBF 0x05
   43: #define TN_POR 0x06
   44: #define TN_MTX 0x07
   45: #define TN_MPL 0x08
   46: #define TN_MPF 0x09
   47: #define TN_CYC 0x0a
   48: #define TN_ALM 0x0b
   49: 
   50: /*
   51:  * Semaphore state information          td_ref_sem
   52:  */
   53: typedef struct td_rsem {
   54:         void   *exinf;           /* Extended information */
   55:         ID     wtsk;               /* Wait task ID */
   56:         INT    semcnt;            /* Current semaphore value */
   57: } TD_RSEM;
   58: 
   59: /*
   60:  * Event flag state information         td_ref_flg
   61:  */
   62: typedef struct td_rflg {
   63:         void   *exinf;           /* Extended information */
   64:         ID     wtsk;               /* Wait task ID */
   65:         UINT   flgptn;           /* Current event flag pattern */
   66: } TD_RFLG;
   67: 
   68: /*
   69:  * Mail box state information           td_ref_mbx
   70:  */
   71: typedef struct td_rmbx {
   72:         void   *exinf;           /* Extended information */
   73:         ID     wtsk;               /* Wait task ID */
   74:         T_MSG  *pk_msg; /* Next received message */
   75: } TD_RMBX;
   76: 
   77: /*
   78:  * Mutex state information              td_ref_mtx
   79:  */
   80: typedef struct td_rmtx {
   81:         void   *exinf;           /* Extended information */
   82:         ID     htsk;               /* Locking task ID */
   83:         ID     wtsk;               /* Lock wait task ID */
   84: } TD_RMTX;
   85: 
   86: /*
   87:  * Message buffer state information     td_ref_mbf
   88:  */
   89: typedef struct td_rmbf {
   90:         void   *exinf;           /* Extended information */
   91:         ID     wtsk;               /* Receive wait task ID */
   92:         ID     stsk;               /* Send wait task ID */
   93:         INT    msgsz;             /* Next received message size (byte) */
   94:         W      frbufsz;     /* Free buffer size (byte) */
   95:         INT    maxmsz;            /* Maximum length of message (byte) */
   96: } TD_RMBF;
   97: 
   98: /*
   99:  * Rendezvous port state information    td_ref_por
  100:  */
  101: typedef struct td_rpor {
  102:         void   *exinf;           /* Extended information */
  103:         ID     wtsk;               /* Call wait task ID */
  104:         ID     atsk;               /* Receive wait task ID */
  105:         INT    maxcmsz;   /* Maximum length of call message (byte) */
  106:         INT    maxrmsz;   /* Maximum length of replay message (byte) */
  107: } TD_RPOR;
  108: 
  109: /*
  110:  * Fixed size memory pool state information     td_ref_mpf
  111:  */
  112: typedef struct td_rmpf {
  113:         void   *exinf;           /* Extended information */
  114:         ID     wtsk;               /* Wait task ID */
  115:         W      frbcnt;              /* Number of free blocks */
  116: } TD_RMPF;
  117: 
  118: /*
  119:  * Variable size memory pool state information  td_ref_mpl
  120:  */
  121: typedef struct td_rmpl {
  122:         void   *exinf;           /* Extended information */
  123:         ID     wtsk;               /* Wait task ID */
  124:         W      frsz;                /* Total size of free area (byte) */
  125:         W      maxsz;               /* Size of maximum continuous
  126:                                    free area (byte) */
  127: } TD_RMPL;
  128: 
  129: /*
  130:  * Cycle handler state information      td_ref_cyc
  131:  */
  132: typedef struct td_rcyc {
  133:         void   *exinf;           /* Extended information */
  134:         RELTIM lfttim;         /* Remaining time until next handler startup */
  135:         UINT   cycstat;  /* Cycle handler status */
  136: } TD_RCYC;
  137: 
  138: /*
  139:  * Alarm handler state information      td_ref_alm
  140:  */
  141: typedef struct td_ralm {
  142:         void   *exinf;           /* Extended information */
  143:         RELTIM lfttim;         /* Remaining time until handler startup */
  144:         UINT   almstat;  /* Alarm handler status */
  145: } TD_RALM;
  146: 
  147: /*
  148:  * Subsystem state information          td_ref_ssy
  149:  */
  150: typedef struct td_rssy {
  151:         PRI    ssypri;            /* Subsystem priority */
  152:         W      resblksz;    /* Resource management block size (byte) */
  153: } TD_RSSY;
  154: 
  155: /*
  156:  * Task state information               td_ref_tsk
  157:  */
  158: typedef struct td_rtsk {
  159:         void   *exinf;           /* Extended information */
  160:         PRI    tskpri;            /* Current priority */
  161:         PRI    tskbpri;   /* Base priority */
  162:         UINT   tskstat;  /* Task state */
  163:         UW     tskwait;    /* Wait factor */
  164:         ID     wid;                /* Wait object ID */
  165:         INT    wupcnt;            /* Number of wakeup requests queuing */
  166:         INT    suscnt;            /* Number of SUSPEND request nests */
  167:         FP     task;               /* Task startup address */
  168:         W      stksz;               /* stack size (byte) */
  169:         void   *istack;          /* stack pointer initial value */
  170: } TD_RTSK;
  171: 
  172: /*
  173:  * Task statistics information          td_inf_tsk
  174:  */
  175: typedef struct td_itsk {
  176:         RELTIM stime;          /* Cumulative system execution time
  177:                                    (milliseconds) */
  178:         RELTIM utime;          /* Cumulative user execution time
  179:                                    (milliseconds) */
  180: } TD_ITSK;
  181: 
  182: /*
  183:  * System state information             td_ref_sys
  184:  */
  185: typedef struct td_rsys {
  186:         UINT   sysstat;  /* System state */
  187:         ID     runtskid;   /* ID of task in execution state */
  188:         ID     schedtskid; /* ID of task that should be in
  189:                                    execution state */
  190: } TD_RSYS;
  191: 
  192: /*
  193:  * System call/extended SVC trace definition    td_hok_svc
  194:  */
  195: typedef struct td_hsvc {
  196:         FP     enter;              /* Hook routine before calling */
  197:         FP     leave;              /* Hook routine after calling */
  198: } TD_HSVC;
  199: 
  200: /*
  201:  * Task dispatch trace definition               td_hok_dsp
  202:  */
  203: typedef struct td_hdsp {
  204:         FP     exec;               /* Hook routine when starting execution */
  205:         FP     stop;               /* Hook routine when stopping execution */
  206: } TD_HDSP;
  207: 
  208: /*
  209:  * Exception/Interrupt trace definition                 td_hok_int
  210:  */
  211: typedef struct td_hint {
  212:         FP     enter;              /* Hook routine before calling handler */
  213:         FP     leave;              /* Hook routine after calling handler */
  214: } TD_HINT;
  215: 
  216: /* ------------------------------------------------------------------------ */
  217: 
  218: /*
  219:  * Definition for interface library automatic generation (mktdsvc)
  220:  */
  221: /*** DEFINE_TDSVC ***/
  222: 
  223: /* [BEGIN SYSCALLS] */
  224: 
  225: /* Refer each object usage state */
  226: IMPORT INT td_lst_tsk( ID list[], INT nent );
  227: IMPORT INT td_lst_sem( ID list[], INT nent );
  228: IMPORT INT td_lst_flg( ID list[], INT nent );
  229: IMPORT INT td_lst_mbx( ID list[], INT nent );
  230: IMPORT INT td_lst_mtx( ID list[], INT nent );
  231: IMPORT INT td_lst_mbf( ID list[], INT nent );
  232: IMPORT INT td_lst_por( ID list[], INT nent );
  233: IMPORT INT td_lst_mpf( ID list[], INT nent );
  234: IMPORT INT td_lst_mpl( ID list[], INT nent );
  235: IMPORT INT td_lst_cyc( ID list[], INT nent );
  236: IMPORT INT td_lst_alm( ID list[], INT nent );
  237: IMPORT INT td_lst_ssy( ID list[], INT nent );
  238: 
  239: /* Refer each object state */
  240: IMPORT ER td_ref_sem( ID semid, TD_RSEM *rsem );
  241: IMPORT ER td_ref_flg( ID flgid, TD_RFLG *rflg );
  242: IMPORT ER td_ref_mbx( ID mbxid, TD_RMBX *rmbx );
  243: IMPORT ER td_ref_mtx( ID mtxid, TD_RMTX *rmtx );
  244: IMPORT ER td_ref_mbf( ID mbfid, TD_RMBF *rmbf );
  245: IMPORT ER td_ref_por( ID porid, TD_RPOR *rpor );
  246: IMPORT ER td_ref_mpf( ID mpfid, TD_RMPF *rmpf );
  247: IMPORT ER td_ref_mpl( ID mplid, TD_RMPL *rmpl );
  248: IMPORT ER td_ref_cyc( ID cycid, TD_RCYC *rcyc );
  249: IMPORT ER td_ref_alm( ID almid, TD_RALM *ralm );
  250: IMPORT ER td_ref_ssy( ID ssid, TD_RSSY *rssy );
  251: 
  252: /* Refer task state */
  253: IMPORT ER td_ref_tsk( ID tskid, TD_RTSK *rtsk );
  254: IMPORT ER td_inf_tsk( ID tskid, TD_ITSK *itsk, BOOL clr );
  255: 
  256: #if TK_SUPPORT_REGOPS
  257: IMPORT ER td_get_reg( ID tskid, T_REGS *regs, T_EIT *eit, T_CREGS *cregs );
  258: IMPORT ER td_set_reg( ID tskid, CONST T_REGS *regs, CONST T_EIT *eit, CONST T_CREGS *cregs );
  259: #endif  /* TK_SUPPORT_REGOPS */
  260: 
  261: /* Refer system state */
  262: IMPORT ER td_ref_sys( TD_RSYS *rsys );
  263: IMPORT ER td_get_tim( SYSTIM *tim, UW *ofs );
  264: IMPORT ER td_get_otm( SYSTIM *tim, UW *ofs );
  265: 
  266: /* Refer ready queue */
  267: IMPORT INT td_rdy_que( PRI pri, ID list[], INT nent );
  268: 
  269: /* Refer wait queue */
  270: IMPORT INT td_sem_que( ID semid, ID list[], INT nent );
  271: IMPORT INT td_flg_que( ID flgid, ID list[], INT nent );
  272: IMPORT INT td_mbx_que( ID mbxid, ID list[], INT nent );
  273: IMPORT INT td_mtx_que( ID mtxid, ID list[], INT nent );
  274: IMPORT INT td_smbf_que( ID mbfid, ID list[], INT nent );
  275: IMPORT INT td_rmbf_que( ID mbfid, ID list[], INT nent );
  276: IMPORT INT td_cal_que( ID porid, ID list[], INT nent );
  277: IMPORT INT td_acp_que( ID porid, ID list[], INT nent );
  278: IMPORT INT td_mpf_que( ID mpfid, ID list[], INT nent );
  279: IMPORT INT td_mpl_que( ID mplid, ID list[], INT nent );
  280: 
  281: /* Execution trace */
  282: IMPORT ER td_hok_svc( CONST TD_HSVC *hsvc );
  283: IMPORT ER td_hok_dsp( CONST TD_HDSP *hdsp );
  284: IMPORT ER td_hok_int( CONST TD_HINT *hint );
  285: 
  286: /* Object name */
  287: IMPORT ER td_ref_dsname( UINT type, ID id, UB *dsname );
  288: IMPORT ER td_set_dsname( UINT type, ID id, CONST UB *dsname );
  289: 
  290: /* [END SYSCALLS] */
  291: 
  292: #ifdef __cplusplus
  293: }
  294: #endif
  295: #endif /* __TK_DBGSPT_H__ */