You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
software/kkk/los_queue.h

867 lines
41 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

/* ----------------------------------------------------------------------------
* Copyright (c) Huawei Technologies Co., Ltd. 2013-2019. All rights reserved.
* Description: Queue
* Author: Huawei LiteOS Team
* Create: 2013-01-01
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
* 3. Neither the name of the copyright holder nor the names of its contributors may be used
* to endorse or promote products derived from this software without specific prior written
* permission.
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* --------------------------------------------------------------------------- */
/**
* @defgroup los_queue Queue
* @ingroup kernel
*/
#ifndef _LOS_QUEUE_H
#define _LOS_QUEUE_H
#include "los_base.h"
#include "los_list.h"
#ifdef __cplusplus
#if __cplusplus
extern "C" {
#endif /* __cplusplus */
#endif /* __cplusplus */
/**
* @ingroup los_queue
* Queue error code: The maximum number of queue resources is configured to 0.
*
* Value: 0x02000600.
*
* Solution: Configure the maximum number of queue resources to be greater than 0. If queue
* modules are not used, set the configuration item for the tailoring of the maximum number
* of queue resources to NO.
* @deprecated This error code is obsolete since LiteOS 5.0.0.
*/
#define LOS_ERRNO_QUEUE_MAXNUM_ZERO LOS_ERRNO_OS_ERROR(LOS_MOD_QUE, 0x00)
/*<2A><><EFBFBD>Ķ<EFBFBD><C4B6><EFBFBD>ʹ<EFBFBD><CAB9><EFBFBD><EFBFBD> LOS_ERRNO_OS_ERROR <20><EFBFBD><EAA3AC>ָ<EFBFBD><D6B8><EFBFBD>˲<EFBFBD><CBB2><EFBFBD> LOS_MOD_QUE <20><> 0x00<30><30><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʋ⣬LOS_MOD_QUE <20><><EFBFBD><EFBFBD><EFBFBD>DZ<EFBFBD>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ص<EFBFBD>ģ<EFBFBD>
<EFBFBD>ú<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڱ<EFBFBD>ʾ<EFBFBD><EFBFBD><EFBFBD>е<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD><EFBFBD>Ĵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ĵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ط<EFBFBD><EFBFBD><EFBFBD><EFBFBD>塣*/
/**
* @ingroup los_queue
* Queue error code: The queue block memory fails to be initialized.
*
* Value: 0x02000601.
*
* Solution: Allocate the queue block bigger memory partition, or decrease the maximum
* number of queue resources.
*/
#define LOS_ERRNO_QUEUE_NO_MEMORY LOS_ERRNO_OS_ERROR(LOS_MOD_QUE, 0x01)
/*<2A><><EFBFBD>δ<EFBFBD><CEB4><EFBFBD><EBB6A8><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD>Ϊ LOS_ERRNO_QUEUE_NO_MEMORY <20>ĺ꣬<C4BA><EAA3AC><EFBFBD>ڱ<EFBFBD>ʾ<EFBFBD><CABE><EFBFBD>з<EFBFBD><D0B7><EFBFBD><EFBFBD>ڴ<EFBFBD>ʧ<EFBFBD><CAA7>ʱ<EFBFBD>Ĵ<EFBFBD><C4B4><EFBFBD><EFBFBD>
<EFBFBD><EFBFBD><EFBFBD>Ķ<EFBFBD><EFBFBD><EFBFBD>ʹ<EFBFBD><EFBFBD><EFBFBD><EFBFBD> LOS_ERRNO_OS_ERROR <20><EFBFBD><EAA3AC>ָ<EFBFBD><D6B8><EFBFBD>˲<EFBFBD><CBB2><EFBFBD> LOS_MOD_QUE <20><> 0x01<30><31><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʋ⣬LOS_MOD_QUE <20><><EFBFBD><EFBFBD><EFBFBD>DZ<EFBFBD>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ص<EFBFBD>ģ<EFBFBD>
<EFBFBD>ú<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڱ<EFBFBD>ʾ<EFBFBD><EFBFBD><EFBFBD>з<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڴ<EFBFBD>ʧ<EFBFBD>ܵĴ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ĵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ط<EFBFBD><EFBFBD><EFBFBD><EFBFBD>塣*/
/**
* @ingroup los_queue
* Queue error code: The memory for queue creation fails to be requested.
*
* Value: 0x02000602.
*
* Solution: Allocate more memory for queue creation, or decrease the queue length and
* the number of nodes in the queue to be created.
*/
#define LOS_ERRNO_QUEUE_CREATE_NO_MEMORY LOS_ERRNO_OS_ERROR(LOS_MOD_QUE, 0x02)
/*<2A><><EFBFBD>δ<EFBFBD><CEB4><EFBFBD><EBB6A8><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD>Ϊ LOS_ERRNO_QUEUE_CREATE_NO_MEMORY <20>ĺ꣬<C4BA><EAA3AC><EFBFBD>ڱ<EFBFBD>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD>ڴ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>ط<EFBFBD><EFBFBD><EFBFBD><EFBFBD>塣*/
/**
* @ingroup los_queue
* Queue error code: The size of the biggest message in the created queue is too big.
*
* Value: 0x02000603.
*
* Solution: Change the size of the biggest message in the created queue.
*/
#define LOS_ERRNO_QUEUE_SIZE_TOO_BIG LOS_ERRNO_OS_ERROR(LOS_MOD_QUE, 0x03)
/*<2A><><EFBFBD>Ķ<EFBFBD><C4B6><EFBFBD>ʹ<EFBFBD><CAB9><EFBFBD><EFBFBD> LOS_ERRNO_OS_ERROR <20><EFBFBD><EAA3AC>ָ<EFBFBD><D6B8><EFBFBD>˲<EFBFBD><CBB2><EFBFBD> LOS_MOD_QUE <20><> 0x00<30><30><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʋ⣬LOS_MOD_QUE <20><><EFBFBD><EFBFBD><EFBFBD>DZ<EFBFBD>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ص<EFBFBD>ģ<EFBFBD>
<20>ú<EFBFBD><C3BA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EBA3AC><EFBFBD>ڱ<EFBFBD>ʾ<EFBFBD><CABE><EFBFBD>е<EFBFBD><D0B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA><EFBFBD>Ĵ<EFBFBD><C4B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ĵ<EFBFBD><C4B4><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><D6B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ط<EFBFBD><D8B7><EFBFBD><EFBFBD>塣*/
/**
* @ingroup los_queue
* Queue error code: The upper limit of the number of created queues is exceeded.
*
* Value: 0x02000604.
*
* Solution: Increase the configured number of resources for queues.
*/
#define LOS_ERRNO_QUEUE_CB_UNAVAILABLE LOS_ERRNO_OS_ERROR(LOS_MOD_QUE, 0x04)
/*<2A><><EFBFBD>δ<EFBFBD><CEB4><EFBFBD><EBB6A8><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD>Ϊ LOS_ERRNO_QUEUE_NO_MEMORY <20>ĺ꣬<C4BA><EAA3AC><EFBFBD>ڱ<EFBFBD>ʾ<EFBFBD><CABE><EFBFBD>з<EFBFBD><D0B7><EFBFBD><EFBFBD>ڴ<EFBFBD>ʧ<EFBFBD><CAA7>ʱ<EFBFBD>Ĵ<EFBFBD><C4B4><EFBFBD><EFBFBD>
<20><><EFBFBD>Ķ<EFBFBD><C4B6><EFBFBD>ʹ<EFBFBD><CAB9><EFBFBD><EFBFBD> LOS_ERRNO_OS_ERROR <20><EFBFBD><EAA3AC>ָ<EFBFBD><D6B8><EFBFBD>˲<EFBFBD><CBB2><EFBFBD> LOS_MOD_QUE <20><> 0x01<30><31><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʋ⣬LOS_MOD_QUE <20><><EFBFBD><EFBFBD><EFBFBD>DZ<EFBFBD>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ص<EFBFBD>ģ<EFBFBD>
<20>ú<EFBFBD><C3BA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EBA3AC><EFBFBD>ڱ<EFBFBD>ʾ<EFBFBD><CABE><EFBFBD>з<EFBFBD><D0B7><EFBFBD><EFBFBD>ڴ<EFBFBD>ʧ<EFBFBD>ܵĴ<DCB5><C4B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ĵ<EFBFBD><C4B4><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><D6B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ط<EFBFBD><D8B7><EFBFBD><EFBFBD>塣*/
/**
* @ingroup los_queue
* Queue error code: Invalid queue.
*
* Value: 0x02000605.
*
* Solution: Ensure that the passed-in queue ID is valid.
*/
#define LOS_ERRNO_QUEUE_NOT_FOUND LOS_ERRNO_OS_ERROR(LOS_MOD_QUE, 0x05)
/**
* @ingroup los_queue
* Queue error code: The task is forbidden to be blocked on a queue when the task is locked.
*
* Value: 0x02000606.
*
* Solution: Unlock the task before using a queue.
*/
#define LOS_ERRNO_QUEUE_PEND_IN_LOCK LOS_ERRNO_OS_ERROR(LOS_MOD_QUE, 0x06)
/**
* @ingroup los_queue
* Queue error code: The time set for waiting to processing the queue expires.
*
* Value: 0x02000607.
*
* Solution: Check whether the expiry time setting is appropriate.
*/
#define LOS_ERRNO_QUEUE_TIMEOUT LOS_ERRNO_OS_ERROR(LOS_MOD_QUE, 0x07)
/**
* @ingroup los_queue
* Queue error code: The queue that blocks a task cannot be deleted.
*
* Value: 0x02000608.
*
* Solution: Enable the task to obtain resources rather than be blocked on the queue.
*/
#define LOS_ERRNO_QUEUE_IN_TSKUSE LOS_ERRNO_OS_ERROR(LOS_MOD_QUE, 0x08)
/**
* @ingroup los_queue
* Queue error code: The queue cannot be written during an interrupt when the time for
* waiting to processing the queue expires.
*
* Value: 0x02000609.
*
* Solution: Set the expiry time to the never-waiting mode, or use asynchronous queues.
*/
#define LOS_ERRNO_QUEUE_WRITE_IN_INTERRUPT LOS_ERRNO_OS_ERROR(LOS_MOD_QUE, 0x09)
/**
* @ingroup los_queue
* Queue error code: The queue is not created.
*
* Value: 0x0200060a.
*
* Solution: Check whether the passed-in queue handle value is valid.
*/
#define LOS_ERRNO_QUEUE_NOT_CREATE LOS_ERRNO_OS_ERROR(LOS_MOD_QUE, 0x0a)
/**
* @ingroup los_queue
* Queue error code: Queue reading and writing are not synchronous.
*
* Value: 0x0200060b.
*
* Solution: Synchronize queue reading with queue writing.
*/
#define LOS_ERRNO_QUEUE_IN_TSKWRITE LOS_ERRNO_OS_ERROR(LOS_MOD_QUE, 0x0b)
/**
* @ingroup los_queue
* Queue error code: Parameters passed in during queue creation are null pointers.
*
* Value: 0x0200060c.
*
* Solution: Ensure the passed-in parameters are not null pointers.
*/
#define LOS_ERRNO_QUEUE_CREAT_PTR_NULL LOS_ERRNO_OS_ERROR(LOS_MOD_QUE, 0x0c)
/**
* @ingroup los_queue
* Queue error code: The queue length or message node size passed in during queue creation is 0.
*
* Value: 0x0200060d.
*
* Solution: Pass in correct queue length and message node size.
*/
#define LOS_ERRNO_QUEUE_PARA_ISZERO LOS_ERRNO_OS_ERROR(LOS_MOD_QUE, 0x0d)
/**
* @ingroup los_queue
* Queue error code: The handle of the queue is invalid.
*
* Value: 0x0200060e.
*
* Solution: Check whether the passed-in queue handle value is valid.
*/
#define LOS_ERRNO_QUEUE_INVALID LOS_ERRNO_OS_ERROR(LOS_MOD_QUE, 0x0e)
/**
* @ingroup los_queue
* Queue error code: The pointer passed in during queue reading is null.
*
* Value: 0x0200060f.
*
* Solution: Check whether the passed-in pointer is null.
*/
#define LOS_ERRNO_QUEUE_READ_PTR_NULL LOS_ERRNO_OS_ERROR(LOS_MOD_QUE, 0x0f)
/**
* @ingroup los_queue
* Queue error code: The buffer size passed in during queue reading is too small or too big.
*
* Value: 0x02000610.
*
* Solution: Pass in a correct buffer size between [sizeof(CHAR*), OS_NULL_SHORT - sizeof(UINT32)].
*/
#define LOS_ERRNO_QUEUE_READSIZE_IS_INVALID LOS_ERRNO_OS_ERROR(LOS_MOD_QUE, 0x10)
/**
* @ingroup los_queue
* Queue error code: The pointer passed in during queue writing is null.
*
* Value: 0x02000612.
*
* Solution: Check whether the passed-in pointer is null.
*/
#define LOS_ERRNO_QUEUE_WRITE_PTR_NULL LOS_ERRNO_OS_ERROR(LOS_MOD_QUE, 0x12)
/**
* @ingroup los_queue
* Queue error code: The buffer size passed in during queue writing is 0.
*
* Value: 0x02000613.
*
* Solution: Pass in a correct buffer size.
*/
#define LOS_ERRNO_QUEUE_WRITESIZE_ISZERO LOS_ERRNO_OS_ERROR(LOS_MOD_QUE, 0x13)
/**
* @ingroup los_queue
* Queue error code: The buffer size passed in during queue writing is bigger than the queue size.
*
* Value: 0x02000615.
*
* Solution: Decrease the buffer size, or use a queue in which nodes are bigger.
*/
#define LOS_ERRNO_QUEUE_WRITE_SIZE_TOO_BIG LOS_ERRNO_OS_ERROR(LOS_MOD_QUE, 0x15)
/**
* @ingroup los_queue
* Queue error code: No free node is available during queue writing.
*
* Value: 0x02000616.
*
* Solution: Ensure that free nodes are available before queue writing.
*/
#define LOS_ERRNO_QUEUE_ISFULL LOS_ERRNO_OS_ERROR(LOS_MOD_QUE, 0x16)
/**
* @ingroup los_queue
* Queue error code: The pointer passed in when the queue information is being obtained is null.
*
* Value: 0x02000617.
*
* Solution: Check whether the passed-in pointer is null.
*/
#define LOS_ERRNO_QUEUE_PTR_NULL LOS_ERRNO_OS_ERROR(LOS_MOD_QUE, 0x17)
/**
* @ingroup los_queue
* Queue error code: The queue cannot be read during an interrupt
* when the time for waiting to processing the queue expires.
*
* Value: 0x02000618.
*
* Solution: Set the expiry time to the never-waiting mode, or use asynchronous queues.
*/
#define LOS_ERRNO_QUEUE_READ_IN_INTERRUPT LOS_ERRNO_OS_ERROR(LOS_MOD_QUE, 0x18)
/**
* @ingroup los_queue
* Queue error code: The handle of the queue passed-in when the memory for the queue is being freed is invalid.
*
* Value: 0x02000619.
*
* Solution: Check whether the passed-in queue handle value is valid.
*/
#define LOS_ERRNO_QUEUE_MAIL_HANDLE_INVALID LOS_ERRNO_OS_ERROR(LOS_MOD_QUE, 0x19)
/**
* @ingroup los_queue
* Queue error code: The pointer to the memory to be freed is null.
*
* Value: 0x0200061a.
*
* Solution: Check whether the passed-in pointer is null.
*/
#define LOS_ERRNO_QUEUE_MAIL_PTR_INVALID LOS_ERRNO_OS_ERROR(LOS_MOD_QUE, 0x1a)
/**
* @ingroup los_queue
* Queue error code: The memory for the queue fails to be freed.
*
* Value: 0x0200061b.
*
* Solution: Pass in correct input parameters.
*/
#define LOS_ERRNO_QUEUE_MAIL_FREE_ERROR LOS_ERRNO_OS_ERROR(LOS_MOD_QUE, 0x1b)
/**
* @ingroup los_queue
* Queue error code: No resource is in the queue that is being read when the
* time for waiting to processing the queue expires.
*
* Value: 0x0200061d.
*
* Solution: Ensure that the queue contains messages when it is being read.
*/
#define LOS_ERRNO_QUEUE_ISEMPTY LOS_ERRNO_OS_ERROR(LOS_MOD_QUE, 0x1d)
/**
* @ingroup los_queue
* Queue error code: The buffer size passed in during queue reading is smaller than the queue size.
*
* Value: 0x0200061f.
*
* Solution: Increase the buffer size, or use a queue in which nodes are smaller.
*/
#define LOS_ERRNO_QUEUE_READ_SIZE_TOO_SMALL LOS_ERRNO_OS_ERROR(LOS_MOD_QUE, 0x1f)
/**
* @ingroup los_queue
* Structure of the block for queue information query
*/
typedef struct tagQueueInfo {
UINT32 uwQueueID; /**< Queue ID */
UINT16 usQueueLen; /**< Queue length, that is the number of node in the queue */
UINT16 usQueueSize; /**< Node size in the queue */
UINT16 usQueueHead; /**< The position of queue header node, it is an array subscript */
UINT16 usQueueTail; /**< The position of queue tail node, it is an array subscript */
UINT16 usWritableCnt; /**< Count of writable resources */
UINT16 usReadableCnt; /**< Count of readable resources */
UINT64 uwWaitReadTask; /**< Tasks waiting for reading message. It is a 64-bit unsigned
integer, each bit represents a task ID. Therefore, 64 tasks
can be represented, and the maximum task ID is 63. For example,
0x0200060001002010 means there are 6 tasks whose IDs are 4,
13, 24, 41, 42, and 57. */
UINT64 uwWaitWriteTask; /**< Tasks waiting for writing message. It is a 64-bit unsigned
integer same with #uwWaitReadTask, each bit represents a task ID. */
UINT64 uwWaitMemTask; /**< Tasks waiting for memory used by the MailBox in the CMSIS-RTOS.
It is a 64-bit unsigned integer same with #uwWaitReadTask,
each bit represents a task ID. */
} QUEUE_INFO_S;
#ifdef LOSCFG_QUEUE_STATIC_ALLOCATION
/*<2A><><EFBFBD>δ<EFBFBD><CEB4><EFBFBD><EBB6A8><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD><E1B9B9> QUEUE_INFO_S<5F><53><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>У<EFBFBD>Queue<75><65><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2>
<EFBFBD><EFBFBD>Ա<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>£<EFBFBD>
uwQueueID<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ID<49><44>
usQueueLen<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>г<EFBFBD><EFBFBD>ȣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>нڵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
usQueueSize<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ÿ<EFBFBD><EFBFBD><EFBFBD>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ˣ<EFBFBD><CBA3><EFBFBD><EFBFBD>Ա<EFBFBD>ʾ 64 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ID <20><> 63<36><33>
uwWaitWriteTask<EFBFBD><EFBFBD><EFBFBD>ȴ<EFBFBD>д<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͬ uwWaitReadTask<73><6B>
uwWaitMemTask<EFBFBD><EFBFBD><EFBFBD>ȴ<EFBFBD><EFBFBD>ڴ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͬ uwWaitReadTask<73><6B>
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> LOSCFG_QUEUE_STATIC_ALLOCATION <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E5A3AC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E1B9B9><EFBFBD><EFBFBD><EFBFBD>ڶ<EFBFBD>̬<EFBFBD><CCAC><EFBFBD><EFBFBD><EFBFBD>ڴ<EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>á<EFBFBD>*/
/**
* @ingroup los_queue
* @brief Create a message queue.
*
* @par Description:
* This API is used to create a message queue by transferring the static memory for the queue.
* The input parameter "queueMem" is the pointer to the static memory the API can use directly.
* The input parameter "memSize" is the static memory size.
* @attention
* <ul>
* <li>Threre are LOSCFG_BASE_IPC_QUEUE_LIMIT queues available, change it's value when necessory.</li>
* <li>This function is defined only when LOSCFG_QUEUE_STATIC_ALLOCATION is defined.</li>
* </ul>
* @param queueName [IN] Message queue name. Reserved parameter, not used for now.
* @param len [IN] Queue length. The value range is [1,0xffff].
* @param queueId [OUT] ID of the queue control structure that is successfully created.
* @param flags [IN] Queue mode. Reserved parameter, not used for now.
* @param maxMsgSize [IN] Node size. The value range is [1,0xffff-4].
* @param queueMem [IN] Static queue memory. The value range is [0,0xffffffff].
* @param memSize [IN] Queue memory size. The value range is [1,0xffff-4].
* @retval #LOS_OK The message queue is successfully created.
* @retval #LOS_ERRNO_QUEUE_CB_UNAVAILABLE The upper limit of the number of created queues is exceeded.
* @retval #LOS_ERRNO_QUEUE_CREATE_NO_MEMORY Insufficient memory for queue creation.
* @retval #LOS_ERRNO_QUEUE_CREAT_PTR_NULL Null pointer, queueID is NULL.
* @retval #LOS_ERRNO_QUEUE_PARA_ISZERO The queue length or message node size passed in during queue
* creation is 0.
* @retval #LOS_ERRNO_QUEUE_SIZE_TOO_BIG The parameter maxMsgSize is larger than 0xffff - 4.
* @par Dependency:
* <ul><li>los_queue.h: the header file that contains the API declaration.</li></ul>
* @see LOS_QueueDelete | LOS_QueueCreate
* @since Huawei LiteOS V200R005C00
*/
extern UINT32 LOS_QueueCreateStatic(const CHAR *queueName,
UINT16 len,
UINT32 *queueId,
UINT32 flags,
UINT16 maxMsgSize,
VOID *queueMem,
UINT16 memSize);
#endif
/*<2A>ú<EFBFBD><C3BA><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ھ<EFBFBD>̬<EFBFBD><CCAC><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD><EFBFBD>У<EFBFBD>Queue<75><65><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>£<EFBFBD>
queueName<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>е<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ const CHAR*<2A><>
len<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>еij<EFBFBD><EFBFBD>ȣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>нڵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ UINT16<31><36>
queueId<EFBFBD><EFBFBD>ָ<EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD> UINT32 <20><><EFBFBD>͵<EFBFBD>ָ<EFBFBD><EFBFBD><EBA3AC><EFBFBD>ڴ洢<DAB4><E6B4A2><EFBFBD><EFBFBD><EFBFBD>õ<EFBFBD><C3B5>Ķ<EFBFBD><C4B6><EFBFBD> ID<49><44>
flags<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>еı<EFBFBD>־<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ UINT32<33><32>
maxMsgSize<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ÿ<EFBFBD><EFBFBD><EFBFBD>ڵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><EFBFBD>С<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ UINT16<31><36>
queueMem<EFBFBD><EFBFBD>ָ<EFBFBD><EFBFBD>Ԥ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ķ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڴ<EFBFBD><EFBFBD><EFBFBD>ָ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ VOID*<2A><>
memSize<EFBFBD><EFBFBD>Ԥ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ķ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڴ<EFBFBD><EFBFBD>Ĵ<EFBFBD>С<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ UINT16<31><36>
<EFBFBD>ú<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ԥ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ľ<EFBFBD>̬<EFBFBD>ڴ<EFBFBD><EFBFBD>ռ<EFBFBD><EFBFBD>ϴ<EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>У<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ض<EFBFBD><EFBFBD>е<EFBFBD> ID*/
/**
* @ingroup los_queue
* @brief Create a message queue.
*
* @par Description:
* This API is used to create a message queue. Different from LOS_QueueCreateStatic,
* the user does not need to transfer the queue memory. In the API, system allocated
* the queue memory automatically.
* @attention
* There are LOSCFG_BASE_IPC_QUEUE_LIMIT queues available, change it's value when necessary.
* @param queueName [IN] Message queue name. Reserved parameter, not used for now.
* @param len [IN] Queue length. The value range is [1,0xffff].
* @param queueId [OUT] ID of the queue control structure that is successfully created.
* @param flags [IN] Queue mode. Reserved parameter, not used for now.
* @param maxMsgSize [IN] Node size. The value range is [1,0xffff-4].
*
* @retval #LOS_OK The message queue is successfully created.
* @retval #LOS_ERRNO_QUEUE_CB_UNAVAILABLE The upper limit of the number of created queues is exceeded.
* @retval #LOS_ERRNO_QUEUE_CREATE_NO_MEMORY Insufficient memory for queue creation.
* @retval #LOS_ERRNO_QUEUE_CREAT_PTR_NULL Null pointer, queueId is NULL.
* @retval #LOS_ERRNO_QUEUE_PARA_ISZERO The queue length or message node size passed in during queue
* creation is 0.
* @retval #LOS_ERRNO_QUEUE_SIZE_TOO_BIG The parameter usMaxMsgSize is larger than 0xffff - 4.
* @par Dependency:
* <ul><li>los_queue.h: the header file that contains the API declaration.</li></ul>
* @see LOS_QueueDelete | LOS_QueueCreateStatic
* @since Huawei LiteOS V100R001C00
*/
extern UINT32 LOS_QueueCreate(const CHAR *queueName,
UINT16 len,
UINT32 *queueId,
UINT32 flags,
UINT16 maxMsgSize);
/*<2A>ú<EFBFBD><C3BA><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڶ<EFBFBD>̬<EFBFBD><CCAC><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD><EFBFBD>У<EFBFBD>Queue<75><65><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>£<EFBFBD>
queueName<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>е<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ const CHAR*<2A><>
len<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>еij<EFBFBD><EFBFBD>ȣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>нڵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ UINT16<31><36>
queueId<EFBFBD><EFBFBD>ָ<EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD> UINT32 <20><><EFBFBD>͵<EFBFBD>ָ<EFBFBD><EFBFBD><EBA3AC><EFBFBD>ڴ洢<DAB4><E6B4A2><EFBFBD><EFBFBD><EFBFBD>õ<EFBFBD><C3B5>Ķ<EFBFBD><C4B6><EFBFBD> ID<49><44>
flags<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>еı<EFBFBD>־<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ UINT32<33><32>
maxMsgSize<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ÿ<EFBFBD><EFBFBD><EFBFBD>ڵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><EFBFBD>С<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ UINT16<31><36>
<EFBFBD>ú<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD>̬<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڴ<EFBFBD><EFBFBD>ռ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>У<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ض<EFBFBD><EFBFBD>е<EFBFBD> ID<49><44>*/
/**
* @ingroup los_queue
* @brief Read a queue.
*
* @par Description:
* This API is used to read data in a specified queue, and store the obtained data to the address specified
* by bufferAddr. The address and the size of the data to be read are defined by users.
* @attention
* <ul>
* <li>The specific queue should be created firstly.</li>
* <li>Queue reading adopts the fist in first out (FIFO) mode. The data that is first stored in the queue is read
* first.</li>
* <li>bufferAddr stores the obtained data.</li>
* <li>Do not read or write a queue in unblocking modes such as an interrupt.</li>
* <li>This API cannot be called before the Huawei LiteOS is initialized.</li>
* <li>The argument timeout is a relative time.</li>
* <li>Do not call this API in software timer callback. </li>
* </ul>
*
* @param queueId [IN] Queue ID created by LOS_QueueCreate or LOS_QueueCreateStatic.
* The value range is [1,LOSCFG_BASE_IPC_QUEUE_LIMIT].
* @param bufferAddr [OUT] Starting address that stores the obtained data. The starting address must not be
* null.
* @param bufferSize [IN/OUT] Where to maintain the buffer wanted-size before read, and the real-size after read.
* @param timeout [IN] Expiry time. The value range is [0,LOS_WAIT_FOREVER](unit: Tick).
*
* @retval #LOS_OK The queue is successfully read.
* @retval #LOS_ERRNO_QUEUE_INVALID The handle of the queue that is being read is invalid.
* @retval #LOS_ERRNO_QUEUE_READ_PTR_NULL The pointer passed in during queue reading is null.
* @retval #LOS_ERRNO_QUEUE_READSIZE_IS_INVALID The buffer size passed in during queue reading is invalid.
* @retval #LOS_ERRNO_QUEUE_READ_IN_INTERRUPT The queue cannot be read during an interrupt when the time for
* waiting to processing the queue expires.
* @retval #LOS_ERRNO_QUEUE_NOT_CREATE The queue to be read is not created.
* @retval #LOS_ERRNO_QUEUE_ISEMPTY No resource is in the queue that is being read when the time for
* waiting to processing the queue expires.
* @retval #LOS_ERRNO_QUEUE_PEND_IN_LOCK The task is forbidden to be blocked on a queue when the task is
* locked.
* @retval #LOS_ERRNO_QUEUE_TIMEOUT The time set for waiting to processing the queue expires.
* @retval #LOS_ERRNO_QUEUE_READ_SIZE_TOO_SMALL The buffer size passed in during queue reading is less than
* the queue size.
* @par Dependency:
* <ul><li>los_queue.h: the header file that contains the API declaration.</li></ul>
* @see LOS_QueueWriteCopy | LOS_QueueWriteHeadCopy | LOS_QueueCreate | LOS_QueueCreateStatic
* @since Huawei LiteOS V100R001C00
*/
extern UINT32 LOS_QueueReadCopy(UINT32 queueId,
VOID *bufferAddr,
UINT32 *bufferSize,
UINT32 timeout);
/*<2A>ú<EFBFBD><C3BA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǴӶ<C7B4><D3B6><EFBFBD><EFBFBD>ж<EFBFBD>ȡ<EFBFBD><C8A1><EFBFBD>ݣ<EFBFBD><DDA3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݸ<EFBFBD><DDB8>Ƶ<EFBFBD>ָ<EFBFBD><D6B8><EFBFBD>Ļ<EFBFBD><C4BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>С<EFBFBD><D0A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD><C3BB><EFBFBD><EFBFBD><EFBFBD>ݿɶ<DDBF><C9B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݳ<EFBFBD>ʱʱ<CAB1><CAB1><EFBFBD>ȴ<EFBFBD><C8B4><EFBFBD><EFBFBD>ݿɶ<DDBF><C9B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڳ<EFBFBD>ʱʱ<CAB1><CAB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȼû<C8BB><C3BB><EFBFBD><EFBFBD><EFBFBD>ݿɶ<DDBF><C9B6><EFBFBD><EFBFBD>򷵻ش<F2B7B5BB><D8B4><EFBFBD><EFBFBD>롣*/
/**
* @ingroup los_queue
* @brief Write data into a queue.
*
* @par Description:
* This API is used to write the data of the size specified by bufferSize and stored at the address specified by
* bufferAddr into a queue.
* @attention
* <ul>
* <li>The specific queue should be created firstly.</li>
* <li>Do not read or write a queue in unblocking modes such as interrupt.</li>
* <li>This API cannot be called before the Huawei LiteOS is initialized.</li>
* <li>The data to be written is of the size specified by bufferSize and is stored at the address specified by
* bufferAddr.</li>
* <li>The argument timeout is a relative time.</li>
* <li>Do not call this API in software timer callback. </li>
* </ul>
*
* @param queueId [IN] Queue ID created by LOS_QueueCreate or LOS_QueueCreateStatic.
* The value range is [1,LOSCFG_BASE_IPC_QUEUE_LIMIT].
* @param bufferAddr [IN] Starting address that stores the data to be written.The starting address must
* not be null.
* @param bufferSize [IN] Passed-in buffer size. The value range is [1,USHRT_MAX - sizeof(UINT32)].
* @param timeout [IN] Expiry time. The value range is [0,LOS_WAIT_FOREVER](unit: Tick).
*
* @retval #LOS_OK The data is successfully written into the queue.
* @retval #LOS_ERRNO_QUEUE_INVALID The queue handle passed in during queue writing is invalid.
* @retval #LOS_ERRNO_QUEUE_WRITE_PTR_NULL The pointer passed in during queue writing is null.
* @retval #LOS_ERRNO_QUEUE_WRITESIZE_ISZERO The buffer size passed in during queue writing is 0.
* @retval #LOS_ERRNO_QUEUE_WRITE_IN_INTERRUPT The queue cannot be written during an interrupt when the time
* for waiting to processing the queue expires.
* @retval #LOS_ERRNO_QUEUE_NOT_CREATE The queue into which the data is written is not created.
* @retval #LOS_ERRNO_QUEUE_WRITE_SIZE_TOO_BIG The buffer size passed in during queue writing is bigger than
* the queue size.
* @retval #LOS_ERRNO_QUEUE_ISFULL No free node is available during queue writing.
* @retval #LOS_ERRNO_QUEUE_PEND_IN_LOCK The task is forbidden to be blocked on a queue when
* the task is locked.
* @retval #LOS_ERRNO_QUEUE_TIMEOUT The time set for waiting to processing the queue expires.
* @par Dependency:
* <ul><li>los_queue.h: the header file that contains the API declaration.</li></ul>
* @see LOS_QueueReadCopy | LOS_QueueWriteHeadCopy | LOS_QueueCreate | LOS_QueueCreateStatic
* @since Huawei LiteOS V100R001C00
*/
extern UINT32 LOS_QueueWriteCopy(UINT32 queueId,
VOID *bufferAddr,
UINT32 bufferSize,
UINT32 timeout);
/*<2A>ú<EFBFBD><C3BA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ָ<EFBFBD><D6B8><EFBFBD>Ķ<EFBFBD><C4B6><EFBFBD><EFBFBD><EFBFBD>д<EFBFBD><D0B4><EFBFBD><EFBFBD><EFBFBD>ݣ<EFBFBD><DDA3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>£<EFBFBD>
queueId<EFBFBD><EFBFBD>Ҫд<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݵĶ<EFBFBD><EFBFBD><EFBFBD> ID<49><44><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ UINT32<33><32>
bufferAddr<EFBFBD><EFBFBD>ָ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>д<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݵĻ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ VOID*<2A><>
bufferSize<EFBFBD><EFBFBD><EFBFBD><EFBFBD>д<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݵĴ<EFBFBD>С<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ UINT32<33><32>
timeout<EFBFBD><EFBFBD>д<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݵij<EFBFBD>ʱʱ<EFBFBD><EFBFBD><EFBFBD>λΪ Tick<63><6B><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ 0<><30><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ<EFBFBD><CABE><EFBFBD>ȴ<EFBFBD><C8B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ء<EFBFBD><D8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ LOS_WAIT_FOREVER<45><52><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾһֱ<D2BB>ȴ<EFBFBD><C8B4><EFBFBD>ֱ<EFBFBD><D6B1><EFBFBD>пռ<D0BF><D5BC><EFBFBD>д<EFBFBD><D0B4>Ϊֹ<CEAA><D6B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ UINT32<33><32>
<EFBFBD>ú<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>д<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݳ<EFBFBD>ʱʱ<EFBFBD><EFBFBD><EFBFBD>ȴ<EFBFBD><EFBFBD>ռ<EFBFBD><EFBFBD><EFBFBD>д<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڳ<EFBFBD>ʱʱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȼû<EFBFBD>пռ<EFBFBD><EFBFBD><EFBFBD>д<EFBFBD><EFBFBD>򷵻ش<EFBFBD><EFBFBD><EFBFBD><EFBFBD>롣*/
/**
* @ingroup los_queue
* @brief Read a queue.
*
* @par Description:
* This API is used to read the address of data in a specified queue, and store it to the address specified by
* bufferAddr.
* @attention
* <ul>
* <li>The specific queue should be created firstly.</li>
* <li>Queue reading adopts the fist in first out (FIFO) mode. The data that is first stored in the queue is
* read first.</li>
* <li>bufferAddr stores the obtained data address.</li>
* <li>Do not read or write a queue in unblocking modes such as an interrupt.</li>
* <li>This API cannot be called before the Huawei LiteOS is initialized.</li>
* <li>The argument timeout is a relative time.</li>
* <li>The bufferSize is not really used in LOS_QueueRead, because the interface is only used to
* obtain the address of data.</li>
* <li>The buffer which the bufferAddr pointing to must be greater than or equal to 4 bytes.</li>
* <li>Do not call this API in software timer callback. </li>
* </ul>
*
* @param queueId [IN] Queue ID created by LOS_QueueCreate or LOS_QueueCreateStatic.
* The value range is [1,LOSCFG_BASE_IPC_QUEUE_LIMIT].
* @param bufferAddr [OUT] Starting address that stores the obtained data. The starting address must
* not be null.
* @param bufferSize [IN] Passed-in buffer size,The value range is
* [sizeof(CHAR*),OS_NULL_SHORT - sizeof(UINT32)].
* @param timeout [IN] Expiry time. The value range is [0,LOS_WAIT_FOREVER](unit: Tick).
*
* @retval #LOS_OK The queue is successfully read.
* @retval #LOS_ERRNO_QUEUE_INVALID The handle of the queue that is being read is invalid.
* @retval #LOS_ERRNO_QUEUE_READ_PTR_NULL The pointer passed in during queue reading is null.
* @retval #LOS_ERRNO_QUEUE_READSIZE_IS_INVALID The buffer size passed in during queue reading is invalid.
* @retval #LOS_ERRNO_QUEUE_READ_IN_INTERRUPT The queue cannot be read during an interrupt when the time for
* waiting to processing the queue expires.
* @retval #LOS_ERRNO_QUEUE_NOT_CREATE The queue to be read is not created.
* @retval #LOS_ERRNO_QUEUE_ISEMPTY No resource is in the queue that is being read when the time for
* waiting to processing the queue expires.
* @retval #LOS_ERRNO_QUEUE_PEND_IN_LOCK The task is forbidden to be blocked on a queue when the task is
* locked.
* @retval #LOS_ERRNO_QUEUE_TIMEOUT The time set for waiting to processing the queue expires.
* @par Dependency:
* <ul><li>los_queue.h: The header file that contains the API declaration.</li></ul>
* @see LOS_QueueWrite | LOS_QueueWriteHead | LOS_QueueCreate | LOS_QueueCreateStatic
* @since Huawei LiteOS V100R001C00
*/
extern UINT32 LOS_QueueRead(UINT32 queueId,
VOID *bufferAddr,
UINT32 bufferSize,
UINT32 timeout);
/*<2A>ú<EFBFBD><C3BA><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڴ<EFBFBD>ָ<EFBFBD><D6B8><EFBFBD>Ķ<EFBFBD><C4B6><EFBFBD><EFBFBD>ж<EFBFBD>ȡ<EFBFBD><C8A1><EFBFBD>ݣ<EFBFBD><DDA3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>£<EFBFBD>
queueId<EFBFBD><EFBFBD>Ҫ<E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һֱ<D2BB>ȴ<EFBFBD><C8B4><EFBFBD>ֱ<EFBFBD><D6B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݿɶ<DDBF>Ϊֹ<CEAA><D6B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ UINT32<33><32>
<EFBFBD>ú<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǴӶ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ж<EFBFBD>ȡ<EFBFBD><EFBFBD><EFBFBD>ݲ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ָ<EFBFBD><EFBFBD><EFBFBD>Ļ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>С<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݿɶ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݳ<EFBFBD>ʱʱ<EFBFBD><EFBFBD><EFBFBD>ȴ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݿɶ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڳ<EFBFBD>ʱʱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȼû<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݿɶ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>򷵻ش<EFBFBD><EFBFBD><EFBFBD><EFBFBD>롣*/
/**
* @ingroup los_queue
* @brief Write data into a queue.
*
* @par Description:
* This API is used to write the address of data specified by bufferAddr into a queue.
* @attention
* <ul>
* <li>The specific queue should be created firstly.</li>
* <li>Do not read or write a queue in unblocking modes such as an interrupt.</li>
* <li>This API cannot be called before the Huawei LiteOS is initialized.</li>
* <li>The address of the data of the size specified by bufferSize and stored at the address specified by
* bufferAddr is to be written.</li>
* <li>The argument timeout is a relative time.</li>
* <li>The bufferSize is not really used in LOS_QueueWrite, because the interface is only used to write the address
* of data specified by bufferAddr into a queue.</li>
* <li>Do not call this API in software timer callback. </li>
* </ul>
*
* @param queueId [IN] Queue ID created by LOS_QueueCreate or LOS_QueueCreateStatic.
* The value range is [1,LOSCFG_BASE_IPC_QUEUE_LIMIT].
* @param bufferAddr [IN] Starting address that stores the data to be written. The starting address
* must not be null.
* @param bufferSize [IN] This parameter is not in use temporarily.
* @param timeout [IN] Expiry time. The value range is [0,LOS_WAIT_FOREVER](unit: Tick).
*
* @retval #LOS_OK The data is successfully written into the queue.
* @retval #LOS_ERRNO_QUEUE_INVALID The queue handle passed in during queue writing is invalid.
* @retval #LOS_ERRNO_QUEUE_WRITE_PTR_NULL The pointer passed in during queue writing is null.
* @retval #LOS_ERRNO_QUEUE_WRITESIZE_ISZERO The buffer size passed in during queue writing is 0.
* @retval #LOS_ERRNO_QUEUE_WRITE_IN_INTERRUPT The queue cannot be written during an interrupt when the time for
* waiting to processing the queue expires.
* @retval #LOS_ERRNO_QUEUE_NOT_CREATE The queue into which the data is written is not created.
* @retval #LOS_ERRNO_QUEUE_WRITE_SIZE_TOO_BIG The buffer size passed in during queue writing is bigger than
* the queue size.
* @retval #LOS_ERRNO_QUEUE_ISFULL No free node is available during queue writing.
* @retval #LOS_ERRNO_QUEUE_PEND_IN_LOCK The task is forbidden to be blocked on a queue when the task is
* locked.
* @retval #LOS_ERRNO_QUEUE_TIMEOUT The time set for waiting to processing the queue expires.
* @par Dependency:
* <ul><li>los_queue.h: The header file that contains the API declaration.</li></ul>
* @see LOS_QueueRead | LOS_QueueWriteHead | LOS_QueueCreate | LOS_QueueCreateStatic
* @since Huawei LiteOS V100R001C00
*/
extern UINT32 LOS_QueueWrite(UINT32 queueId,
VOID *bufferAddr,
UINT32 bufferSize,
UINT32 timeout);
/*<2A>ú<EFBFBD><C3BA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ָ<EFBFBD><D6B8><EFBFBD>Ķ<EFBFBD><C4B6><EFBFBD><EFBFBD><EFBFBD>д<EFBFBD><D0B4><EFBFBD><EFBFBD><EFBFBD>ݣ<EFBFBD><DDA3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>£<EFBFBD>
queueId<EFBFBD><EFBFBD>Ҫд<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݵĶ<EFBFBD><EFBFBD><EFBFBD> ID<49><44><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ UINT32<33><32>
bufferAddr<EFBFBD><EFBFBD>ָ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>д<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݵĻ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ VOID*<2A><>
bufferSize<EFBFBD><EFBFBD><EFBFBD><EFBFBD>д<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݵĴ<EFBFBD>С<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ UINT32<33><32>
timeout<EFBFBD><EFBFBD>д<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݵij<EFBFBD>ʱʱ<EFBFBD><EFBFBD><EFBFBD>λΪ Tick<63><6B><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ 0<><30><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ<EFBFBD><CABE><EFBFBD>ȴ<EFBFBD><C8B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ء<EFBFBD><D8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ LOS_WAIT_FOREVER<45><52><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾһֱ<D2BB>ȴ<EFBFBD><C8B4><EFBFBD>ֱ<EFBFBD><D6B1><EFBFBD>пռ<D0BF><D5BC><EFBFBD>д<EFBFBD><D0B4>Ϊֹ<CEAA><D6B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ UINT32<33><32>
<EFBFBD>ú<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>д<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݳ<EFBFBD>ʱʱ<EFBFBD><EFBFBD><EFBFBD>ȴ<EFBFBD><EFBFBD>ռ<EFBFBD><EFBFBD><EFBFBD>д<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڳ<EFBFBD>ʱʱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȼû<EFBFBD>пռ<EFBFBD><EFBFBD><EFBFBD>д<EFBFBD><EFBFBD>򷵻ش<EFBFBD><EFBFBD><EFBFBD><EFBFBD>롣*/
/**
* @ingroup los_queue
* @brief Write data into a queue header.
*
* @par Description:
* This API is used to write the data of the size specified by bufferSize and stored at the address specified by
* bufferAddr into a queue header.
* @attention
* <ul>
* <li>Do not read or write a queue in unblocking modes such as an interrupt.</li>
* <li>This API cannot be called before the Huawei LiteOS is initialized.</li>
* <li>The address of the data of the size specified by bufferSize and stored at the address specified by
* bufferAddr is to be written.</li>
* <li>The argument timeout is a relative time.</li>
* <li>LOS_QueueRead and LOS_QueueWriteHead are a set of interfaces, and the two groups of interfaces need to
* be used.</li>
* <li>Do not call this API in software timer callback. </li>
* </ul>
*
* @param queueId [IN] Queue ID created by LOS_QueueCreate or LOS_QueueCreateStatic.
* The value range is [1,LOSCFG_BASE_IPC_QUEUE_LIMIT].
* @param bufferAddr [OUT] Starting address that stores the data to be written. The starting address
* must not be null.
* @param bufferSize [IN] This parameter is not in use temporarily.
* @param timeout [IN] Expiry time. The value range is [0,LOS_WAIT_FOREVER](unit: Tick).
*
* @retval #LOS_OK The data is successfully written into the queue.
* @retval #LOS_ERRNO_QUEUE_INVALID The queue handle passed in during queue writing is invalid.
* @retval #LOS_ERRNO_QUEUE_WRITE_PTR_NULL The pointer passed in during queue writing is null.
* @retval #LOS_ERRNO_QUEUE_WRITESIZE_ISZERO The buffer size passed in during queue writing is 0.
* @retval #LOS_ERRNO_QUEUE_WRITE_IN_INTERRUPT The queue cannot be written during an interrupt when the time for
* waiting to processing the queue expires. waiting to processing the queue expires.
* @retval #LOS_ERRNO_QUEUE_NOT_CREATE The queue into which the data is written is not created.
* @retval #LOS_ERRNO_QUEUE_WRITE_SIZE_TOO_BIG The buffer size passed in during queue writing is bigger than
* the queue size.
* @retval #LOS_ERRNO_QUEUE_ISFULL No free node is available during queue writing.
* @retval #LOS_ERRNO_QUEUE_PEND_IN_LOCK The task is forbidden to be blocked on a queue when the task is
* locked.
* @retval #LOS_ERRNO_QUEUE_TIMEOUT The time set for waiting to processing the queue expires.
* @par Dependency:
* <ul><li>los_queue.h: The header file that contains the API declaration.</li></ul>
* @see LOS_QueueWrite | LOS_QueueRead | LOS_QueueCreate | LOS_QueueCreateStatic
* @since Huawei LiteOS V100R001C00
*/
extern UINT32 LOS_QueueWriteHead(UINT32 queueId,
VOID *bufferAddr,
UINT32 bufferSize,
UINT32 timeout);
/*<2A>ú<EFBFBD><C3BA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ָ<EFBFBD><D6B8><EFBFBD><EFBFBD><EFBFBD>еĶ<D0B5><C4B6><EFBFBD>д<EFBFBD><D0B4><EFBFBD><EFBFBD><EFBFBD>ݣ<EFBFBD><DDA3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>£<EFBFBD>
queueId<EFBFBD><EFBFBD>Ҫд<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݵĶ<EFBFBD><EFBFBD><EFBFBD> ID<49><44><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ UINT32<33><32>
bufferAddr<EFBFBD><EFBFBD>ָ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>д<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݵĻ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ VOID*<2A><>
bufferSize<EFBFBD><EFBFBD><EFBFBD><EFBFBD>д<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݵĴ<EFBFBD>С<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ UINT32<33><32>
timeout<EFBFBD><EFBFBD>д<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݵij<EFBFBD>ʱʱ<EFBFBD><EFBFBD><EFBFBD>λΪ Tick<63><6B><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ 0<><30><E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FBFBD><EFBFBD><EFBFBD>ݵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>׿<EFBFBD><EFBFBD>ܻᵼ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ԭ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*/
/**
* @ingroup los_queue
* @brief Write data into a queue header.
*
* @par Description:
* This API is used to write the data of the size specified by bufferSize and stored at the address specified by
* bufferAddr into a queue header.
* @attention
* <ul>
* <li>Do not read or write a queue in unblocking modes such as an interrupt.</li>
* <li>This API cannot be called before the Huawei LiteOS is initialized.</li>
* <li>The address of the data of the size specified by bufferSize and stored at the address specified by
* bufferAddr is to be written.</li>
* <li>The argument timeout is a relative time.</li>
* <li>LOS_QueueRead and LOS_QueueWriteHead are a set of interfaces, and the two groups of interfaces need to be
* used.</li>
* <li>Do not call this API in software timer callback. </li>
* </ul>
*
* @param queueId [IN] Queue ID created by LOS_QueueCreate or LOS_QueueCreateStatic.
* The value range is [1,LOSCFG_BASE_IPC_QUEUE_LIMIT].
* @param bufferAddr [OUT] Starting address that stores the data to be written.
* The starting address must not be null.
* @param bufferSize [IN] Passed-in buffer size, which must not be 0. The value range is [1,0xffffffff].
* @param timeout [IN] Expiry time. The value range is [0,LOS_WAIT_FOREVER](unit: Tick).
*
* @retval #LOS_OK The data is successfully written into the queue.
* @retval #LOS_ERRNO_QUEUE_INVALID The queue handle passed in during queue writing is invalid.
* @retval #LOS_ERRNO_QUEUE_WRITE_PTR_NULL The pointer passed in during queue writing is null.
* @retval #LOS_ERRNO_QUEUE_WRITESIZE_ISZERO The buffer size passed in during queue writing is 0.
* @retval #LOS_ERRNO_QUEUE_WRITE_IN_INTERRUPT The queue cannot be written during an interrupt when the time for
* waiting to processing the queue expires.
* @retval #LOS_ERRNO_QUEUE_NOT_CREATE The queue into which the data is written is not created.
* @retval #LOS_ERRNO_QUEUE_WRITE_SIZE_TOO_BIG The buffer size passed in during queue writing is bigger than
* the queue size.
* @retval #LOS_ERRNO_QUEUE_ISFULL No free node is available during queue writing.
* @retval #LOS_ERRNO_QUEUE_PEND_IN_LOCK The task is forbidden to be blocked on a queue when the task is
* locked.
* @retval #LOS_ERRNO_QUEUE_TIMEOUT The time set for waiting to processing the queue expires.
* @par Dependency:
* <ul><li>los_queue.h: The header file that contains the API declaration.</li></ul>
* @see LOS_QueueWriteCopy | LOS_QueueReadCopy
* @since Huawei LiteOS V100R001C00
*/
extern UINT32 LOS_QueueWriteHeadCopy(UINT32 queueId,
VOID *bufferAddr,
UINT32 bufferSize,
UINT32 timeout);
/**
* @ingroup los_queue
* @brief Delete a queue.
*
* @par Description:
* This API is used to delete a queue.
* @attention
* <ul>
* <li>This API cannot be used to delete a queue that is not created.</li>
* <li>A synchronous queue fails to be deleted if any tasks are blocked on it, or some queues are being read or
* written.</li>
* </ul>
*
* @param queueId [IN] Queue ID created by LOS_QueueCreate or LOS_QueueCreateStatic.
* The value range is [1,LOSCFG_BASE_IPC_QUEUE_LIMIT].
*
* @retval #LOS_OK The queue is successfully deleted.
* @retval #LOS_NOK Failed to release the queue memory.
* @retval #LOS_ERRNO_QUEUE_NOT_FOUND The queue cannot be found.
* @retval #LOS_ERRNO_QUEUE_NOT_CREATE The queue handle passed in when the queue is being deleted is
* incorrect.
* @retval #LOS_ERRNO_QUEUE_IN_TSKUSE The queue that blocks a task cannot be deleted.
* @retval #LOS_ERRNO_QUEUE_IN_TSKWRITE Queue reading and writing are not synchronous.
* @par Dependency:
* <ul><li>los_queue.h: the header file that contains the API declaration.</li></ul>
* @see LOS_QueueCreate | LOS_QueueCreateStatic
* @since Huawei LiteOS V100R001C00
*/
extern UINT32 LOS_QueueDelete(UINT32 queueId);
/**
* @ingroup los_queue
* @brief Obtain queue information.
*
* @par Description:
* This API is used to obtain queue information.
* @attention
* The specific queue should be created firstly before getting the queue information.
* @param queueId [IN] Queue ID created by LOS_QueueCreate or LOS_QueueCreateStatic.
* The value range is [1,LOSCFG_BASE_IPC_QUEUE_LIMIT].
* @param queueInfo [OUT] The queue information to be read must not be null.
*
* @retval #LOS_OK The queue information is successfully obtained.
* @retval #LOS_ERRNO_QUEUE_PTR_NULL The pointer to the queue information to be obtained is null.
* @retval #LOS_ERRNO_QUEUE_INVALID The handle of the queue that is being read is invalid.
* @retval #LOS_ERRNO_QUEUE_NOT_CREATE The queue in which the information to be obtained is stored is
* not created.
*
* @par Dependency:
* <ul><li>los_queue.h: the header file that contains the API declaration.</li></ul>
* @see LOS_QueueCreate | LOS_QueueCreateStatic
* @since Huawei LiteOS V100R001C00
*/
extern UINT32 LOS_QueueInfoGet(UINT32 queueId, QUEUE_INFO_S *queueInfo);
#ifdef __cplusplus
#if __cplusplus
}
#endif /* __cplusplus */
#endif /* __cplusplus */
#endif /* _LOS_QUEUE_H */