WS63 SDK 文档 7021f4f@fbb_ws63
ws63 和 ws63e 解决方案的 SDK 文档
载入中...
搜索中...
未找到
los_queue.h
浏览该文件的文档.
1/* ----------------------------------------------------------------------------
2 * Copyright (c) Huawei Technologies Co., Ltd. 2013-2022. All rights reserved.
3 * Description: Queue
4 * Author: Huawei LiteOS Team
5 * Create: 2013-01-01
6 * Redistribution and use in source and binary forms, with or without modification,
7 * are permitted provided that the following conditions are met:
8 * 1. Redistributions of source code must retain the above copyright notice, this list of
9 * conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright notice, this list
11 * of conditions and the following disclaimer in the documentation and/or other materials
12 * provided with the distribution.
13 * 3. Neither the name of the copyright holder nor the names of its contributors may be used
14 * to endorse or promote products derived from this software without specific prior written
15 * permission.
16 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
18 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
20 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
21 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
22 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
23 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
24 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
25 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
26 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 * --------------------------------------------------------------------------- */
28
34#ifndef _LOS_QUEUE_H
35#define _LOS_QUEUE_H
36
37#include "los_base.h"
38#include "los_list.h"
39
40#ifdef __cplusplus
41extern "C" {
42#endif /* __cplusplus */
43
55#define LOS_ERRNO_QUEUE_MAXNUM_ZERO LOS_ERRNO_OS_ERROR(LOS_MOD_QUE, 0x00)
56
66#define LOS_ERRNO_QUEUE_NO_MEMORY LOS_ERRNO_OS_ERROR(LOS_MOD_QUE, 0x01)
67
77#define LOS_ERRNO_QUEUE_CREATE_NO_MEMORY LOS_ERRNO_OS_ERROR(LOS_MOD_QUE, 0x02)
78
87#define LOS_ERRNO_QUEUE_SIZE_TOO_BIG LOS_ERRNO_OS_ERROR(LOS_MOD_QUE, 0x03)
88
97#define LOS_ERRNO_QUEUE_CB_UNAVAILABLE LOS_ERRNO_OS_ERROR(LOS_MOD_QUE, 0x04)
98
107#define LOS_ERRNO_QUEUE_NOT_FOUND LOS_ERRNO_OS_ERROR(LOS_MOD_QUE, 0x05)
108
117#define LOS_ERRNO_QUEUE_PEND_IN_LOCK LOS_ERRNO_OS_ERROR(LOS_MOD_QUE, 0x06)
118
127#define LOS_ERRNO_QUEUE_TIMEOUT LOS_ERRNO_OS_ERROR(LOS_MOD_QUE, 0x07)
128
137#define LOS_ERRNO_QUEUE_IN_TSKUSE LOS_ERRNO_OS_ERROR(LOS_MOD_QUE, 0x08)
138
148#define LOS_ERRNO_QUEUE_WRITE_IN_INTERRUPT LOS_ERRNO_OS_ERROR(LOS_MOD_QUE, 0x09)
149
158#define LOS_ERRNO_QUEUE_NOT_CREATE LOS_ERRNO_OS_ERROR(LOS_MOD_QUE, 0x0a)
159
168#define LOS_ERRNO_QUEUE_IN_TSKWRITE LOS_ERRNO_OS_ERROR(LOS_MOD_QUE, 0x0b)
169
178#define LOS_ERRNO_QUEUE_CREAT_PTR_NULL LOS_ERRNO_OS_ERROR(LOS_MOD_QUE, 0x0c)
179
188#define LOS_ERRNO_QUEUE_PARA_ISZERO LOS_ERRNO_OS_ERROR(LOS_MOD_QUE, 0x0d)
189
198#define LOS_ERRNO_QUEUE_INVALID LOS_ERRNO_OS_ERROR(LOS_MOD_QUE, 0x0e)
199
208#define LOS_ERRNO_QUEUE_READ_PTR_NULL LOS_ERRNO_OS_ERROR(LOS_MOD_QUE, 0x0f)
209
218#define LOS_ERRNO_QUEUE_READSIZE_IS_INVALID LOS_ERRNO_OS_ERROR(LOS_MOD_QUE, 0x10)
219
228#define LOS_ERRNO_QUEUE_WRITE_PTR_NULL LOS_ERRNO_OS_ERROR(LOS_MOD_QUE, 0x12)
229
238#define LOS_ERRNO_QUEUE_WRITESIZE_ISZERO LOS_ERRNO_OS_ERROR(LOS_MOD_QUE, 0x13)
239
248#define LOS_ERRNO_QUEUE_WRITE_SIZE_TOO_BIG LOS_ERRNO_OS_ERROR(LOS_MOD_QUE, 0x15)
249
258#define LOS_ERRNO_QUEUE_ISFULL LOS_ERRNO_OS_ERROR(LOS_MOD_QUE, 0x16)
259
268#define LOS_ERRNO_QUEUE_PTR_NULL LOS_ERRNO_OS_ERROR(LOS_MOD_QUE, 0x17)
269
279#define LOS_ERRNO_QUEUE_READ_IN_INTERRUPT LOS_ERRNO_OS_ERROR(LOS_MOD_QUE, 0x18)
280
289#define LOS_ERRNO_QUEUE_MAIL_HANDLE_INVALID LOS_ERRNO_OS_ERROR(LOS_MOD_QUE, 0x19)
290
299#define LOS_ERRNO_QUEUE_MAIL_PTR_INVALID LOS_ERRNO_OS_ERROR(LOS_MOD_QUE, 0x1a)
300
309#define LOS_ERRNO_QUEUE_MAIL_FREE_ERROR LOS_ERRNO_OS_ERROR(LOS_MOD_QUE, 0x1b)
310
320#define LOS_ERRNO_QUEUE_ISEMPTY LOS_ERRNO_OS_ERROR(LOS_MOD_QUE, 0x1d)
321
330#define LOS_ERRNO_QUEUE_READ_SIZE_TOO_SMALL LOS_ERRNO_OS_ERROR(LOS_MOD_QUE, 0x1f)
331
355
356#ifdef LOSCFG_QUEUE_STATIC_ALLOCATION
361#define LOS_QUEUEMEM_SIZE(msgSize, len) ((len) * ((msgSize) + sizeof(UINT32)))
362
394extern UINT32 LOS_QueueCreateStatic(const CHAR *queueName,
395 UINT16 len,
396 UINT32 *queueId,
397 UINT32 flags,
398 UINT16 maxMsgSize,
399 VOID *queueMem,
400 UINT16 memSize);
401#endif
402
403#ifdef LOSCFG_QUEUE_DYNAMIC_ALLOCATION
432extern UINT32 LOS_QueueCreate(const CHAR *queueName,
433 UINT16 len,
434 UINT32 *queueId,
435 UINT32 flags,
436 UINT16 maxMsgSize);
437#endif
438
484 VOID *bufferAddr,
485 UINT32 *bufferSize,
486 UINT32 timeout);
487
532 VOID *bufferAddr,
533 UINT32 bufferSize,
534 UINT32 timeout);
535
582 VOID *bufferAddr,
583 UINT32 bufferSize,
584 UINT32 timeout);
585
631 VOID *bufferAddr,
632 UINT32 bufferSize,
633 UINT32 timeout);
634
680 VOID *bufferAddr,
681 UINT32 bufferSize,
682 UINT32 timeout);
683
729 VOID *bufferAddr,
730 UINT32 bufferSize,
731 UINT32 timeout);
732
762
786extern UINT32 LOS_QueueInfoGet(UINT32 queueId, QUEUE_INFO_S *queueInfo);
787
788#ifdef __cplusplus
789}
790#endif /* __cplusplus */
791
792#endif /* _LOS_QUEUE_H */
UINT32 LOS_QueueWriteHeadCopy(UINT32 queueId, void *bufferAddr, UINT32 bufferSize, UINT32 timeout)
Write data into a queue header.
UINT32 LOS_QueueWriteHead(UINT32 queueId, void *bufferAddr, UINT32 bufferSize, UINT32 timeout)
Write data into a queue header.
UINT32 LOS_QueueReadCopy(UINT32 queueId, void *bufferAddr, UINT32 *bufferSize, UINT32 timeout)
Read a queue.
UINT32 LOS_QueueWrite(UINT32 queueId, void *bufferAddr, UINT32 bufferSize, UINT32 timeout)
Write data into a queue.
UINT32 LOS_QueueInfoGet(UINT32 queueId, QUEUE_INFO_S *queueInfo)
Obtain queue information.
UINT32 LOS_QueueDelete(UINT32 queueId)
Delete a queue.
UINT32 LOS_QueueWriteCopy(UINT32 queueId, void *bufferAddr, UINT32 bufferSize, UINT32 timeout)
Write data into a queue.
UINT32 LOS_QueueRead(UINT32 queueId, void *bufferAddr, UINT32 bufferSize, UINT32 timeout)
Read a queue.
struct tagQueueInfo QUEUE_INFO_S
unsigned short UINT16
Definition los_typedef.h:51
unsigned long long UINT64
Definition los_typedef.h:72
#define VOID
Definition los_typedef.h:88
unsigned int UINT32
Definition los_typedef.h:52
char CHAR
Definition los_typedef.h:58
Definition los_queue.h:336
UINT64 uwWaitReadTask
Definition los_queue.h:344
UINT16 usQueueTail
Definition los_queue.h:341
UINT64 uwWaitMemTask
Definition los_queue.h:351
UINT16 usWritableCnt
Definition los_queue.h:342
UINT16 usQueueHead
Definition los_queue.h:340
UINT16 usQueueSize
Definition los_queue.h:339
UINT64 uwWaitWriteTask
Definition los_queue.h:349
UINT32 uwQueueID
Definition los_queue.h:337
UINT16 usQueueLen
Definition los_queue.h:338
UINT16 usReadableCnt
Definition los_queue.h:343