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
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
use super::{bool_t, uint_t, ATR, ER, ER_ID, ER_UINT, EXINF, ID, PRI, RELTIM, STAT, TMO};
pub type TASK = Option<unsafe extern "C" fn(EXINF)>;
pub const TA_ACT: ATR = 0x01;
pub const TA_NOACTQUE: ATR = 0x02;
#[cfg(all(feature = "asp3", feature = "rstr_task"))]
pub const TA_RSTR: ATR = 0x04;
pub const TTS_RUN: STAT = 0x01;
pub const TTS_RDY: STAT = 0x02;
pub const TTS_WAI: STAT = 0x04;
pub const TTS_SUS: STAT = 0x08;
pub const TTS_WAS: STAT = 0x0c;
pub const TTS_DMT: STAT = 0x10;
pub const TTW_SLP: STAT = 0x0001;
pub const TTW_DLY: STAT = 0x0002;
pub const TTW_SEM: STAT = 0x0004;
pub const TTW_FLG: STAT = 0x0008;
pub const TTW_SDTQ: STAT = 0x0010;
pub const TTW_RDTQ: STAT = 0x0020;
pub const TTW_SPDQ: STAT = 0x0100;
pub const TTW_RPDQ: STAT = 0x0200;
#[cfg(any(
all(feature = "asp3", feature = "messagebuf"),
all(feature = "solid_asp3", feature = "messagebuf")
))]
pub const TTW_SMBF: STAT = 0x0400;
#[cfg(any(
all(feature = "asp3", feature = "messagebuf"),
all(feature = "solid_asp3", feature = "messagebuf")
))]
pub const TTW_RMBF: STAT = 0x0800;
pub const TTW_MTX: STAT = 0x0080;
pub const TTW_MPF: STAT = 0x2000;
pub const TSK_SELF: ID = 0;
pub const TSK_NONE: ID = 0;
pub const TPRI_SELF: PRI = 0;
pub const TPRI_INI: PRI = 0;
#[cfg(any(
all(feature = "asp3", feature = "dcre"),
all(feature = "solid_asp3", feature = "dcre")
))]
#[derive(Debug, Clone, Copy)]
#[repr(C)]
pub struct T_CTSK {
pub tskatr: ATR,
pub exinf: EXINF,
pub task: TASK,
pub itskpri: PRI,
pub stksz: usize,
pub stk: *mut u8,
}
#[cfg(all(feature = "solid_fmp3", feature = "dcre"))]
#[derive(Debug, Clone, Copy)]
#[repr(C)]
pub struct T_CTSK {
pub tskatr: ATR,
pub exinf: EXINF,
pub task: TASK,
pub itskpri: PRI,
pub stksz: usize,
pub stk: *mut u8,
pub iprcid: ID,
pub affinity: uint_t,
}
#[cfg(any(feature = "asp3", feature = "solid_asp3"))]
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
#[repr(C)]
pub struct T_RTSK {
pub tskstat: STAT,
pub tskpri: PRI,
pub tskbpri: PRI,
pub tskwait: STAT,
pub wobjid: ID,
pub lefttmo: TMO,
pub actcnt: uint_t,
pub wupcnt: uint_t,
pub raster: bool_t,
pub dister: bool_t,
}
#[cfg(any(feature = "fmp3", feature = "solid_fmp3"))]
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
#[repr(C)]
pub struct T_RTSK {
pub tskstat: STAT,
pub tskpri: PRI,
pub tskbpri: PRI,
pub tskwait: STAT,
pub wobjid: ID,
pub lefttmo: TMO,
pub actcnt: uint_t,
pub wupcnt: uint_t,
pub raster: bool_t,
pub dister: bool_t,
pub prcid: ID,
pub actprc: ID,
}
#[cfg(any(
feature = "asp3",
feature = "fmp3",
feature = "solid_asp3",
feature = "solid_fmp3"
))]
extern "C" {
pub fn act_tsk(tskid: ID) -> ER;
pub fn can_act(tskid: ID) -> ER_UINT;
pub fn get_tst(tskid: ID, p_tskstat: *mut STAT) -> ER;
pub fn chg_pri(tskid: ID, tskpri: PRI) -> ER;
pub fn get_pri(tskid: ID, p_tskpri: *mut PRI) -> ER;
pub fn get_inf(p_exinf: *mut isize) -> ER;
pub fn ref_tsk(tskid: ID, pk_rtsk: *mut T_RTSK) -> ER;
}
#[cfg(any(feature = "fmp3", feature = "solid_fmp3"))]
extern "C" {
pub fn mact_tsk(tskid: ID, prcid: ID) -> ER;
pub fn mig_tsk(tskid: ID, prcid: ID) -> ER;
}
#[cfg(any(
all(feature = "asp3", feature = "dcre"),
all(feature = "solid_asp3", feature = "dcre"),
all(feature = "solid_fmp3", feature = "dcre")
))]
extern "C" {
pub fn acre_tsk(pk_ctsk: *const T_CTSK) -> ER_ID;
pub fn del_tsk(tskid: ID) -> ER;
}
#[cfg(any(
all(feature = "asp3", feature = "subprio"),
feature = "fmp3",
feature = "solid_fmp3"
))]
extern "C" {
pub fn chg_spr(tskid: ID, subpri: uint_t) -> ER;
}
#[cfg(any(
feature = "asp3",
feature = "fmp3",
feature = "solid_asp3",
feature = "solid_fmp3"
))]
extern "C" {
pub fn slp_tsk() -> ER;
pub fn tslp_tsk(tmout: TMO) -> ER;
pub fn wup_tsk(tskid: ID) -> ER;
pub fn can_wup(tskid: ID) -> ER_UINT;
pub fn rel_wai(tskid: ID) -> ER;
pub fn sus_tsk(tskid: ID) -> ER;
pub fn rsm_tsk(tskid: ID) -> ER;
pub fn dly_tsk(dlytim: RELTIM) -> ER;
}
#[cfg(any(
feature = "asp3",
feature = "fmp3",
feature = "solid_asp3",
feature = "solid_fmp3"
))]
extern "C" {
pub fn ext_tsk() -> ER;
pub fn ras_ter(tskid: ID) -> ER;
pub fn dis_ter() -> ER;
pub fn ena_ter() -> ER;
pub fn sns_ter() -> bool_t;
pub fn ter_tsk(tskid: ID) -> ER;
}
#[cfg(any(
all(feature = "solid_asp3", feature = "exd_tsk"),
all(feature = "solid_fmp3", feature = "exd_tsk")
))]
extern "C" {
pub fn exd_tsk() -> ER;
}