summaryrefslogtreecommitdiffstats
path: root/c/src/exec/itron/include/itronsys/eventflags.h
blob: 27224404f7fcdfd5a1a5f0a4e99023cefd385e5d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
/*
 *  The license and distribution terms for this file may be
 *  found in the file LICENSE in this distribution or at
 *  http://www.OARcorp.com/rtems/license.html.
 *
 *  $Id$
 */

#ifndef __ITRON_EVENTFLAGS_h_
#define __ITRON_EVENTFLAGS_h_

#ifdef __cplusplus
extern "C" {
#endif

/*
 *  Create Eventflags (cre_flg) Structure
 */

typedef struct t_cflg {
  VP     exinf;     /* extended information */
  ATR    flgatr;    /* eventflag attribute */
  UINT   iflgptn;   /* initial eventflag */
  /* additional information may be included depending on the implementation */
} T_CFLG;

/*
 *  flgatr
 */

#define TA_WSGL   0x00   /* multiple tasks are not allowed to wait (Wait
                                Single Task) */
#define TA_WMUL   0x08   /* multiple tasks are allowed to wait (Wait
                                Multiple Task) */

/*
 *  wfmode
 */
 
#define TWF_ANDW   0x00   /* AND wait */
#define TWF_ORW    0x02   /* OR wait */
#define TWF_CLR    0x01   /* clear specification */

/*
 *  Reference Eventflags (ref_flg) Structure
 */

typedef struct t_rflg {
  VP        exinf;      /* extended information */
  BOOL_ID   wtsk;       /* indicates whether or not there is a waiting task */
  UINT      flgptn;     /* eventflag bit pattern */
  /* additional information may be included depending on the implementation */
} T_RFLG;

/*
 *  Eventflag Functions
 */

/*
 *  cre_flg - Create Eventflag
 */

ER cre_flg(
  ID flgid,
  T_CFLG *pk_cflg
);

/*
 *  del_flg - Delete Eventflag
 */

ER del_flg(
  ID flgid
);

/*
 *  set_flg - Set Eventflag
 */

ER set_flg(
  ID flgid,
  UINT setptn
);

/*
 *  clr_flg - Clear Eventflag
 */

ER clr_flg(
  ID flgid,
  UINT clrptn
);

/*
 *  wai_flg - Wait on Eventflag
 */

ER wai_flg(
  UINT *p_flgptn,
  ID flgid,
  UINT waiptn,
  UINT wfmode
);

/*
 *  pol_flg - Wait for Eventflag(Polling)
 */

ER pol_flg(
  UINT *p_flgptn,
  ID flgid,
  UINT waiptn,
  UINT wfmode
);

/*
 *  twai_flg - Wait on Eventflag with Timeout
 */

ER twai_flg(
  UINT *p_flgptn,
  ID flgid,
  UINT waiptn,
  UINT wfmode,
  TMO tmout
);

/*
 *  ref_flg - Reference Eventflag Status
 */

ER ref_flg(
  T_RFLG *pk_rflg,
  ID flgid
);

#ifdef __cplusplus
}
#endif

#endif
/* end of include file */