gonzui


Format: Advanced Search

mtkernel_3/kernel/tkernel/winfo.hbare sourcepermlink (0.05 seconds)

Search this content:

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