XWOS API  4.0
XWOS C/C++ API参考手册
载入中...
搜索中...
未找到
mif.h
浏览该文件的文档.
1
13#ifndef __xwmd_isc_xwcq_mif_h__
14#define __xwmd_isc_xwcq_mif_h__
15
16#include <xwos/standard.h>
17#include <xwos/lib/object.h>
18#include <xwos/lib/bclst.h>
20#include <xwos/osal/sync/sem.h>
21#include <xwos/osal/sync/sel.h>
22
117// cppcheck-suppress [misra-c2012-20.7]
118#define XWCQ_DEF_MEMPOOL(name, slotsize, slotnum) \
119 __xwcc_alignl1cache xwu8_t name[(slotsize) * (slotnum)]
120
124struct xwcq {
128 struct xwos_sem sem;
133};
134
138typedef struct {
139 struct xwcq * cq;
141} xwcq_d;
142
164
174xwer_t xwcq_fini(struct xwcq * cq);
175
183xwsq_t xwcq_get_tik(struct xwcq * cq);
184
194{
195 xwcq_d cqd;
196
197 cqd.cq = cq;
198 cqd.tik = xwcq_get_tik(cq);
199 return cqd;
200}
201
216
231
242xwer_t xwcq_grab(struct xwcq * cq);
243
254xwer_t xwcq_put(struct xwcq * cq);
255
274xwer_t xwcq_eq(struct xwcq * cq, const xwu8_t * data, xwsz_t * size);
275
292xwer_t xwcq_jq(struct xwcq * cq, const xwu8_t * data, xwsz_t * size);
293
316xwer_t xwcq_dq(struct xwcq * cq, xwu8_t * data, xwsz_t * size);
317
346xwer_t xwcq_dq_to(struct xwcq * cq, xwu8_t * data, xwsz_t * size, xwtm_t to);
347
369xwer_t xwcq_dq_unintr(struct xwcq * cq, xwu8_t * data, xwsz_t * size);
370
388xwer_t xwcq_trydq(struct xwcq * cq, xwu8_t * data, xwsz_t * size);
389
412xwer_t xwcq_rq(struct xwcq * cq, xwu8_t * data, xwsz_t * size);
413
443xwer_t xwcq_rq_to(struct xwcq * cq, xwu8_t * data, xwsz_t * size, xwtm_t to);
444
466xwer_t xwcq_rq_unintr(struct xwcq * cq, xwu8_t * data, xwsz_t * size);
467
484xwer_t xwcq_tryrq(struct xwcq * cq, xwu8_t * data, xwsz_t * size);
485
509xwer_t xwcq_pfq(struct xwcq * cq, xwu8_t * data, xwsz_t * size);
510
541xwer_t xwcq_pfq_to(struct xwcq * cq, xwu8_t * data, xwsz_t * size, xwtm_t to);
542
565xwer_t xwcq_pfq_unintr(struct xwcq * cq, xwu8_t * data, xwsz_t * size);
566
584xwer_t xwcq_trypfq(struct xwcq * cq, xwu8_t * data, xwsz_t * size);
585
609xwer_t xwcq_prq(struct xwcq * cq, xwu8_t * data, xwsz_t * size);
610
640xwer_t xwcq_prq_to(struct xwcq * cq, xwu8_t * data, xwsz_t * size, xwtm_t to);
641
664xwer_t xwcq_prq_unintr(struct xwcq * cq, xwu8_t * data, xwsz_t * size);
665
683xwer_t xwcq_tryprq(struct xwcq * cq, xwu8_t * data, xwsz_t * size);
684
694xwer_t xwcq_flush(struct xwcq * cq);
695
709xwer_t xwcq_get_capacity(struct xwcq * cq, xwsz_t * capbuf);
710
723xwer_t xwcq_get_size(struct xwcq * cq, xwsz_t * szbuf);
724
737xwer_t xwcq_get_availability(struct xwcq * cq, xwsz_t * avbbuf);
738
754xwer_t xwcq_bind(struct xwcq * cq, struct xwos_sel * sel, xwsq_t pos);
755
767xwer_t xwcq_unbind(struct xwcq * cq, struct xwos_sel * sel);
768
773#endif /* xwmd/isc/xwcq/mif.h */
XWOS通用库:双循环链表
xwer_t xwcq_get_availability(struct xwcq *cq, xwsz_t *avbbuf)
XWCQ API: 获取循环队列中有效数据槽的数量
Definition xwcq.c:662
xwer_t xwcq_init(struct xwcq *cq, xwsz_t slotsize, xwsz_t slotnum, xwu8_t *mem)
XWCQ API:初始化循环队列
Definition xwcq.c:94
xwer_t xwcq_dq_to(struct xwcq *cq, xwu8_t *data, xwsz_t *size, xwtm_t to)
XWCQ API: 限时等待从循环队列的 首端 接收数据 (离队,DeQueue)
Definition xwcq.c:223
xwer_t xwcq_get_capacity(struct xwcq *cq, xwsz_t *capbuf)
XWCQ API: 获取循环队列的容量
Definition xwcq.c:644
xwer_t xwcq_bind(struct xwcq *cq, struct xwos_sel *sel, xwsq_t pos)
XWOS API:绑定循环队列对象到信号选择器
Definition xwcq.c:675
xwsq_t xwcq_get_tik(struct xwcq *cq)
XWCQ API:获取循环队列对象的标签
Definition xwcq.c:114
xwer_t xwcq_prq(struct xwcq *cq, xwu8_t *data, xwsz_t *size)
XWCQ API: 等待从循环队列 尾端 拷贝数据 (Peek at the Rear of Queue)
Definition xwcq.c:523
xwer_t xwcq_pfq_unintr(struct xwcq *cq, xwu8_t *data, xwsz_t *size)
XWCQ API: 等待从循环队列 头端 拷贝数据 (Peek at the Front of Queue), 并且等待不可被中断
Definition xwcq.c:463
xwer_t xwcq_tryrq(struct xwcq *cq, xwu8_t *data, xwsz_t *size)
XWCQ API: 尝试从循环队列的 尾端 接收数据 (反向离队,Reversely deQueue)
Definition xwcq.c:394
xwer_t xwcq_release(xwcq_d cqd)
XWCQ API:检查循环队列对象的标签并增加引用计数
Definition xwcq.c:133
xwer_t xwcq_trydq(struct xwcq *cq, xwu8_t *data, xwsz_t *size)
XWCQ API: 尝试从循环队列的 首端 接收数据 (离队,DeQueue)
Definition xwcq.c:289
xwer_t xwcq_put(struct xwcq *cq)
XWCQ API:减少循环队列对象的引用计数
Definition xwcq.c:146
xwer_t xwcq_pfq_to(struct xwcq *cq, xwu8_t *data, xwsz_t *size, xwtm_t to)
XWCQ API: 限时等待从循环队列 头端 拷贝数据 (Peek at the Front of Queue)
Definition xwcq.c:433
xwer_t xwcq_dq_unintr(struct xwcq *cq, xwu8_t *data, xwsz_t *size)
XWCQ API: 等待从循环队列的 首端 接收数据 (离队,DeQueue), 并且等待不可被中断
Definition xwcq.c:256
xwer_t xwcq_prq_to(struct xwcq *cq, xwu8_t *data, xwsz_t *size, xwtm_t to)
XWCQ API: 限时等待从循环队列 尾端 拷贝数据 (Peek at the Rear of Queue)
Definition xwcq.c:529
xwer_t xwcq_jq(struct xwcq *cq, const xwu8_t *data, xwsz_t *size)
XWCQ API:将数据发送循环队列的 首端 (插队,Jump the Queue)
Definition xwcq.c:185
xwer_t xwcq_rq(struct xwcq *cq, xwu8_t *data, xwsz_t *size)
XWCQ API: 等待从循环队列的 尾端 接收数据 (反向离队,Reversely deQueue)
Definition xwcq.c:322
xwer_t xwcq_tryprq(struct xwcq *cq, xwu8_t *data, xwsz_t *size)
XWCQ API: 尝试从循环队列 尾端 拷贝数据 (Peek at the Rear of Queue)
Definition xwcq.c:599
static xwcq_d xwcq_get_d(struct xwcq *cq)
XWCQ API:获取循环队列对象描述符
Definition mif.h:193
xwer_t xwcq_get_size(struct xwcq *cq, xwsz_t *szbuf)
XWCQ API: 获取循环队列的单个数据槽的大小
Definition xwcq.c:653
xwer_t xwcq_unbind(struct xwcq *cq, struct xwos_sel *sel)
XWOS API:从信号选择器上解绑循环队列对象
Definition xwcq.c:689
xwer_t xwcq_prq_unintr(struct xwcq *cq, xwu8_t *data, xwsz_t *size)
XWCQ API: 等待从循环队列 尾端 拷贝数据 (Peek at the Rear of Queue), 并且等待不可被中断
Definition xwcq.c:564
xwer_t xwcq_dq(struct xwcq *cq, xwu8_t *data, xwsz_t *size)
XWCQ API: 等待从循环队列的 首端 接收数据 (离队,DeQueue)
Definition xwcq.c:217
xwer_t xwcq_eq(struct xwcq *cq, const xwu8_t *data, xwsz_t *size)
XWCQ API:将数据发送到循环队列的 尾端 (入队,EnQueue)
Definition xwcq.c:153
xwer_t xwcq_fini(struct xwcq *cq)
XWCQ API:销毁循环队列对象
Definition xwcq.c:107
xwer_t xwcq_grab(struct xwcq *cq)
XWCQ API:增加循环队列对象的引用计数
Definition xwcq.c:139
xwer_t xwcq_rq_unintr(struct xwcq *cq, xwu8_t *data, xwsz_t *size)
XWCQ API: 等待从循环队列的 尾端 接收数据 (反向离队,Reversely deQueue), 并且等待不可被中断
Definition xwcq.c:361
xwer_t xwcq_flush(struct xwcq *cq)
XWCQ API: 清空循环队列
Definition xwcq.c:633
xwer_t xwcq_acquire(xwcq_d cqd)
XWCQ API:检查循环队列对象的标签并增加引用计数
Definition xwcq.c:127
xwer_t xwcq_rq_to(struct xwcq *cq, xwu8_t *data, xwsz_t *size, xwtm_t to)
XWCQ API: 限时等待从循环队列的 尾端 接收数据 (反向离队,Reversely deQueue)
Definition xwcq.c:328
xwer_t xwcq_trypfq(struct xwcq *cq, xwu8_t *data, xwsz_t *size)
XWCQ API: 尝试从循环队列 头端 拷贝数据 (Peek at the Front of Queue)
Definition xwcq.c:493
xwer_t xwcq_pfq(struct xwcq *cq, xwu8_t *data, xwsz_t *size)
XWCQ API: 等待从循环队列 头端 拷贝数据 (Peek at the Front of Queue)
Definition xwcq.c:427
#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
uint8_t xwu8_t
Definition type.h:194
unsigned long xwsq_t
Definition type.h:445
signed long xwssz_t
Definition type.h:355
操作系统抽象层:自旋锁
循环队列对象描述符
Definition mif.h:138
struct xwcq * cq
Definition mif.h:139
xwsq_t tik
Definition mif.h:140
循环队列对象
Definition mif.h:124
struct xwos_sem sem
Definition mif.h:128
struct xwos_splk lock
Definition mif.h:129
struct xwos_object xwobj
Definition mif.h:125
xwsz_t slotnum
Definition mif.h:127
xwssz_t front
Definition mif.h:131
xwssz_t rear
Definition mif.h:130
xwu8_t * q
Definition mif.h:132
xwsz_t slotsize
Definition mif.h:126
XWOS对象
Definition object.h:53
XWOS API:信号选择器对象
Definition sel.h:81
XWOS API:信号量对象
Definition sem.h:95
XWOS API:自旋锁
Definition spinlock.h:73
操作系统抽象层:信号选择器
操作系统抽象层:信号量
XWOS通用库:XWOS的对象
XWOS的标准头文件