tkernel_2/kernel/tkernel/src/config.h | bare source | permlink (0.02 seconds) |
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: * config.h (T-Kernel/OS) 17: * System Configuration Definition 18: */ 19: 20: #ifndef _CONFIG_ 21: #define _CONFIG_ 22: 23: /* Task configuration */ 24: #define MIN_TSKID (1) 25: #define MAX_TSKID (max_tskid) 26: #define NUM_TSKID (MAX_TSKID) 27: #define CHK_TSKID(id) ((MIN_TSKID) <= (id) && (id) <= (MAX_TSKID)) 28: #define INDEX_TSK(id) ((id)-(MIN_TSKID)) 29: #define ID_TSK(index) ((index)+(MIN_TSKID)) 30: 31: /* Semaphore configuration */ 32: #define MIN_SEMID (1) 33: #define MAX_SEMID (max_semid) 34: #define NUM_SEMID (MAX_SEMID) 35: #define CHK_SEMID(id) ((MIN_SEMID) <= (id) && (id) <= (MAX_SEMID)) 36: #define INDEX_SEM(id) ((id)-(MIN_SEMID)) 37: #define ID_SEM(index) ((index)+(MIN_SEMID)) 38: 39: /* Mutex configuration */ 40: #define MIN_MTXID (1) 41: #define MAX_MTXID (max_mtxid) 42: #define NUM_MTXID (MAX_MTXID) 43: #define CHK_MTXID(id) ((MIN_MTXID) <= (id) && (id) <= (MAX_MTXID)) 44: #define INDEX_MTX(id) ((id)-(MIN_MTXID)) 45: #define ID_MTX(index) ((index)+(MIN_MTXID)) 46: 47: /* Event flag configuration */ 48: #define MIN_FLGID (1) 49: #define MAX_FLGID (max_flgid) 50: #define NUM_FLGID (MAX_FLGID) 51: #define CHK_FLGID(id) ((MIN_FLGID) <= (id) && (id) <= (MAX_FLGID)) 52: #define INDEX_FLG(id) ((id)-(MIN_FLGID)) 53: #define ID_FLG(index) ((index)+(MIN_FLGID)) 54: 55: /* Mailbox configuration */ 56: #define MIN_MBXID (1) 57: #define MAX_MBXID (max_mbxid) 58: #define NUM_MBXID (MAX_MBXID) 59: #define CHK_MBXID(id) ((MIN_MBXID) <= (id) && (id) <= (MAX_MBXID)) 60: #define INDEX_MBX(id) ((id)-(MIN_MBXID)) 61: #define ID_MBX(index) ((index)+(MIN_MBXID)) 62: 63: /* Message buffer configuration */ 64: #define MIN_MBFID (1) 65: #define MAX_MBFID (max_mbfid) 66: #define NUM_MBFID (MAX_MBFID) 67: #define CHK_MBFID(id) ((MIN_MBFID) <= (id) && (id) <= (MAX_MBFID)) 68: #define INDEX_MBF(id) ((id)-(MIN_MBFID)) 69: #define ID_MBF(index) ((index)+(MIN_MBFID)) 70: 71: /* Rendezvous configuration */ 72: #define MIN_PORID (1) 73: #define MAX_PORID (max_porid) 74: #define NUM_PORID (MAX_PORID) 75: #define CHK_PORID(id) ((MIN_PORID) <= (id) && (id) <= (MAX_PORID)) 76: #define INDEX_POR(id) ((id)-(MIN_PORID)) 77: #define ID_POR(index) ((index)+(MIN_PORID)) 78: 79: /* Memory pool configuration */ 80: #define MIN_MPLID (1) 81: #define MAX_MPLID (max_mplid) 82: #define NUM_MPLID (MAX_MPLID) 83: #define CHK_MPLID(id) ((MIN_MPLID) <= (id) && (id) <= (MAX_MPLID)) 84: #define INDEX_MPL(id) ((id)-(MIN_MPLID)) 85: #define ID_MPL(index) ((index)+(MIN_MPLID)) 86: 87: /* Fixed size memory pool configuration */ 88: #define MIN_MPFID (1) 89: #define MAX_MPFID (max_mpfid) 90: #define NUM_MPFID (MAX_MPFID) 91: #define CHK_MPFID(id) ((MIN_MPFID) <= (id) && (id) <= (MAX_MPFID)) 92: #define INDEX_MPF(id) ((id)-(MIN_MPFID)) 93: #define ID_MPF(index) ((index)+(MIN_MPFID)) 94: 95: /* Cyclic handler configuration */ 96: #define MIN_CYCID (1) 97: #define MAX_CYCID (max_cycid) 98: #define NUM_CYCID (MAX_CYCID) 99: #define CHK_CYCID(id) ((MIN_CYCID) <= (id) && (id) <= (MAX_CYCID)) 100: #define INDEX_CYC(id) ((id)-(MIN_CYCID)) 101: #define ID_CYC(index) ((index)+(MIN_CYCID)) 102: 103: /* Alarm handler configuration */ 104: #define MIN_ALMID (1) 105: #define MAX_ALMID (max_almid) 106: #define NUM_ALMID (MAX_ALMID) 107: #define CHK_ALMID(id) ((MIN_ALMID) <= (id) && (id) <= (MAX_ALMID)) 108: #define INDEX_ALM(id) ((id)-(MIN_ALMID)) 109: #define ID_ALM(index) ((index)+(MIN_ALMID)) 110: 111: /* Subsystem manager configuration */ 112: #define MIN_SSYID (1) 113: #define MAX_SSYID (max_ssyid) 114: #define NUM_SSYID (MAX_SSYID) 115: #define CHK_SSYID(id) ((MIN_SSYID) <= (id) && (id) <= (MAX_SSYID)) 116: #define INDEX_SSY(id) ((id)-(MIN_SSYID)) 117: #define ID_SSY(index) ((index)+(MIN_SSYID)) 118: 119: /* Resource group configuration */ 120: #define MIN_RESID (1) 121: #define MAX_RESID (max_resid) 122: #define NUM_RESID (MAX_RESID) 123: #define CHK_RESID(id) ((MIN_RESID) <= (id) && (id) <= (MAX_RESID)) 124: #define INDEX_RES(id) ((id)-(MIN_RESID)) 125: #define ID_RES(index) ((index)+(MIN_RESID)) 126: 127: /* Task priority configuration */ 128: #define MIN_PRI (1) /* Minimum priority number = highest priority */ 129: #define MAX_PRI (140) /* Maximum priority number = lowest priority */ 130: #define NUM_PRI (140) /* Number of priority levels */ 131: #define CHK_PRI(pri) ((MIN_PRI) <= (pri) && (pri) <= (MAX_PRI)) 132: 133: /* Subsystem manager configuration */ 134: #define MIN_SSYPRI (1) 135: #define MAX_SSYPRI (max_ssypri) 136: #define NUM_SSYPRI (MAX_SSYPRI) 137: #define CHK_SSYPRI(pri) ((MIN_SSYPRI) <= (pri) && (pri) <= (MAX_SSYPRI)) 138: 139: /* 140: * Check parameter 141: * 0: Do not check parameter 142: * 1: Check parameter 143: */ 144: #define CHK_NOSPT (1) /* Check unsupported function (E_NOSPT) */ 145: #define CHK_RSATR (1) /* Check reservation attribute error (E_RSATR) */ 146: #define CHK_PAR (1) /* Check parameter (E_PAR) */ 147: #define CHK_ID (1) /* Check object ID range (E_ID) */ 148: #define CHK_OACV (1) /* Check Object Access Violation (E_OACV) */ 149: #define CHK_CTX (1) /* Check whether task-independent part is running (E_CTX) */ 150: #define CHK_CTX1 (1) /* Check dispatch disable part */ 151: #define CHK_CTX2 (1) /* Check task independent part */ 152: #define CHK_SELF (1) /* Check if its own task is specified (E_OBJ) */ 153: #define CHK_NOCOP (1) /* Check non-existence co-processor error (E_NOCOP) */ 154: 155: /* 156: * Debugger support function 157: * 0: Invalid 158: * 1: Valid 159: */ 160: #define USE_DBGSPT (1) 161: 162: /* Use object name (Add object name to each control block) */ 163: #define USE_OBJECT_NAME (1) /* 0: Do not use object name */ 164: /* 1: Use object name */ 165: #define OBJECT_NAME_LENGTH (8) /* Object name length in each control block */ 166: 167: 168: /* 169: * Output (error) messages from T-Kernel 170: * 0: Do not output message 171: * 1: Output message 172: */ 173: #define USE_KERNEL_MESSAGE (1) 174: 175: #endif /* _CONFIG_ */