gonzui


Format: Advanced Search

tkernel_2/include/tk/typedef.hbare sourcepermlink (0.02 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:  *      @(#)typedef.h (T-Kernel)
   17:  *
   18:  *      T-Kernel Standard Data Type Definition
   19:  */
   20: 
   21: #ifndef __TK_TYPEDEF_H__
   22: #define __TK_TYPEDEF_H__
   23: 
   24: #include <basic.h>
   25: 
   26: #ifdef __cplusplus
   27: extern "C" {
   28: #endif
   29: 
   30: /*
   31:  * Data type in which meaning is defined in T-Kernel/OS specification
   32:  */
   33: typedef INT             FN;                /* Function code */
   34: typedef INT             RNO;               /* Rendezvous number */
   35: typedef UW              ATR;                /* Object/handler attribute */
   36: typedef INT             ER;                /* Error code */
   37: typedef INT             PRI;               /* Priority */
   38: typedef W               TMO;         /* Time out setting (ms) */
   39: typedef D               TMO_U;               /* Time out setting (us) */
   40: typedef UW              RELTIM;             /* Relative time (ms) */
   41: typedef UD              RELTIM_U;   /* Relative time (us) */
   42: 
   43: typedef struct systim {                 /* System time (ms) */
   44:         W      hi;                  /* Upper 32 bits */
   45:         UW     lo;                 /* Lower 32 bits */
   46: } SYSTIM;
   47: 
   48: typedef D       SYSTIM_U;             /* System time (us) */
   49: 
   50: /*
   51:  * Common constant
   52:  */
   53: #define NULL            0         /* Invalid address */
   54: #define TA_NULL         0U             /* No special attributes indicated */
   55: #define TMO_POL         0              /* Polling */
   56: #define TMO_FEVR        (-1)           /* Permanent wait */
   57: 
   58: /* ------------------------------------------------------------------------ */
   59: 
   60: /*
   61:  * 64 bits value
   62:  */
   63: typedef struct dw {
   64: #if BIGENDIAN
   65:         W      hi;  /* Upper 32 bits */
   66:         UW     lo; /* Lower 32 bits */
   67: #else
   68:         UW     lo; /* Lower 32 bits */
   69:         W      hi;  /* Upper 32 bits */
   70: #endif
   71: } DW;
   72: 
   73: #ifdef __cplusplus
   74: }
   75: #endif
   76: #endif /* __TK_TYPEDEF_H__ */