XWOS API  4.0
XWOS C/C++ API参考手册
载入中...
搜索中...
未找到
flg.h
浏览该文件的文档.
1
13#ifndef __xwos_osal_sync_flg_h__
14#define __xwos_osal_sync_flg_h__
15
16#include <xwos/standard.h>
18#include <xwos/osal/time.h>
19#include <xwos/osal/sync/sel.h>
20
93struct xwos_flg {
94 struct xwosdl_flg osflg;
95};
96
100typedef struct {
101 struct xwos_flg * flg;
103} xwos_flg_d;
104
108#define XWOS_FLG_NILD ((xwos_flg_d){NULL, 0,})
109
118#define XWOS_FLG_TRIGGER_SET_ALL XWOSDL_FLG_TRIGGER_SET_ALL
122#define XWOS_FLG_TRIGGER_SET_ANY XWOSDL_FLG_TRIGGER_SET_ANY
126#define XWOS_FLG_TRIGGER_CLR_ALL XWOSDL_FLG_TRIGGER_CLR_ALL
130#define XWOS_FLG_TRIGGER_CLR_ANY XWOSDL_FLG_TRIGGER_CLR_ANY
131
136#define XWOS_FLG_TRIGGER_TGL_ALL XWOSDL_FLG_TRIGGER_TGL_ALL
141#define XWOS_FLG_TRIGGER_TGL_ANY XWOSDL_FLG_TRIGGER_TGL_ANY
153#define XWOS_FLG_ACTION_NONE XWOSDL_FLG_ACTION_NONE
154
164#define XWOS_FLG_ACTION_CONSUMPTION XWOSDL_FLG_ACTION_CONSUMPTION
183 xwbmp_t * bmp, xwbmp_t * msk)
184{
185 return xwosdl_flg_init(&flg->osflg, num, bmp, msk);
186}
187
199{
200 return xwosdl_flg_fini(&flg->osflg);
201}
202
218{
219 return xwosdl_flg_grab(&flg->osflg);
220}
221
237{
238 return xwosdl_flg_put(&flg->osflg);
239}
240
254{
255 return xwosdl_flg_create((xwosdl_flg_d *)flgd, num);
256}
257
269{
270 return xwosdl_flg_delete(&flgd.flg->osflg, flgd.tik);
271}
272
286{
287 return xwosdl_flg_acquire(&flgd.flg->osflg, flgd.tik);
288}
289
303{
304 return xwosdl_flg_release(&flgd.flg->osflg, flgd.tik);
305}
306
316{
317 return xwosdl_flg_get_tik(&flg->osflg);
318}
319
329{
330 xwos_flg_d flgd;
331
332 flgd.flg = flg;
333 flgd.tik = xwosdl_flg_get_tik(&flg->osflg);
334 return flgd;
335}
336
353xwer_t xwos_flg_bind(struct xwos_flg * flg, struct xwos_sel * sel, xwsq_t pos)
354{
355 return xwosdl_flg_bind(&flg->osflg, &sel->ossel, pos);
356}
357
370xwer_t xwos_flg_unbind(struct xwos_flg * flg, struct xwos_sel * sel)
371{
372 return xwosdl_flg_unbind(&flg->osflg, &sel->ossel);
373}
374
386xwer_t xwos_flg_get_num(struct xwos_flg * flg, xwsz_t * numbuf)
387{
388 return xwosdl_flg_get_num(&flg->osflg, numbuf);
389}
390
409{
410 return xwosdl_flg_s1m(&flg->osflg, msk);
411}
412
432{
433 return xwosdl_flg_s1i(&flg->osflg, pos);
434}
435
454{
455 return xwosdl_flg_c0m(&flg->osflg, msk);
456}
457
477{
478 return xwosdl_flg_c0i(&flg->osflg, pos);
479}
480
499{
500 return xwosdl_flg_x1m(&flg->osflg, msk);
501}
502
522{
523 return xwosdl_flg_x1i(&flg->osflg, pos);
524}
525
538{
539 return xwosdl_flg_read(&flg->osflg, out);
540}
541
580xwer_t xwos_flg_wait(struct xwos_flg * flg, xwsq_t trigger, xwsq_t action,
581 xwbmp_t origin[], xwbmp_t msk[])
582{
583 return xwosdl_flg_wait(&flg->osflg, trigger, action, origin, msk);
584}
585
630xwer_t xwos_flg_wait_to(struct xwos_flg * flg, xwsq_t trigger, xwsq_t action,
631 xwbmp_t origin[], xwbmp_t msk[],
632 xwtm_t to)
633{
634 return xwosdl_flg_wait_to(&flg->osflg, trigger, action, origin, msk, to);
635}
636
673xwer_t xwos_flg_trywait(struct xwos_flg * flg, xwsq_t trigger, xwsq_t action,
674 xwbmp_t origin[], xwbmp_t msk[])
675{
676 return xwosdl_flg_trywait(&flg->osflg, trigger, action, origin, msk);
677}
678
683#endif /* xwos/osal/sync/flg.h */
#define __xwos_inline_api
Definition compiler.h:179
xws64_t xwtm_t
XWOS系统时间 (有符号)
Definition type.h:742
signed long xwer_t
Definition type.h:554
unsigned long xwsz_t
Definition type.h:339
unsigned long xwsq_t
Definition type.h:445
xwu32_t xwbmp_t
Definition type.h:574
static xwer_t xwos_flg_fini(struct xwos_flg *flg)
XWOS API:销毁静态方式初始化的事件标志对象
Definition flg.h:198
static xwer_t xwos_flg_release(xwos_flg_d flgd)
XWOS API:检查事件标志对象的标签并减少引用计数
Definition flg.h:302
static xwer_t xwos_flg_trywait(struct xwos_flg *flg, xwsq_t trigger, xwsq_t action, xwbmp_t origin[], xwbmp_t msk[])
XWOS API:检查触发事件
Definition flg.h:673
static xwer_t xwos_flg_x1m(struct xwos_flg *flg, xwbmp_t msk[])
XWOS API:同时翻转多个事件标志位
Definition flg.h:498
static xwer_t xwos_flg_x1i(struct xwos_flg *flg, xwsq_t pos)
XWOS API:翻转单个事件标志位
Definition flg.h:521
static xwer_t xwos_flg_c0i(struct xwos_flg *flg, xwsq_t pos)
XWOS API:清除单个事件标志位
Definition flg.h:476
static xwer_t xwos_flg_s1m(struct xwos_flg *flg, xwbmp_t msk[])
XWOS API:同时设置多个事件标志位
Definition flg.h:408
static xwer_t xwos_flg_bind(struct xwos_flg *flg, struct xwos_sel *sel, xwsq_t pos)
XWOS API:绑定事件标志对象到信号选择器
Definition flg.h:353
static xwer_t xwos_flg_wait_to(struct xwos_flg *flg, xwsq_t trigger, xwsq_t action, xwbmp_t origin[], xwbmp_t msk[], xwtm_t to)
XWOS API:限时等待触发事件
Definition flg.h:630
static xwer_t xwos_flg_put(struct xwos_flg *flg)
XWOS API:减少事件标志对象的引用计数
Definition flg.h:236
static xwer_t xwos_flg_grab(struct xwos_flg *flg)
XWOS API:增加事件标志对象的引用计数
Definition flg.h:217
static xwer_t xwos_flg_unbind(struct xwos_flg *flg, struct xwos_sel *sel)
XWOS API:从信号选择器上解绑事件标志对象
Definition flg.h:370
static xwos_flg_d xwos_flg_get_d(struct xwos_flg *flg)
XWOS API:获取事件标志对象描述符
Definition flg.h:328
static xwer_t xwos_flg_s1i(struct xwos_flg *flg, xwsq_t pos)
XWOS API:设置单个事件标志位
Definition flg.h:431
static xwer_t xwos_flg_get_num(struct xwos_flg *flg, xwsz_t *numbuf)
XWOS API:获取事件标志中事件槽的数量
Definition flg.h:386
static xwer_t xwos_flg_init(struct xwos_flg *flg, xwsz_t num, xwbmp_t *bmp, xwbmp_t *msk)
XWOS API:静态方式初始化事件标志对象
Definition flg.h:182
static xwer_t xwos_flg_acquire(xwos_flg_d flgd)
XWOS API:检查事件标志对象的标签并增加引用计数
Definition flg.h:285
static xwer_t xwos_flg_read(struct xwos_flg *flg, xwbmp_t out[])
XWOS API:读取事件标志位图的值
Definition flg.h:537
static xwsq_t xwos_flg_get_tik(struct xwos_flg *flg)
XWOS API:获取事件标志对象的标签
Definition flg.h:315
static xwer_t xwos_flg_c0m(struct xwos_flg *flg, xwbmp_t msk[])
XWOS API:同时清除多个事件标志位
Definition flg.h:453
static xwer_t xwos_flg_create(xwos_flg_d *flgd, xwsz_t num)
XWOS API:动态方式创建事件标志对象
Definition flg.h:253
static xwer_t xwos_flg_wait(struct xwos_flg *flg, xwsq_t trigger, xwsq_t action, xwbmp_t origin[], xwbmp_t msk[])
XWOS API:等待事件
Definition flg.h:580
static xwer_t xwos_flg_delete(xwos_flg_d flgd)
XWOS API:删除动态方式创建的事件标志对象
Definition flg.h:268
操作系统抽象层:事件标志接口描述
XWOS API:事件标志对象描述符
Definition flg.h:100
xwsq_t tik
Definition flg.h:102
struct xwos_flg * flg
Definition flg.h:101
XWOS API:事件标志对象
Definition flg.h:93
struct xwmp_evt osflg
Definition flg.h:94
XWOS API:信号选择器对象
Definition sel.h:81
struct xwmp_evt ossel
Definition sel.h:82
操作系统抽象层:信号选择器
操作系统抽象层:时间
XWOS的标准头文件