mtkernel_3/kernel/tkernel/semaphore.h | bare source | permlink (0.00 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: * semaphore.h 16: * Semaphore 17: */ 18: 19: #ifndef _SEMAPHORE_H_ 20: #define _SEMAPHORE_H_ 21: 22: /* 23: * Semaphore control block 24: */ 25: typedef struct semaphore_control_block { 26: QUEUE wait_queue; /* Semaphore wait queue */ 27: ID semid; /* Semaphore ID */ 28: void *exinf; /* Extended information */ 29: ATR sematr; /* Semaphore attribute */ 30: INT semcnt; /* Semaphore current count value */ 31: INT maxsem; /* Semaphore maximum count value */ 32: #if USE_OBJECT_NAME 33: UB name[OBJECT_NAME_LENGTH]; /* name */ 34: #endif 35: } SEMCB; 36: 37: IMPORT SEMCB knl_semcb_table[]; /* Semaphore control block */ 38: IMPORT QUEUE knl_free_semcb; /* FreeQue */ 39: 40: #define get_semcb(id) ( &knl_semcb_table[INDEX_SEM(id)] ) 41: 42: 43: #endif /* _SEMAPHORE_H_ */