mtkernel_3/include/tk/typedef.h | bare source | permlink (0.03 seconds) |
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: * typedef.h 16: * 17: * T-Kernel Standard Data Type Definition 18: */ 19: 20: #ifndef __TK_TYPEDEF_H__ 21: #define __TK_TYPEDEF_H__ 22: 23: #include <sys/machine.h> 24: 25: #ifdef CHK_TKERNEL_CONST 26: #define CONST const 27: #else 28: #define CONST 29: #endif 30: 31: /* 32: * General-purpose data type 33: */ 34: typedef signed char B; /* Signed 8 bit integer */ 35: typedef signed short H; /* Signed 16 bit integer */ 36: typedef signed long W; /* Signed 32 bit integer */ 37: typedef signed long long D; /* Signed 64 bit integer */ 38: typedef unsigned char UB; /* Unsigned 8 bit integer */ 39: typedef unsigned short UH; /* Unsigned 16 bit integer */ 40: typedef unsigned long UW; /* Unsigned 32 bit integer */ 41: typedef unsigned long long UD; /* Unsigned 64 bit integer */ 42: 43: typedef signed char VB; /* Nonuniform type 8 bit data */ 44: typedef signed short VH; /* Nonuniform type 16 bit data */ 45: typedef signed long VW; /* Nonuniform type 32 bit data */ 46: typedef signed long long VD; /* Nonuniform type 64 bit data */ 47: 48: typedef volatile B _B; /* Volatile statement attached */ 49: typedef volatile H _H; 50: typedef volatile W _W; 51: typedef volatile D _D; 52: typedef volatile UB _UB; 53: typedef volatile UH _UH; 54: typedef volatile UW _UW; 55: typedef volatile UD _UD; 56: 57: typedef signed int INT; /* Processor bit width signed integer */ 58: typedef unsigned int UINT; /* Processor bit width unsigned integer */ 59: 60: typedef W SZ; /* Size general */ 61: 62: typedef INT ID; /* ID general */ 63: typedef W MSEC; /* Time general (millisecond) */ 64: 65: typedef void (*FP)(); /* Function address general */ 66: typedef INT (*FUNCP)(); /* Function address general */ 67: 68: #define LOCAL static /* Local symbol definition */ 69: #define EXPORT /* Global symbol definition */ 70: #define IMPORT extern /* Global symbol reference */ 71: 72: /* 73: * Boolean value 74: * Defined as TRUE = 1, but it is always true when not 0. 75: * Thus, comparison such as bool = TRUE are not permitted. 76: * Should be as per bool !=FALSE. 77: */ 78: typedef UINT BOOL; 79: #define TRUE 1 /* True */ 80: #define FALSE 0 /* False */ 81: 82: /* 83: * Data type in which meaning is defined in T-Kernel/OS specification 84: */ 85: typedef INT FN; /* Function code */ 86: typedef INT RNO; /* Rendezvous number */ 87: typedef UW ATR; /* Object/handler attribute */ 88: typedef INT ER; /* Error code */ 89: typedef INT PRI; /* Priority */ 90: typedef W TMO; /* Time out setting */ 91: typedef UW RELTIM; /* Relative time */ 92: 93: typedef struct systim { /* System time */ 94: W hi; /* Upper 32 bits */ 95: UW lo; /* Lower 32 bits */ 96: } SYSTIM; 97: 98: typedef D SYSTIM_U; /* System time (64bit) */ 99: 100: /* 101: * Common constant 102: */ 103: #ifndef NULL 104: #define NULL 0 105: #endif 106: 107: #define TA_NULL 0U /* No special attributes indicated */ 108: #define TMO_POL 0 /* Polling */ 109: #define TMO_FEVR (-1) /* Permanent wait */ 110: 111: /* ------------------------------------------------------------------------ */ 112: 113: #endif /* __TK_TYPEDEF_H__ */