[ed11bb26] | 1 | /** |
---|
| 2 | * @file itronsys/eventflags.h |
---|
| 3 | */ |
---|
| 4 | |
---|
[352c9b2] | 5 | /* |
---|
[9d9a3dd] | 6 | * COPYRIGHT (c) 1989-1999. |
---|
| 7 | * On-Line Applications Research Corporation (OAR). |
---|
| 8 | * |
---|
[352c9b2] | 9 | * The license and distribution terms for this file may be |
---|
| 10 | * found in the file LICENSE in this distribution or at |
---|
[e49f9e6b] | 11 | * http://www.rtems.com/license/LICENSE. |
---|
[352c9b2] | 12 | * |
---|
| 13 | * $Id$ |
---|
| 14 | */ |
---|
| 15 | |
---|
[6df1f64] | 16 | #ifndef _ITRONSYS_EVENTFLAGS_H |
---|
| 17 | #define _ITRONSYS_EVENTFLAGS_H |
---|
[352c9b2] | 18 | |
---|
| 19 | #ifdef __cplusplus |
---|
| 20 | extern "C" { |
---|
| 21 | #endif |
---|
| 22 | |
---|
| 23 | /* |
---|
| 24 | * Create Eventflags (cre_flg) Structure |
---|
| 25 | */ |
---|
| 26 | |
---|
| 27 | typedef struct t_cflg { |
---|
| 28 | VP exinf; /* extended information */ |
---|
| 29 | ATR flgatr; /* eventflag attribute */ |
---|
| 30 | UINT iflgptn; /* initial eventflag */ |
---|
| 31 | /* additional information may be included depending on the implementation */ |
---|
| 32 | } T_CFLG; |
---|
| 33 | |
---|
| 34 | /* |
---|
| 35 | * flgatr |
---|
| 36 | */ |
---|
| 37 | |
---|
| 38 | #define TA_WSGL 0x00 /* multiple tasks are not allowed to wait (Wait |
---|
| 39 | Single Task) */ |
---|
| 40 | #define TA_WMUL 0x08 /* multiple tasks are allowed to wait (Wait |
---|
| 41 | Multiple Task) */ |
---|
| 42 | |
---|
| 43 | /* |
---|
| 44 | * wfmode |
---|
| 45 | */ |
---|
[7ded4e37] | 46 | |
---|
[352c9b2] | 47 | #define TWF_ANDW 0x00 /* AND wait */ |
---|
| 48 | #define TWF_ORW 0x02 /* OR wait */ |
---|
| 49 | #define TWF_CLR 0x01 /* clear specification */ |
---|
| 50 | |
---|
| 51 | /* |
---|
| 52 | * Reference Eventflags (ref_flg) Structure |
---|
| 53 | */ |
---|
| 54 | |
---|
| 55 | typedef struct t_rflg { |
---|
| 56 | VP exinf; /* extended information */ |
---|
| 57 | BOOL_ID wtsk; /* indicates whether or not there is a waiting task */ |
---|
| 58 | UINT flgptn; /* eventflag bit pattern */ |
---|
| 59 | /* additional information may be included depending on the implementation */ |
---|
| 60 | } T_RFLG; |
---|
| 61 | |
---|
| 62 | /* |
---|
| 63 | * Eventflag Functions |
---|
| 64 | */ |
---|
| 65 | |
---|
| 66 | /* |
---|
| 67 | * cre_flg - Create Eventflag |
---|
| 68 | */ |
---|
| 69 | |
---|
| 70 | ER cre_flg( |
---|
| 71 | ID flgid, |
---|
| 72 | T_CFLG *pk_cflg |
---|
| 73 | ); |
---|
| 74 | |
---|
| 75 | /* |
---|
| 76 | * del_flg - Delete Eventflag |
---|
| 77 | */ |
---|
| 78 | |
---|
| 79 | ER del_flg( |
---|
| 80 | ID flgid |
---|
| 81 | ); |
---|
| 82 | |
---|
| 83 | /* |
---|
| 84 | * set_flg - Set Eventflag |
---|
| 85 | */ |
---|
| 86 | |
---|
| 87 | ER set_flg( |
---|
| 88 | ID flgid, |
---|
| 89 | UINT setptn |
---|
| 90 | ); |
---|
| 91 | |
---|
| 92 | /* |
---|
| 93 | * clr_flg - Clear Eventflag |
---|
| 94 | */ |
---|
| 95 | |
---|
| 96 | ER clr_flg( |
---|
| 97 | ID flgid, |
---|
| 98 | UINT clrptn |
---|
| 99 | ); |
---|
| 100 | |
---|
| 101 | /* |
---|
| 102 | * wai_flg - Wait on Eventflag |
---|
| 103 | */ |
---|
| 104 | |
---|
| 105 | ER wai_flg( |
---|
| 106 | UINT *p_flgptn, |
---|
| 107 | ID flgid, |
---|
| 108 | UINT waiptn, |
---|
| 109 | UINT wfmode |
---|
| 110 | ); |
---|
| 111 | |
---|
| 112 | /* |
---|
| 113 | * pol_flg - Wait for Eventflag(Polling) |
---|
| 114 | */ |
---|
| 115 | |
---|
| 116 | ER pol_flg( |
---|
| 117 | UINT *p_flgptn, |
---|
| 118 | ID flgid, |
---|
| 119 | UINT waiptn, |
---|
| 120 | UINT wfmode |
---|
| 121 | ); |
---|
| 122 | |
---|
| 123 | /* |
---|
| 124 | * twai_flg - Wait on Eventflag with Timeout |
---|
| 125 | */ |
---|
| 126 | |
---|
| 127 | ER twai_flg( |
---|
| 128 | UINT *p_flgptn, |
---|
| 129 | ID flgid, |
---|
| 130 | UINT waiptn, |
---|
| 131 | UINT wfmode, |
---|
| 132 | TMO tmout |
---|
| 133 | ); |
---|
| 134 | |
---|
| 135 | /* |
---|
| 136 | * ref_flg - Reference Eventflag Status |
---|
| 137 | */ |
---|
| 138 | |
---|
| 139 | ER ref_flg( |
---|
| 140 | T_RFLG *pk_rflg, |
---|
| 141 | ID flgid |
---|
| 142 | ); |
---|
| 143 | |
---|
| 144 | #ifdef __cplusplus |
---|
| 145 | } |
---|
| 146 | #endif |
---|
| 147 | |
---|
| 148 | #endif |
---|
| 149 | /* end of include file */ |
---|