gonzui


Format: Advanced Search

tkernel_2/kernel/tkernel/src/winfo.hbare sourcepermlink (0.01 seconds)

Search this content:

    1: /*
    2:  *----------------------------------------------------------------------
    3:  *    T-Kernel 2.0 Software Package
    4:  *
    5:  *    Copyright 2011 by Ken Sakamura.
    6:  *    This software is distributed under the latest version of T-License 2.x.
    7:  *----------------------------------------------------------------------
    8:  *
    9:  *    Released by T-Engine Forum(http://www.t-engine.org/) at 2011/05/17.
   10:  *    Modified by TRON Forum(http://www.tron.org/) at 2015/06/01.
   11:  *
   12:  *----------------------------------------------------------------------
   13:  */
   14: 
   15: /*
   16:  *      winfo.h (T-Kernel/OS)
   17:  *      Definition of Wait Information for Synchronization/Communication Object
   18:  */
   19: 
   20: #ifndef _WINFO_
   21: #define _WINFO_
   22: 
   23: /*
   24:  * Semaphore wait (TTW_SEM)
   25:  */
   26: typedef struct {
   27:         INT    cnt;               /* Request resource number */
   28: } WINFO_SEM;
   29: 
   30: /*
   31:  * Event flag wait (TTW_FLG)
   32:  */
   33: typedef struct {
   34:         UINT   waiptn;           /* Wait bit pattern */
   35:         UINT   wfmode;           /* Wait mode */
   36:         UINT   *p_flgptn;        /* Address that has a bit pattern
   37:                                    at wait released */
   38: } WINFO_FLG;
   39: 
   40: /*
   41:  * Mailbox wait (TTW_MBX)
   42:  */
   43: typedef struct {
   44:         T_MSG  **ppk_msg;       /* Address that has the head of a
   45:                                    message packet */
   46: } WINFO_MBX;
   47: 
   48: /*
   49:  * Message buffer receive/send wait (TTW_RMBF, TTW_SMBF)
   50:  */
   51: typedef struct {
   52:         void   *msg;             /* Address that has a received message */
   53:         INT    *p_msgsz;  /* Address that has a received message size */
   54: } WINFO_RMBF;
   55: 
   56: typedef struct {
   57:         CONST void *msg;       /* Send message head address */
   58:         INT    msgsz;             /* Send message size */
   59: } WINFO_SMBF;
   60: 
   61: /*
   62:  * Rendezvous call/accept/end wait (TTW_CAL, TTW_ACP, TTW_RDV)
   63:  */
   64: typedef struct {
   65:         UINT   calptn;           /* Bit pattern that indicates caller
   66:                                    select condition */
   67:         void   *msg;             /* Address that has a message */
   68:         INT    cmsgsz;            /* Call message size */
   69:         INT    *p_rmsgsz; /* Address that has a reply message size */
   70: } WINFO_CAL;
   71: 
   72: typedef struct {
   73:         UINT   acpptn;           /* Bit pattern that indicates receiver
   74:                                    select condition */
   75:         void   *msg;             /* Address that has a call message */
   76:         RNO    *p_rdvno;  /* Address that has the rendezvous number */
   77:         INT    *p_cmsgsz; /* Address that has the call message size */
   78: } WINFO_ACP;
   79: 
   80: typedef struct {
   81:         RNO    rdvno;             /* Rendezvous number */
   82:         void   *msg;             /* Address that has a message */
   83:         INT    maxrmsz;   /* Maximum length of reply message */
   84:         INT    *p_rmsgsz; /* Address that has a reply message size */
   85: } WINFO_RDV;
   86: 
   87: /*
   88:  * Variable size memory pool wait (TTW_MPL)
   89:  */
   90: typedef struct {
   91:         INT    blksz;             /* Memory block size */
   92:         void   **p_blk;  /* Address that has the head of a
   93:                                    memory block */
   94: } WINFO_MPL;
   95: 
   96: /*
   97:  * Fixed size memory pool wait (TTW_MPF)
   98:  */
   99: typedef struct {
  100:         void   **p_blf;  /* Address that has the head of a
  101:                                    memory block */
  102: } WINFO_MPF;
  103: 
  104: /*
  105:  * Definition of wait information in task control block
  106:  */
  107: typedef union {
  108: #ifdef NUM_SEMID
  109:         WINFO_SEM      sem;
  110: #endif
  111: #ifdef NUM_FLGID
  112:         WINFO_FLG      flg;
  113: #endif
  114: #ifdef NUM_MBXID
  115:         WINFO_MBX      mbx;
  116: #endif
  117: #ifdef NUM_MBFID
  118:         WINFO_RMBF     rmbf;
  119:         WINFO_SMBF     smbf;
  120: #endif
  121: #ifdef NUM_PORID
  122:         WINFO_CAL      cal;
  123:         WINFO_ACP      acp;
  124:         WINFO_RDV      rdv;
  125: #endif
  126: #ifdef NUM_MPLID
  127:         WINFO_MPL      mpl;
  128: #endif
  129: #ifdef NUM_MPFID
  130:         WINFO_MPF      mpf;
  131: #endif
  132: } WINFO;
  133: 
  134: /*
  135:  * Definition of wait specification structure
  136:  */
  137: typedef struct {
  138:         UINT   tskwait;                  /* Wait factor */
  139:         void   (*chg_pri_hook)(TCB *, INT);      /* Process at task priority
  140:                                                    change */
  141:         void   (*rel_wai_hook)(TCB *);           /* Process at task wait
  142:                                                    release */
  143: } WSPEC;
  144: 
  145: #endif /* _WINFO_ */