|
|
@ -25,7 +25,7 @@
|
|
|
|
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
|
|
|
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
|
|
|
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
* --------------------------------------------------------------------------- */
|
|
|
|
* --------------------------------------------------------------------------- */
|
|
|
|
|
|
|
|
/*该函数定义了一些任务错误情况以及一些关于任务处理的函数*/
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* @defgroup los_task Task
|
|
|
|
* @defgroup los_task Task
|
|
|
|
* @ingroup kernel
|
|
|
|
* @ingroup kernel
|
|
|
@ -58,7 +58,7 @@ extern "C" {
|
|
|
|
* automatically after the task is done.
|
|
|
|
* automatically after the task is done.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
#define LOS_TASK_STATUS_DETACHED 0x0100U
|
|
|
|
#define LOS_TASK_STATUS_DETACHED 0x0100U
|
|
|
|
|
|
|
|
/*LOS_TASK_STATUS_DETACHED是一个任务或者任务控制块状态的标志位。它表示任务处于自动删除状态。在这个状态下,任务会在执行完毕后自动被删除*/
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* @ingroup los_task
|
|
|
|
* @ingroup los_task
|
|
|
|
* Task error code: Insufficient memory for task creation.
|
|
|
|
* Task error code: Insufficient memory for task creation.
|
|
|
@ -68,7 +68,7 @@ extern "C" {
|
|
|
|
* Solution: Allocate bigger memory partition to task creation.
|
|
|
|
* Solution: Allocate bigger memory partition to task creation.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
#define LOS_ERRNO_TSK_NO_MEMORY LOS_ERRNO_OS_FATAL(LOS_MOD_TSK, 0x00)
|
|
|
|
#define LOS_ERRNO_TSK_NO_MEMORY LOS_ERRNO_OS_FATAL(LOS_MOD_TSK, 0x00)
|
|
|
|
|
|
|
|
/*任务错误代码:内存不足,无法创建任务。*/
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* @ingroup los_task
|
|
|
|
* @ingroup los_task
|
|
|
|
* Task error code: Null parameter.
|
|
|
|
* Task error code: Null parameter.
|
|
|
@ -78,7 +78,7 @@ extern "C" {
|
|
|
|
* Solution: Check the parameter.
|
|
|
|
* Solution: Check the parameter.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
#define LOS_ERRNO_TSK_PTR_NULL LOS_ERRNO_OS_ERROR(LOS_MOD_TSK, 0x01)
|
|
|
|
#define LOS_ERRNO_TSK_PTR_NULL LOS_ERRNO_OS_ERROR(LOS_MOD_TSK, 0x01)
|
|
|
|
|
|
|
|
/*任务错误代码:参数为Null*/
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* @ingroup los_task
|
|
|
|
* @ingroup los_task
|
|
|
|
* Task error code: The task stack is not aligned.
|
|
|
|
* Task error code: The task stack is not aligned.
|
|
|
@ -88,7 +88,7 @@ extern "C" {
|
|
|
|
* Solution: Align the task stack.
|
|
|
|
* Solution: Align the task stack.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
#define LOS_ERRNO_TSK_STKSZ_NOT_ALIGN LOS_ERRNO_OS_ERROR(LOS_MOD_TSK, 0x02)
|
|
|
|
#define LOS_ERRNO_TSK_STKSZ_NOT_ALIGN LOS_ERRNO_OS_ERROR(LOS_MOD_TSK, 0x02)
|
|
|
|
|
|
|
|
/*任务错误代码:任务堆栈未对齐*/
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* @ingroup los_task
|
|
|
|
* @ingroup los_task
|
|
|
|
* Task error code: Incorrect task priority.
|
|
|
|
* Task error code: Incorrect task priority.
|
|
|
@ -98,7 +98,7 @@ extern "C" {
|
|
|
|
* Solution: Re-configure the task priority by referring to the priority range.
|
|
|
|
* Solution: Re-configure the task priority by referring to the priority range.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
#define LOS_ERRNO_TSK_PRIOR_ERROR LOS_ERRNO_OS_ERROR(LOS_MOD_TSK, 0x03)
|
|
|
|
#define LOS_ERRNO_TSK_PRIOR_ERROR LOS_ERRNO_OS_ERROR(LOS_MOD_TSK, 0x03)
|
|
|
|
|
|
|
|
/*任务错误代码:任务优先级不正确*/
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* @ingroup los_task
|
|
|
|
* @ingroup los_task
|
|
|
|
* Task error code: The task entrance is NULL.
|
|
|
|
* Task error code: The task entrance is NULL.
|
|
|
@ -108,7 +108,7 @@ extern "C" {
|
|
|
|
* Solution: Define the task entrance function.
|
|
|
|
* Solution: Define the task entrance function.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
#define LOS_ERRNO_TSK_ENTRY_NULL LOS_ERRNO_OS_ERROR(LOS_MOD_TSK, 0x04)
|
|
|
|
#define LOS_ERRNO_TSK_ENTRY_NULL LOS_ERRNO_OS_ERROR(LOS_MOD_TSK, 0x04)
|
|
|
|
|
|
|
|
/*任务错误代码:任务入口为NULL*/
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* @ingroup los_task
|
|
|
|
* @ingroup los_task
|
|
|
|
* Task error code: The task name is NULL.
|
|
|
|
* Task error code: The task name is NULL.
|
|
|
@ -118,7 +118,7 @@ extern "C" {
|
|
|
|
* Solution: Set the task name.
|
|
|
|
* Solution: Set the task name.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
#define LOS_ERRNO_TSK_NAME_EMPTY LOS_ERRNO_OS_ERROR(LOS_MOD_TSK, 0x05)
|
|
|
|
#define LOS_ERRNO_TSK_NAME_EMPTY LOS_ERRNO_OS_ERROR(LOS_MOD_TSK, 0x05)
|
|
|
|
|
|
|
|
/*任务错误代码:任务名称为NULL*/
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* @ingroup los_task
|
|
|
|
* @ingroup los_task
|
|
|
|
* Task error code: The task stack size is too small.
|
|
|
|
* Task error code: The task stack size is too small.
|
|
|
@ -128,7 +128,7 @@ extern "C" {
|
|
|
|
* Solution: Expand the task stack.
|
|
|
|
* Solution: Expand the task stack.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
#define LOS_ERRNO_TSK_STKSZ_TOO_SMALL LOS_ERRNO_OS_ERROR(LOS_MOD_TSK, 0x06)
|
|
|
|
#define LOS_ERRNO_TSK_STKSZ_TOO_SMALL LOS_ERRNO_OS_ERROR(LOS_MOD_TSK, 0x06)
|
|
|
|
|
|
|
|
/*任务错误代码:任务堆栈太小*/
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* @ingroup los_task
|
|
|
|
* @ingroup los_task
|
|
|
|
* Task error code: Invalid task ID.
|
|
|
|
* Task error code: Invalid task ID.
|
|
|
@ -138,7 +138,7 @@ extern "C" {
|
|
|
|
* Solution: Check the task ID.
|
|
|
|
* Solution: Check the task ID.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
#define LOS_ERRNO_TSK_ID_INVALID LOS_ERRNO_OS_ERROR(LOS_MOD_TSK, 0x07)
|
|
|
|
#define LOS_ERRNO_TSK_ID_INVALID LOS_ERRNO_OS_ERROR(LOS_MOD_TSK, 0x07)
|
|
|
|
|
|
|
|
/*任务错误代码:任务ID无效*/
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* @ingroup los_task
|
|
|
|
* @ingroup los_task
|
|
|
|
* Task error code: The task is already suspended.
|
|
|
|
* Task error code: The task is already suspended.
|
|
|
@ -148,7 +148,7 @@ extern "C" {
|
|
|
|
* Solution: Suspend the task after it is resumed.
|
|
|
|
* Solution: Suspend the task after it is resumed.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
#define LOS_ERRNO_TSK_ALREADY_SUSPENDED LOS_ERRNO_OS_ERROR(LOS_MOD_TSK, 0x08)
|
|
|
|
#define LOS_ERRNO_TSK_ALREADY_SUSPENDED LOS_ERRNO_OS_ERROR(LOS_MOD_TSK, 0x08)
|
|
|
|
|
|
|
|
/*任务错误代码:任务已挂起*/
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* @ingroup los_task
|
|
|
|
* @ingroup los_task
|
|
|
|
* Task error code: The task is not suspended.
|
|
|
|
* Task error code: The task is not suspended.
|
|
|
@ -158,7 +158,7 @@ extern "C" {
|
|
|
|
* Solution: Suspend the task.
|
|
|
|
* Solution: Suspend the task.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
#define LOS_ERRNO_TSK_NOT_SUSPENDED LOS_ERRNO_OS_ERROR(LOS_MOD_TSK, 0x09)
|
|
|
|
#define LOS_ERRNO_TSK_NOT_SUSPENDED LOS_ERRNO_OS_ERROR(LOS_MOD_TSK, 0x09)
|
|
|
|
|
|
|
|
/*任务错误代码:任务未挂起*/
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* @ingroup los_task
|
|
|
|
* @ingroup los_task
|
|
|
|
* Task error code: The task is not created.
|
|
|
|
* Task error code: The task is not created.
|
|
|
@ -168,7 +168,7 @@ extern "C" {
|
|
|
|
* Solution: Create the task.
|
|
|
|
* Solution: Create the task.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
#define LOS_ERRNO_TSK_NOT_CREATED LOS_ERRNO_OS_ERROR(LOS_MOD_TSK, 0x0a)
|
|
|
|
#define LOS_ERRNO_TSK_NOT_CREATED LOS_ERRNO_OS_ERROR(LOS_MOD_TSK, 0x0a)
|
|
|
|
|
|
|
|
/*任务错误代码:未创建任务*/
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* @ingroup los_task
|
|
|
|
* @ingroup los_task
|
|
|
|
* Task error code: The task is locked when it is being deleted.
|
|
|
|
* Task error code: The task is locked when it is being deleted.
|
|
|
@ -178,7 +178,7 @@ extern "C" {
|
|
|
|
* Solution: Unlock the task.
|
|
|
|
* Solution: Unlock the task.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
#define LOS_ERRNO_TSK_DELETE_LOCKED LOS_ERRNO_OS_FATAL(LOS_MOD_TSK, 0x0b)
|
|
|
|
#define LOS_ERRNO_TSK_DELETE_LOCKED LOS_ERRNO_OS_FATAL(LOS_MOD_TSK, 0x0b)
|
|
|
|
|
|
|
|
/*任务错误代码:删除任务时该任务被锁定*/
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* @ingroup los_task
|
|
|
|
* @ingroup los_task
|
|
|
|
* Task error code: The task message is nonzero.
|
|
|
|
* Task error code: The task message is nonzero.
|
|
|
@ -189,7 +189,7 @@ extern "C" {
|
|
|
|
* @deprecated This error code is obsolete since LiteOS 5.0.0.
|
|
|
|
* @deprecated This error code is obsolete since LiteOS 5.0.0.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
#define LOS_ERRNO_TSK_MSG_NONZERO LOS_ERRNO_OS_ERROR(LOS_MOD_TSK, 0x0c)
|
|
|
|
#define LOS_ERRNO_TSK_MSG_NONZERO LOS_ERRNO_OS_ERROR(LOS_MOD_TSK, 0x0c)
|
|
|
|
|
|
|
|
/*任务错误代码:任务消息为非零*/
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* @ingroup los_task
|
|
|
|
* @ingroup los_task
|
|
|
|
* Task error code: The task delay occurs during an interrupt.
|
|
|
|
* Task error code: The task delay occurs during an interrupt.
|
|
|
@ -199,7 +199,7 @@ extern "C" {
|
|
|
|
* Solution: Perform this operation after exiting from the interrupt.
|
|
|
|
* Solution: Perform this operation after exiting from the interrupt.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
#define LOS_ERRNO_TSK_DELAY_IN_INT LOS_ERRNO_OS_FATAL(LOS_MOD_TSK, 0x0d)
|
|
|
|
#define LOS_ERRNO_TSK_DELAY_IN_INT LOS_ERRNO_OS_FATAL(LOS_MOD_TSK, 0x0d)
|
|
|
|
|
|
|
|
/*任务错误代码:任务延迟发生在中断期间*/
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* @ingroup los_task
|
|
|
|
* @ingroup los_task
|
|
|
|
* Task error code: The task delay occurs when the task is locked.
|
|
|
|
* Task error code: The task delay occurs when the task is locked.
|
|
|
@ -209,7 +209,7 @@ extern "C" {
|
|
|
|
* Solution: Perform this operation after unlocking the task.
|
|
|
|
* Solution: Perform this operation after unlocking the task.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
#define LOS_ERRNO_TSK_DELAY_IN_LOCK LOS_ERRNO_OS_ERROR(LOS_MOD_TSK, 0x0e)
|
|
|
|
#define LOS_ERRNO_TSK_DELAY_IN_LOCK LOS_ERRNO_OS_ERROR(LOS_MOD_TSK, 0x0e)
|
|
|
|
|
|
|
|
/*任务错误代码:任务锁定时会出现任务延迟*/
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* @ingroup los_task
|
|
|
|
* @ingroup los_task
|
|
|
|
* Task error code: The task yield occurs when the task is locked.
|
|
|
|
* Task error code: The task yield occurs when the task is locked.
|
|
|
@ -219,7 +219,7 @@ extern "C" {
|
|
|
|
* Solution: Check the task.
|
|
|
|
* Solution: Check the task.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
#define LOS_ERRNO_TSK_YIELD_IN_LOCK LOS_ERRNO_OS_ERROR(LOS_MOD_TSK, 0x0f)
|
|
|
|
#define LOS_ERRNO_TSK_YIELD_IN_LOCK LOS_ERRNO_OS_ERROR(LOS_MOD_TSK, 0x0f)
|
|
|
|
|
|
|
|
/*任务错误代码:当任务被锁定时,任务将产生收益*/
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* @ingroup los_task
|
|
|
|
* @ingroup los_task
|
|
|
|
* Task error code: Only one task or no task is available for scheduling.
|
|
|
|
* Task error code: Only one task or no task is available for scheduling.
|
|
|
@ -229,7 +229,7 @@ extern "C" {
|
|
|
|
* Solution: Increase the number of tasks.
|
|
|
|
* Solution: Increase the number of tasks.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
#define LOS_ERRNO_TSK_YIELD_NOT_ENOUGH_TASK LOS_ERRNO_OS_ERROR(LOS_MOD_TSK, 0x10)
|
|
|
|
#define LOS_ERRNO_TSK_YIELD_NOT_ENOUGH_TASK LOS_ERRNO_OS_ERROR(LOS_MOD_TSK, 0x10)
|
|
|
|
|
|
|
|
/*任务错误代码:只有一个任务或没有任务可用于计划*/
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* @ingroup los_task
|
|
|
|
* @ingroup los_task
|
|
|
|
* Task error code: No free task control block is available.
|
|
|
|
* Task error code: No free task control block is available.
|
|
|
@ -239,7 +239,7 @@ extern "C" {
|
|
|
|
* Solution: Increase the number of task control blocks.
|
|
|
|
* Solution: Increase the number of task control blocks.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
#define LOS_ERRNO_TSK_TCB_UNAVAILABLE LOS_ERRNO_OS_ERROR(LOS_MOD_TSK, 0x11)
|
|
|
|
#define LOS_ERRNO_TSK_TCB_UNAVAILABLE LOS_ERRNO_OS_ERROR(LOS_MOD_TSK, 0x11)
|
|
|
|
|
|
|
|
/*任务错误代码:没有可用的任务控制块*/
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* @ingroup los_task
|
|
|
|
* @ingroup los_task
|
|
|
|
* Task error code: The task hook function is not matchable.
|
|
|
|
* Task error code: The task hook function is not matchable.
|
|
|
@ -250,7 +250,7 @@ extern "C" {
|
|
|
|
* @deprecated This error code is obsolete since LiteOS 5.0.0.
|
|
|
|
* @deprecated This error code is obsolete since LiteOS 5.0.0.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
#define LOS_ERRNO_TSK_HOOK_NOT_MATCH LOS_ERRNO_OS_ERROR(LOS_MOD_TSK, 0x12)
|
|
|
|
#define LOS_ERRNO_TSK_HOOK_NOT_MATCH LOS_ERRNO_OS_ERROR(LOS_MOD_TSK, 0x12)
|
|
|
|
|
|
|
|
/*任务错误代码:任务挂钩函数不匹配*/
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* @ingroup los_task
|
|
|
|
* @ingroup los_task
|
|
|
|
* Task error code: The number of task hook functions exceeds the permitted upper limit.
|
|
|
|
* Task error code: The number of task hook functions exceeds the permitted upper limit.
|
|
|
@ -261,7 +261,7 @@ extern "C" {
|
|
|
|
* @deprecated This error code is obsolete since LiteOS 5.0.0.
|
|
|
|
* @deprecated This error code is obsolete since LiteOS 5.0.0.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
#define LOS_ERRNO_TSK_HOOK_IS_FULL LOS_ERRNO_OS_ERROR(LOS_MOD_TSK, 0x13)
|
|
|
|
#define LOS_ERRNO_TSK_HOOK_IS_FULL LOS_ERRNO_OS_ERROR(LOS_MOD_TSK, 0x13)
|
|
|
|
|
|
|
|
/*任务错误代码:任务挂钩函数的数量超过了允许的上限*/
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* @ingroup los_task
|
|
|
|
* @ingroup los_task
|
|
|
|
* Task error code: The operation is performed on the system-level task.
|
|
|
|
* Task error code: The operation is performed on the system-level task.
|
|
|
@ -272,7 +272,8 @@ extern "C" {
|
|
|
|
* Solution: Check the task ID and do not operate the system-level task.
|
|
|
|
* Solution: Check the task ID and do not operate the system-level task.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
#define LOS_ERRNO_TSK_OPERATE_SYSTEM_TASK LOS_ERRNO_OS_ERROR(LOS_MOD_TSK, 0x14)
|
|
|
|
#define LOS_ERRNO_TSK_OPERATE_SYSTEM_TASK LOS_ERRNO_OS_ERROR(LOS_MOD_TSK, 0x14)
|
|
|
|
|
|
|
|
/*任务错误代码:该操作是在系统级任务上执行的。
|
|
|
|
|
|
|
|
*旧用法:该操作在空闲任务上执行(LOS_ERRNO_TSK_OPERATE_idle)*/
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* @ingroup los_task
|
|
|
|
* @ingroup los_task
|
|
|
|
* Task error code: The task that is being suspended is locked.
|
|
|
|
* Task error code: The task that is being suspended is locked.
|
|
|
@ -282,7 +283,7 @@ extern "C" {
|
|
|
|
* Solution: Suspend the task after unlocking the task.
|
|
|
|
* Solution: Suspend the task after unlocking the task.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
#define LOS_ERRNO_TSK_SUSPEND_LOCKED LOS_ERRNO_OS_FATAL(LOS_MOD_TSK, 0x15)
|
|
|
|
#define LOS_ERRNO_TSK_SUSPEND_LOCKED LOS_ERRNO_OS_FATAL(LOS_MOD_TSK, 0x15)
|
|
|
|
|
|
|
|
/*任务错误代码:正在挂起的任务已锁定*/
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* @ingroup los_task
|
|
|
|
* @ingroup los_task
|
|
|
|
* Task error code: The task stack fails to be freed.
|
|
|
|
* Task error code: The task stack fails to be freed.
|
|
|
@ -293,7 +294,7 @@ extern "C" {
|
|
|
|
* @deprecated This error code is obsolete since LiteOS 5.0.0.
|
|
|
|
* @deprecated This error code is obsolete since LiteOS 5.0.0.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
#define LOS_ERRNO_TSK_FREE_STACK_FAILED LOS_ERRNO_OS_ERROR(LOS_MOD_TSK, 0x17)
|
|
|
|
#define LOS_ERRNO_TSK_FREE_STACK_FAILED LOS_ERRNO_OS_ERROR(LOS_MOD_TSK, 0x17)
|
|
|
|
|
|
|
|
/*任务错误代码:无法释放任务堆栈*/
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* @ingroup los_task
|
|
|
|
* @ingroup los_task
|
|
|
|
* Task error code: The task stack area is too small.
|
|
|
|
* Task error code: The task stack area is too small.
|
|
|
@ -304,7 +305,7 @@ extern "C" {
|
|
|
|
* @deprecated This error code is obsolete since LiteOS 5.0.0.
|
|
|
|
* @deprecated This error code is obsolete since LiteOS 5.0.0.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
#define LOS_ERRNO_TSK_STKAREA_TOO_SMALL LOS_ERRNO_OS_ERROR(LOS_MOD_TSK, 0x18)
|
|
|
|
#define LOS_ERRNO_TSK_STKAREA_TOO_SMALL LOS_ERRNO_OS_ERROR(LOS_MOD_TSK, 0x18)
|
|
|
|
|
|
|
|
/*任务错误代码:任务堆栈区域太小*/
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* @ingroup los_task
|
|
|
|
* @ingroup los_task
|
|
|
|
* Task error code: The task fails to be activated.
|
|
|
|
* Task error code: The task fails to be activated.
|
|
|
@ -315,7 +316,7 @@ extern "C" {
|
|
|
|
* @deprecated This error code is obsolete since LiteOS 5.0.0.
|
|
|
|
* @deprecated This error code is obsolete since LiteOS 5.0.0.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
#define LOS_ERRNO_TSK_ACTIVE_FAILED LOS_ERRNO_OS_FATAL(LOS_MOD_TSK, 0x19)
|
|
|
|
#define LOS_ERRNO_TSK_ACTIVE_FAILED LOS_ERRNO_OS_FATAL(LOS_MOD_TSK, 0x19)
|
|
|
|
|
|
|
|
/*任务错误代码:任务激活失败*/
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* @ingroup los_task
|
|
|
|
* @ingroup los_task
|
|
|
|
* Task error code: Too many task configuration items.
|
|
|
|
* Task error code: Too many task configuration items.
|
|
|
@ -326,7 +327,7 @@ extern "C" {
|
|
|
|
* @deprecated This error code is obsolete since LiteOS 5.0.0.
|
|
|
|
* @deprecated This error code is obsolete since LiteOS 5.0.0.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
#define LOS_ERRNO_TSK_CONFIG_TOO_MANY LOS_ERRNO_OS_ERROR(LOS_MOD_TSK, 0x1a)
|
|
|
|
#define LOS_ERRNO_TSK_CONFIG_TOO_MANY LOS_ERRNO_OS_ERROR(LOS_MOD_TSK, 0x1a)
|
|
|
|
|
|
|
|
/*任务错误代码:任务配置项过多*/
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* @ingroup los_task
|
|
|
|
* @ingroup los_task
|
|
|
|
* Task error code: This error code is not in use temporarily.
|
|
|
|
* Task error code: This error code is not in use temporarily.
|
|
|
@ -335,7 +336,7 @@ extern "C" {
|
|
|
|
* @deprecated This error code is obsolete since LiteOS 5.0.0.
|
|
|
|
* @deprecated This error code is obsolete since LiteOS 5.0.0.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
#define LOS_ERRNO_TSK_CP_SAVE_AREA_NOT_ALIGN LOS_ERRNO_OS_ERROR(LOS_MOD_TSK, 0x1b)
|
|
|
|
#define LOS_ERRNO_TSK_CP_SAVE_AREA_NOT_ALIGN LOS_ERRNO_OS_ERROR(LOS_MOD_TSK, 0x1b)
|
|
|
|
|
|
|
|
/*任务错误代码:此错误代码暂时未使用*/
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* @ingroup los_task
|
|
|
|
* @ingroup los_task
|
|
|
|
* Task error code: This error code is not in use temporarily.
|
|
|
|
* Task error code: This error code is not in use temporarily.
|
|
|
@ -344,7 +345,7 @@ extern "C" {
|
|
|
|
* @deprecated This error code is obsolete since LiteOS 5.0.0.
|
|
|
|
* @deprecated This error code is obsolete since LiteOS 5.0.0.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
#define LOS_ERRNO_TSK_MSG_Q_TOO_MANY LOS_ERRNO_OS_ERROR(LOS_MOD_TSK, 0x1d)
|
|
|
|
#define LOS_ERRNO_TSK_MSG_Q_TOO_MANY LOS_ERRNO_OS_ERROR(LOS_MOD_TSK, 0x1d)
|
|
|
|
|
|
|
|
/*任务错误代码:此错误代码暂时未使用*/
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* @ingroup los_task
|
|
|
|
* @ingroup los_task
|
|
|
|
* Task error code: This error code is not in use temporarily.
|
|
|
|
* Task error code: This error code is not in use temporarily.
|
|
|
@ -353,7 +354,7 @@ extern "C" {
|
|
|
|
* @deprecated This error code is obsolete since LiteOS 5.0.0.
|
|
|
|
* @deprecated This error code is obsolete since LiteOS 5.0.0.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
#define LOS_ERRNO_TSK_CP_SAVE_AREA_NULL LOS_ERRNO_OS_ERROR(LOS_MOD_TSK, 0x1e)
|
|
|
|
#define LOS_ERRNO_TSK_CP_SAVE_AREA_NULL LOS_ERRNO_OS_ERROR(LOS_MOD_TSK, 0x1e)
|
|
|
|
|
|
|
|
/*任务错误代码:此错误代码暂时未使用*/
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* @ingroup los_task
|
|
|
|
* @ingroup los_task
|
|
|
|
* Task error code: This error code is not in use temporarily.
|
|
|
|
* Task error code: This error code is not in use temporarily.
|
|
|
@ -362,7 +363,7 @@ extern "C" {
|
|
|
|
* @deprecated This error code is obsolete since LiteOS 5.0.0.
|
|
|
|
* @deprecated This error code is obsolete since LiteOS 5.0.0.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
#define LOS_ERRNO_TSK_SELF_DELETE_ERR LOS_ERRNO_OS_ERROR(LOS_MOD_TSK, 0x1f)
|
|
|
|
#define LOS_ERRNO_TSK_SELF_DELETE_ERR LOS_ERRNO_OS_ERROR(LOS_MOD_TSK, 0x1f)
|
|
|
|
|
|
|
|
/*任务错误代码:此错误代码暂时未使用*/
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* @ingroup los_task
|
|
|
|
* @ingroup los_task
|
|
|
|
* Task error code: The task stack size is too large.
|
|
|
|
* Task error code: The task stack size is too large.
|
|
|
@ -372,7 +373,7 @@ extern "C" {
|
|
|
|
* Solution: shrink the task stack size parameter.
|
|
|
|
* Solution: shrink the task stack size parameter.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
#define LOS_ERRNO_TSK_STKSZ_TOO_LARGE LOS_ERRNO_OS_ERROR(LOS_MOD_TSK, 0x20)
|
|
|
|
#define LOS_ERRNO_TSK_STKSZ_TOO_LARGE LOS_ERRNO_OS_ERROR(LOS_MOD_TSK, 0x20)
|
|
|
|
|
|
|
|
/*任务错误代码:任务堆栈大小太大*/
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* @ingroup los_task
|
|
|
|
* @ingroup los_task
|
|
|
|
* Task error code: Suspending software timer task is not allowed.
|
|
|
|
* Task error code: Suspending software timer task is not allowed.
|
|
|
@ -383,7 +384,7 @@ extern "C" {
|
|
|
|
* @deprecated This error code is obsolete since LiteOS 5.0.0.
|
|
|
|
* @deprecated This error code is obsolete since LiteOS 5.0.0.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
#define LOS_ERRNO_TSK_SUSPEND_SWTMR_NOT_ALLOWED LOS_ERRNO_OS_ERROR(LOS_MOD_TSK, 0x21)
|
|
|
|
#define LOS_ERRNO_TSK_SUSPEND_SWTMR_NOT_ALLOWED LOS_ERRNO_OS_ERROR(LOS_MOD_TSK, 0x21)
|
|
|
|
|
|
|
|
/*任务错误代码:不允许挂起软件计时器任务*/
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* @ingroup los_task
|
|
|
|
* @ingroup los_task
|
|
|
|
* Task error code: The cpu affinity mask is incorrect.
|
|
|
|
* Task error code: The cpu affinity mask is incorrect.
|
|
|
@ -393,7 +394,7 @@ extern "C" {
|
|
|
|
* Solution: Please set the correct cpu affinity mask.
|
|
|
|
* Solution: Please set the correct cpu affinity mask.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
#define LOS_ERRNO_TSK_CPU_AFFINITY_MASK_ERR LOS_ERRNO_OS_FATAL(LOS_MOD_TSK, 0x23)
|
|
|
|
#define LOS_ERRNO_TSK_CPU_AFFINITY_MASK_ERR LOS_ERRNO_OS_FATAL(LOS_MOD_TSK, 0x23)
|
|
|
|
|
|
|
|
/*任务错误代码:cpu关联掩码不正确*/
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* @ingroup los_task
|
|
|
|
* @ingroup los_task
|
|
|
|
* Task error code: Task yield in interrupt is not permited, which will result in an unexpected result.
|
|
|
|
* Task error code: Task yield in interrupt is not permited, which will result in an unexpected result.
|
|
|
@ -403,7 +404,7 @@ extern "C" {
|
|
|
|
* Solution: Don't call LOS_TaskYield in Interrupt.
|
|
|
|
* Solution: Don't call LOS_TaskYield in Interrupt.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
#define LOS_ERRNO_TSK_YIELD_IN_INT LOS_ERRNO_OS_ERROR(LOS_MOD_TSK, 0x24)
|
|
|
|
#define LOS_ERRNO_TSK_YIELD_IN_INT LOS_ERRNO_OS_ERROR(LOS_MOD_TSK, 0x24)
|
|
|
|
|
|
|
|
/*任务错误代码:不允许任务在中断中让步,这将导致意外结果*/
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* @ingroup los_task
|
|
|
|
* @ingroup los_task
|
|
|
|
* Task error code: Task sync resource (semaphore) allocated failed.
|
|
|
|
* Task error code: Task sync resource (semaphore) allocated failed.
|
|
|
@ -413,7 +414,7 @@ extern "C" {
|
|
|
|
* Solution: Expand LOSCFG_BASE_IPC_SEM_LIMIT.
|
|
|
|
* Solution: Expand LOSCFG_BASE_IPC_SEM_LIMIT.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
#define LOS_ERRNO_TSK_MP_SYNC_RESOURCE LOS_ERRNO_OS_ERROR(LOS_MOD_TSK, 0x25)
|
|
|
|
#define LOS_ERRNO_TSK_MP_SYNC_RESOURCE LOS_ERRNO_OS_ERROR(LOS_MOD_TSK, 0x25)
|
|
|
|
|
|
|
|
/*任务错误代码:分配的任务同步资源(信号量)失败*/
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* @ingroup los_task
|
|
|
|
* @ingroup los_task
|
|
|
|
* Task error code: Task sync failed on operating running task across cores.
|
|
|
|
* Task error code: Task sync failed on operating running task across cores.
|
|
|
@ -423,7 +424,7 @@ extern "C" {
|
|
|
|
* Solution: Check task delete can be handled in user's scenario.
|
|
|
|
* Solution: Check task delete can be handled in user's scenario.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
#define LOS_ERRNO_TSK_MP_SYNC_FAILED LOS_ERRNO_OS_ERROR(LOS_MOD_TSK, 0x26)
|
|
|
|
#define LOS_ERRNO_TSK_MP_SYNC_FAILED LOS_ERRNO_OS_ERROR(LOS_MOD_TSK, 0x26)
|
|
|
|
|
|
|
|
/*任务错误代码:在操作跨核心运行的任务时,任务同步失败*/
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* @ingroup los_task
|
|
|
|
* @ingroup los_task
|
|
|
|
* Minimum stack size.
|
|
|
|
* Minimum stack size.
|
|
|
@ -432,7 +433,8 @@ extern "C" {
|
|
|
|
* LOS_TASK_MIN_STACK_SIZE bytes, aligned on a boundary of LOSCFG_STACK_POINT_ALIGN_SIZE.
|
|
|
|
* LOS_TASK_MIN_STACK_SIZE bytes, aligned on a boundary of LOSCFG_STACK_POINT_ALIGN_SIZE.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
#define LOS_TASK_MIN_STACK_SIZE (ALIGN(KERNEL_TSK_MIN_STACK_SIZE, LOSCFG_STACK_POINT_ALIGN_SIZE))
|
|
|
|
#define LOS_TASK_MIN_STACK_SIZE (ALIGN(KERNEL_TSK_MIN_STACK_SIZE, LOSCFG_STACK_POINT_ALIGN_SIZE))
|
|
|
|
|
|
|
|
/*这段代码是关于任务(task)的最小栈大小的定义通过这段代码,可以看出LOS_TASK_MIN_STACK_SIZE的大小是根据KERNEL_TSK_MIN_STACK_SIZE和
|
|
|
|
|
|
|
|
LOSCFG_STACK_POINT_ALIGN_SIZE来计算的并且保证了堆栈大小是按照一定的对齐方式进行分配的。*/
|
|
|
|
#ifdef LOSCFG_BASE_CORE_TSK_MONITOR
|
|
|
|
#ifdef LOSCFG_BASE_CORE_TSK_MONITOR
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* @ingroup los_task
|
|
|
|
* @ingroup los_task
|
|
|
@ -494,6 +496,9 @@ typedef VOID *(*TSK_ENTRY_FUNC)(UINTPTR param1,
|
|
|
|
UINTPTR param4);
|
|
|
|
UINTPTR param4);
|
|
|
|
#else
|
|
|
|
#else
|
|
|
|
typedef VOID *(*TSK_ENTRY_FUNC)(VOID *param);
|
|
|
|
typedef VOID *(*TSK_ENTRY_FUNC)(VOID *param);
|
|
|
|
|
|
|
|
/*这段代码中使用了条件预处理指令#ifdef,它用于根据预定义的宏LOSOCFG_OBSOLETE_API是否存在来选择不同的类型定义,果LOSOCFG_OBSOLETE_API宏被定义,
|
|
|
|
|
|
|
|
则TSK_ENTRY_FUNC被定义为接受四个UINTPTR类型参数并返回VOID指针的函数指针类型;如果LOSOCFG_OBSOLETE_API宏未被定义,则TSK_ENTRY_FUNC被定义为接
|
|
|
|
|
|
|
|
受一个VOID指针参数并返回VOID指针的函数指针类型*/
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* @ingroup los_task
|
|
|
|
* @ingroup los_task
|
|
|
@ -519,7 +524,14 @@ typedef struct tagTskInitParam {
|
|
|
|
UINT32 uwResved; /**< Task is automatically deleted if uwResved is set to #LOS_TASK_STATUS_DETACHED.
|
|
|
|
UINT32 uwResved; /**< Task is automatically deleted if uwResved is set to #LOS_TASK_STATUS_DETACHED.
|
|
|
|
Task will not be deleted automatically if it is set to 0. */
|
|
|
|
Task will not be deleted automatically if it is set to 0. */
|
|
|
|
} TSK_INIT_PARAM_S;
|
|
|
|
} TSK_INIT_PARAM_S;
|
|
|
|
|
|
|
|
/*这段代码定义了一个结构体类型TSK_INIT_PARAM_S,用于传递任务创建时的参数信息
|
|
|
|
|
|
|
|
pfnTaskEntry:任务入口函数指针。
|
|
|
|
|
|
|
|
usTaskPrio:任务优先级。
|
|
|
|
|
|
|
|
auwArgs/pArgs:任务参数,可以是一个指向参数列表的数组或一个指向参数结构体的指针,具体取决于LOSCFG_OBSOLETE_API是否被定义。
|
|
|
|
|
|
|
|
uwStackSize:任务栈大小。
|
|
|
|
|
|
|
|
pcName:任务名称。
|
|
|
|
|
|
|
|
usCpuAffiMask:CPU亲和性掩码,仅在LOSCFG_KERNEL_SMP被定义时有效。
|
|
|
|
|
|
|
|
uwResved:保留字段,如果设置为LOS_TASK_STATUS_DETACHED,则任务将自动删除。*/
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* @ingroup los_task
|
|
|
|
* @ingroup los_task
|
|
|
|
* Task name length
|
|
|
|
* Task name length
|
|
|
@ -551,7 +563,23 @@ typedef struct tagTskInfo {
|
|
|
|
BOOL bOvf; /**< Flag that indicates whether a task stack overflow
|
|
|
|
BOOL bOvf; /**< Flag that indicates whether a task stack overflow
|
|
|
|
occurs or not */
|
|
|
|
occurs or not */
|
|
|
|
} TSK_INFO_S;
|
|
|
|
} TSK_INFO_S;
|
|
|
|
|
|
|
|
/*这段代码定义了一个结构体类型TSK_INFO_S,用于保存任务的信息
|
|
|
|
|
|
|
|
TSK_INFO_S结构体包含以下成员:
|
|
|
|
|
|
|
|
acName:任务名称,长度为LOS_TASK_NAMELEN,默认值为32。
|
|
|
|
|
|
|
|
uwTaskID:任务ID。
|
|
|
|
|
|
|
|
usTaskStatus:任务状态。
|
|
|
|
|
|
|
|
usTaskPrio:任务优先级。
|
|
|
|
|
|
|
|
pTaskSem:信号量指针。
|
|
|
|
|
|
|
|
pTaskMux:互斥锁指针。
|
|
|
|
|
|
|
|
uwEvent:事件。
|
|
|
|
|
|
|
|
uwEventMask:事件掩码。
|
|
|
|
|
|
|
|
uwStackSize:任务栈大小。
|
|
|
|
|
|
|
|
uwTopOfStack:任务栈顶部。
|
|
|
|
|
|
|
|
uwBottomOfStack:任务栈底部。
|
|
|
|
|
|
|
|
uwSP:任务SP指针。
|
|
|
|
|
|
|
|
uwCurrUsed:当前任务栈使用量。
|
|
|
|
|
|
|
|
uwPeakUsed:任务栈使用峰值。
|
|
|
|
|
|
|
|
bOvf:表示任务栈是否发生溢出的标志。*/
|
|
|
|
#ifdef LOSCFG_TASK_STATIC_ALLOCATION
|
|
|
|
#ifdef LOSCFG_TASK_STATIC_ALLOCATION
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* @ingroup los_task
|
|
|
|
* @ingroup los_task
|
|
|
@ -601,7 +629,24 @@ typedef struct tagTskInfo {
|
|
|
|
* @since Huawei LiteOS V200R005C10
|
|
|
|
* @since Huawei LiteOS V200R005C10
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
extern UINT32 LOS_TaskCreateOnlyStatic(UINT32 *taskId, TSK_INIT_PARAM_S *initParam, VOID *topStack);
|
|
|
|
extern UINT32 LOS_TaskCreateOnlyStatic(UINT32 *taskId, TSK_INIT_PARAM_S *initParam, VOID *topStack);
|
|
|
|
|
|
|
|
/*该函数的作用是创建一个静态分配的任务,并将其挂起。静态分配任务的栈空间由用户自行分配和释放,需要在删除任务时及时释放栈空间。
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
函数的参数如下:
|
|
|
|
|
|
|
|
taskId:[OUT] 任务ID,类型为UINT32指针。
|
|
|
|
|
|
|
|
initParam:[IN] 任务创建的参数,类型为TSK_INIT_PARAM_S结构体指针。
|
|
|
|
|
|
|
|
topStack:[IN] 任务栈的顶部地址,类型为VOID指针。
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
函数的返回值为操作结果,可能的返回值如下:
|
|
|
|
|
|
|
|
LOS_ERRNO_TSK_ID_INVALID:无效的任务ID,taskId参数为NULL。
|
|
|
|
|
|
|
|
LOS_ERRNO_TSK_PTR_NULL:initParam参数为NULL。
|
|
|
|
|
|
|
|
LOS_ERRNO_TSK_NAME_EMPTY:任务名称为NULL。
|
|
|
|
|
|
|
|
LOS_ERRNO_TSK_ENTRY_NULL:任务执行函数为NULL。
|
|
|
|
|
|
|
|
LOS_ERRNO_TSK_PRIOR_ERROR:任务优先级错误。
|
|
|
|
|
|
|
|
LOS_ERRNO_TSK_STKSZ_TOO_LARGE:任务栈大小太大。
|
|
|
|
|
|
|
|
LOS_ERRNO_TSK_STKSZ_TOO_SMALL:任务栈大小太小。
|
|
|
|
|
|
|
|
LOS_ERRNO_TSK_TCB_UNAVAILABLE:没有可用的任务控制块。
|
|
|
|
|
|
|
|
LOS_ERRNO_TSK_NO_MEMORY:任务创建时内存不足。
|
|
|
|
|
|
|
|
LOS_OK:任务成功创建。*/
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* @ingroup los_task
|
|
|
|
* @ingroup los_task
|
|
|
|
* @brief Create a task.
|
|
|
|
* @brief Create a task.
|
|
|
@ -653,7 +698,9 @@ extern UINT32 LOS_TaskCreateOnlyStatic(UINT32 *taskId, TSK_INIT_PARAM_S *initPar
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
extern UINT32 LOS_TaskCreateStatic(UINT32 *taskId, TSK_INIT_PARAM_S *initParam, VOID *topStack);
|
|
|
|
extern UINT32 LOS_TaskCreateStatic(UINT32 *taskId, TSK_INIT_PARAM_S *initParam, VOID *topStack);
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/*这段代码是关于任务创建的函数LOS_TaskCreateStatic的声明。
|
|
|
|
|
|
|
|
函数的功能是创建一个任务并将其挂起。如果系统初始化后创建的任务的优先级高于当前任务并且任务调度未被锁定,则会调度该任务运行.静态分配任务的栈空间由用户自行分配和释放,需要在删除任务时及时释放栈空间。
|
|
|
|
|
|
|
|
该函数的调用需要传入任务ID、任务创建参数和任务栈的顶部地址,返回创建结果*/
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* @ingroup los_task
|
|
|
|
* @ingroup los_task
|
|
|
|
* @brief Create a task and suspend.
|
|
|
|
* @brief Create a task and suspend.
|
|
|
@ -699,7 +746,9 @@ extern UINT32 LOS_TaskCreateStatic(UINT32 *taskId, TSK_INIT_PARAM_S *initParam,
|
|
|
|
* @since Huawei LiteOS V100R001C00
|
|
|
|
* @since Huawei LiteOS V100R001C00
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
extern UINT32 LOS_TaskCreateOnly(UINT32 *taskId, TSK_INIT_PARAM_S *initParam);
|
|
|
|
extern UINT32 LOS_TaskCreateOnly(UINT32 *taskId, TSK_INIT_PARAM_S *initParam);
|
|
|
|
|
|
|
|
/*这段代码是关于任务创建的函数LOS_TaskCreateOnly的声明。
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
函数的功能是创建一个任务并将其挂起。在任务创建后,该任务不会被添加到就绪任务队列中。*/
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* @ingroup los_task
|
|
|
|
* @ingroup los_task
|
|
|
|
* @brief Create a task.
|
|
|
|
* @brief Create a task.
|
|
|
@ -745,7 +794,7 @@ extern UINT32 LOS_TaskCreateOnly(UINT32 *taskId, TSK_INIT_PARAM_S *initParam);
|
|
|
|
* @since Huawei LiteOS V100R001C00
|
|
|
|
* @since Huawei LiteOS V100R001C00
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
extern UINT32 LOS_TaskCreate(UINT32 *taskId, TSK_INIT_PARAM_S *initParam);
|
|
|
|
extern UINT32 LOS_TaskCreate(UINT32 *taskId, TSK_INIT_PARAM_S *initParam);
|
|
|
|
|
|
|
|
/*该函数的功能是创建一个任务。如果在系统初始化之后创建的任务的优先级比当前任务高并且任务调度未被锁定,则将其调度运行。如果不是,则创建的任务将添加到就绪任务队列中*/
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* @ingroup los_task
|
|
|
|
* @ingroup los_task
|
|
|
|
* @brief Resume a task.
|
|
|
|
* @brief Resume a task.
|
|
|
@ -772,7 +821,9 @@ extern UINT32 LOS_TaskCreate(UINT32 *taskId, TSK_INIT_PARAM_S *initParam);
|
|
|
|
* @since Huawei LiteOS V100R001C00
|
|
|
|
* @since Huawei LiteOS V100R001C00
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
extern UINT32 LOS_TaskResume(UINT32 taskId);
|
|
|
|
extern UINT32 LOS_TaskResume(UINT32 taskId);
|
|
|
|
|
|
|
|
/*这是华为LiteOS中用于恢复(Resume)任务的函数LOS_TaskResume的声明。
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
该函数的功能是恢复一个被挂起(Suspended)的任务。*/
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* @ingroup los_task
|
|
|
|
* @ingroup los_task
|
|
|
|
* @brief Suspend a task.
|
|
|
|
* @brief Suspend a task.
|
|
|
@ -802,7 +853,9 @@ extern UINT32 LOS_TaskResume(UINT32 taskId);
|
|
|
|
* @since Huawei LiteOS V100R001C00
|
|
|
|
* @since Huawei LiteOS V100R001C00
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
extern UINT32 LOS_TaskSuspend(UINT32 taskId);
|
|
|
|
extern UINT32 LOS_TaskSuspend(UINT32 taskId);
|
|
|
|
|
|
|
|
/*这是华为LiteOS中用于挂起(Suspend)任务的函数LOS_TaskSuspend的声明。
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
该函数的功能是挂起指定的任务,并将其从就绪任务队列中移除。*/
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* @ingroup los_task
|
|
|
|
* @ingroup los_task
|
|
|
|
* @brief Delete a task.
|
|
|
|
* @brief Delete a task.
|
|
|
@ -833,7 +886,9 @@ extern UINT32 LOS_TaskSuspend(UINT32 taskId);
|
|
|
|
* @since Huawei LiteOS V100R001C00
|
|
|
|
* @since Huawei LiteOS V100R001C00
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
extern UINT32 LOS_TaskDelete(UINT32 taskId);
|
|
|
|
extern UINT32 LOS_TaskDelete(UINT32 taskId);
|
|
|
|
|
|
|
|
/*这是华为LiteOS中用于删除任务的函数LOS_TaskDelete的声明。
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
该函数的功能是删除指定的任务并释放其任务栈和任务控制块的资源。*/
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* @ingroup los_task
|
|
|
|
* @ingroup los_task
|
|
|
|
* @brief Delay a task.
|
|
|
|
* @brief Delay a task.
|
|
|
@ -867,7 +922,9 @@ extern UINT32 LOS_TaskDelete(UINT32 taskId);
|
|
|
|
* @since Huawei LiteOS V100R001C00
|
|
|
|
* @since Huawei LiteOS V100R001C00
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
extern UINT32 LOS_TaskDelay(UINT32 tick);
|
|
|
|
extern UINT32 LOS_TaskDelay(UINT32 tick);
|
|
|
|
|
|
|
|
/*这是华为LiteOS中用于延迟(Delay)任务的函数LOS_TaskDelay的声明。
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
该函数的功能是延迟当前任务的执行。在延迟了指定数量的Ticks后,任务可以被调度到就绪任务队列中。*/
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* @ingroup los_task
|
|
|
|
* @ingroup los_task
|
|
|
|
* @brief Lock the task scheduling.
|
|
|
|
* @brief Lock the task scheduling.
|
|
|
@ -891,7 +948,9 @@ extern UINT32 LOS_TaskDelay(UINT32 tick);
|
|
|
|
* @since Huawei LiteOS V100R001C00
|
|
|
|
* @since Huawei LiteOS V100R001C00
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
extern VOID LOS_TaskLock(VOID);
|
|
|
|
extern VOID LOS_TaskLock(VOID);
|
|
|
|
|
|
|
|
/*这是华为LiteOS中用于锁定任务调度的函数LOS_TaskLock的声明。
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
该函数的功能是锁定任务调度。如果任务调度被锁定,则不会发生任务切换。*/
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* @ingroup los_task
|
|
|
|
* @ingroup los_task
|
|
|
|
* @brief Unlock the task scheduling.
|
|
|
|
* @brief Unlock the task scheduling.
|
|
|
@ -913,7 +972,9 @@ extern VOID LOS_TaskLock(VOID);
|
|
|
|
* @since Huawei LiteOS V100R001C00
|
|
|
|
* @since Huawei LiteOS V100R001C00
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
extern VOID LOS_TaskUnlock(VOID);
|
|
|
|
extern VOID LOS_TaskUnlock(VOID);
|
|
|
|
|
|
|
|
/*这是华为LiteOS中用于解锁任务调度的函数LOS_TaskUnlock的声明。
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
该函数的功能是解锁任务调度。调用此API将减少任务锁的数量。如果一个任务被锁定多次,则只有在锁的数量变为零时才会解锁任务调度*/
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* @ingroup los_task
|
|
|
|
* @ingroup los_task
|
|
|
|
* @brief Set a task priority.
|
|
|
|
* @brief Set a task priority.
|
|
|
@ -946,7 +1007,9 @@ extern VOID LOS_TaskUnlock(VOID);
|
|
|
|
* @since Huawei LiteOS V100R001C00
|
|
|
|
* @since Huawei LiteOS V100R001C00
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
extern UINT32 LOS_TaskPriSet(UINT32 taskId, UINT16 taskPrio);
|
|
|
|
extern UINT32 LOS_TaskPriSet(UINT32 taskId, UINT16 taskPrio);
|
|
|
|
|
|
|
|
/*这是华为LiteOS中用于设置任务优先级的函数LOS_TaskPriSet的声明。
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
该函数的功能是设置指定任务的优先级*/
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* @ingroup los_task
|
|
|
|
* @ingroup los_task
|
|
|
|
* @brief Set the priority of the current running task to a specified priority.
|
|
|
|
* @brief Set the priority of the current running task to a specified priority.
|
|
|
@ -976,7 +1039,9 @@ extern UINT32 LOS_TaskPriSet(UINT32 taskId, UINT16 taskPrio);
|
|
|
|
* @since Huawei LiteOS V100R001C00
|
|
|
|
* @since Huawei LiteOS V100R001C00
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
extern UINT32 LOS_CurTaskPriSet(UINT16 taskPrio);
|
|
|
|
extern UINT32 LOS_CurTaskPriSet(UINT16 taskPrio);
|
|
|
|
|
|
|
|
/*这是华为LiteOS中用于将当前运行任务的优先级设置为指定优先级的函数LOS_CurTaskPriSet的声明。
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
该函数的功能是将当前运行任务的优先级设置为指定的优先级。*/
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* @ingroup los_task
|
|
|
|
* @ingroup los_task
|
|
|
|
* @brief Change the scheduling sequence of tasks with the same priority.
|
|
|
|
* @brief Change the scheduling sequence of tasks with the same priority.
|
|
|
@ -1002,7 +1067,9 @@ extern UINT32 LOS_CurTaskPriSet(UINT16 taskPrio);
|
|
|
|
* @since Huawei LiteOS V100R001C00
|
|
|
|
* @since Huawei LiteOS V100R001C00
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
extern UINT32 LOS_TaskYield(VOID);
|
|
|
|
extern UINT32 LOS_TaskYield(VOID);
|
|
|
|
|
|
|
|
/*这是华为LiteOS中用于改变具有相同优先级的任务调度顺序的函数LOS_TaskYield的声明。
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
该函数的功能是将当前任务移动到具有相同优先级的就绪任务队列的队尾。*/
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* @ingroup los_task
|
|
|
|
* @ingroup los_task
|
|
|
|
* @brief Obtain a task priority.
|
|
|
|
* @brief Obtain a task priority.
|
|
|
@ -1022,7 +1089,9 @@ extern UINT32 LOS_TaskYield(VOID);
|
|
|
|
* @since Huawei LiteOS V100R001C00
|
|
|
|
* @since Huawei LiteOS V100R001C00
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
extern UINT16 LOS_TaskPriGet(UINT32 taskId);
|
|
|
|
extern UINT16 LOS_TaskPriGet(UINT32 taskId);
|
|
|
|
|
|
|
|
/*这是华为LiteOS中获取指定任务优先级的函数LOS_TaskPriGet的声明。
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
该函数的功能是获取指定任务的优先级。*/
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* @ingroup los_task
|
|
|
|
* @ingroup los_task
|
|
|
|
* @brief Obtain current running task ID.
|
|
|
|
* @brief Obtain current running task ID.
|
|
|
@ -1040,7 +1109,9 @@ extern UINT16 LOS_TaskPriGet(UINT32 taskId);
|
|
|
|
* @since Huawei LiteOS V100R001C00
|
|
|
|
* @since Huawei LiteOS V100R001C00
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
extern UINT32 LOS_CurTaskIDGet(VOID);
|
|
|
|
extern UINT32 LOS_CurTaskIDGet(VOID);
|
|
|
|
|
|
|
|
/*这是华为LiteOS中获取当前正在运行的任务ID的函数LOS_CurTaskIDGet的声明。
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
该函数的功能是获取当前正在运行的任务的ID。*/
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* @ingroup los_task
|
|
|
|
* @ingroup los_task
|
|
|
|
* @brief Obtain a task information structure.
|
|
|
|
* @brief Obtain a task information structure.
|
|
|
@ -1064,7 +1135,9 @@ extern UINT32 LOS_CurTaskIDGet(VOID);
|
|
|
|
* @since Huawei LiteOS V100R001C00
|
|
|
|
* @since Huawei LiteOS V100R001C00
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
extern UINT32 LOS_TaskInfoGet(UINT32 taskId, TSK_INFO_S *taskInfo);
|
|
|
|
extern UINT32 LOS_TaskInfoGet(UINT32 taskId, TSK_INFO_S *taskInfo);
|
|
|
|
|
|
|
|
/*这是华为LiteOS中获取任务信息结构的函数LOS_TaskInfoGet的声明。
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
该函数的功能是获取一个任务信息结构。*/
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* @ingroup los_task
|
|
|
|
* @ingroup los_task
|
|
|
|
* @brief Set the affinity mask of the task scheduling cpu.
|
|
|
|
* @brief Set the affinity mask of the task scheduling cpu.
|
|
|
@ -1090,7 +1163,9 @@ extern UINT32 LOS_TaskInfoGet(UINT32 taskId, TSK_INFO_S *taskInfo);
|
|
|
|
* @since Huawei LiteOS V200R003C00
|
|
|
|
* @since Huawei LiteOS V200R003C00
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
extern UINT32 LOS_TaskCpuAffiSet(UINT32 taskId, UINT16 usCpuAffiMask);
|
|
|
|
extern UINT32 LOS_TaskCpuAffiSet(UINT32 taskId, UINT16 usCpuAffiMask);
|
|
|
|
|
|
|
|
/*这是华为LiteOS中设置任务调度CPU亲和性掩码的函数LOS_TaskCpuAffiSet的声明。
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
该函数的功能是设置任务调度CPU亲和性掩码,即指定任务允许运行在哪些CPU核心上*/
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* @ingroup los_task
|
|
|
|
* @ingroup los_task
|
|
|
|
* @brief Get the affinity mask of the task scheduling cpu.
|
|
|
|
* @brief Get the affinity mask of the task scheduling cpu.
|
|
|
@ -1110,7 +1185,9 @@ extern UINT32 LOS_TaskCpuAffiSet(UINT32 taskId, UINT16 usCpuAffiMask);
|
|
|
|
* @since Huawei LiteOS V200R003C00
|
|
|
|
* @since Huawei LiteOS V200R003C00
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
extern UINT16 LOS_TaskCpuAffiGet(UINT32 taskId);
|
|
|
|
extern UINT16 LOS_TaskCpuAffiGet(UINT32 taskId);
|
|
|
|
|
|
|
|
/*这是华为LiteOS中获取任务调度CPU亲和性掩码的函数LOS_TaskCpuAffiGet的声明。
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
该函数的功能是获取任务调度CPU的亲和性掩码,即获取指定任务允许运行在哪些CPU核心上*/
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* @ingroup los_task
|
|
|
|
* @ingroup los_task
|
|
|
|
* @brief Recycle task stack resource.
|
|
|
|
* @brief Recycle task stack resource.
|
|
|
@ -1129,7 +1206,10 @@ extern UINT16 LOS_TaskCpuAffiGet(UINT32 taskId);
|
|
|
|
* @since Huawei LiteOS V200R003C00
|
|
|
|
* @since Huawei LiteOS V200R003C00
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
extern VOID LOS_TaskResRecycle(VOID);
|
|
|
|
extern VOID LOS_TaskResRecycle(VOID);
|
|
|
|
|
|
|
|
/*这是华为LiteOS中回收任务堆栈资源的函数LOS_TaskResRecycle的声明。
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
该函数的功能是回收已经被删除的任务的堆栈资源。当任务被删除时,它的堆栈内存块不会立即释放,而是留给后续新创建的任务使用。但如果一段时间后没有新任务创建,
|
|
|
|
|
|
|
|
则这些堆栈内存块会浪费系统资源,应该通过调用此函数进行回收*/
|
|
|
|
#ifdef LOSCFG_OBSOLETE_API
|
|
|
|
#ifdef LOSCFG_OBSOLETE_API
|
|
|
|
#define LOS_TASK_PARAM_INIT_ARG_0(initParam, arg) \
|
|
|
|
#define LOS_TASK_PARAM_INIT_ARG_0(initParam, arg) \
|
|
|
|
initParam.auwArgs[0] = (UINTPTR)arg
|
|
|
|
initParam.auwArgs[0] = (UINTPTR)arg
|
|
|
@ -1138,7 +1218,7 @@ extern VOID LOS_TaskResRecycle(VOID);
|
|
|
|
#define LOS_TASK_PARAM_INIT_ARG(initParam, arg) \
|
|
|
|
#define LOS_TASK_PARAM_INIT_ARG(initParam, arg) \
|
|
|
|
initParam.pArgs = (VOID *)arg
|
|
|
|
initParam.pArgs = (VOID *)arg
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/*这段代码是关于任务参数初始化宏的定义*/
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* @ingroup los_task
|
|
|
|
* @ingroup los_task
|
|
|
|
* @brief Define the lowpower framework process function type.
|
|
|
|
* @brief Define the lowpower framework process function type.
|
|
|
@ -1157,7 +1237,7 @@ extern VOID LOS_TaskResRecycle(VOID);
|
|
|
|
* @since Huawei LiteOS V200R005C10
|
|
|
|
* @since Huawei LiteOS V200R005C10
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
typedef VOID (*LOWPOWERIDLEHOOK)(VOID);
|
|
|
|
typedef VOID (*LOWPOWERIDLEHOOK)(VOID);
|
|
|
|
|
|
|
|
/*这段代码定义了一个函数指针类型LOWPOWERIDLEHOOK,用于定义低功耗框架的处理函数*/
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* @ingroup los_task
|
|
|
|
* @ingroup los_task
|
|
|
|
* @brief Register a hook to enter lowpower framework process.
|
|
|
|
* @brief Register a hook to enter lowpower framework process.
|
|
|
@ -1176,7 +1256,9 @@ typedef VOID (*LOWPOWERIDLEHOOK)(VOID);
|
|
|
|
* @since Huawei LiteOS V200R005C10
|
|
|
|
* @since Huawei LiteOS V200R005C10
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
extern VOID LOS_LowpowerHookReg(LOWPOWERIDLEHOOK hook);
|
|
|
|
extern VOID LOS_LowpowerHookReg(LOWPOWERIDLEHOOK hook);
|
|
|
|
|
|
|
|
/*这段代码是关于注册低功耗处理函数的函数LOS_LowpowerHookReg的声明。
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
该函数的功能是向系统注册一个用于处理低功耗操作的函数。此函数将会在系统进入低功耗模式时被调用,以执行特定的低功耗操作或处理*/
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* @ingroup los_task
|
|
|
|
* @ingroup los_task
|
|
|
|
* @brief Define the type of idle handler hook function.
|
|
|
|
* @brief Define the type of idle handler hook function.
|
|
|
@ -1193,7 +1275,11 @@ extern VOID LOS_LowpowerHookReg(LOWPOWERIDLEHOOK hook);
|
|
|
|
* @since Huawei LiteOS V200R005C20
|
|
|
|
* @since Huawei LiteOS V200R005C20
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
typedef VOID (*IDLEHANDLERHOOK)(VOID);
|
|
|
|
typedef VOID (*IDLEHANDLERHOOK)(VOID);
|
|
|
|
|
|
|
|
/*这段代码定义了一个函数指针类型IDLEHANDLERHOOK,用于定义空闲处理函数的类型。
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
该函数指针类型的函数原型为VOID (*IDLEHANDLERHOOK)(VOID),表示该函数没有任何参数,也没有返回值。
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
在系统空闲状态时,可以使用IDLEHANDLERHOOK类型的函数指针来定义一个空闲处理函数。这个处理函数会在系统处于空闲状态时被调用,可以用于执行一些特定的任务或操作*/
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* @ingroup los_task
|
|
|
|
* @ingroup los_task
|
|
|
|
* @brief Register the hook function for idle task.
|
|
|
|
* @brief Register the hook function for idle task.
|
|
|
@ -1212,7 +1298,9 @@ typedef VOID (*IDLEHANDLERHOOK)(VOID);
|
|
|
|
* @since Huawei LiteOS V200R005C20
|
|
|
|
* @since Huawei LiteOS V200R005C20
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
extern VOID LOS_IdleHandlerHookReg(IDLEHANDLERHOOK hook);
|
|
|
|
extern VOID LOS_IdleHandlerHookReg(IDLEHANDLERHOOK hook);
|
|
|
|
|
|
|
|
/*这段代码是关于注册空闲处理函数的函数LOS_IdleHandlerHookReg的声明。
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
该函数的功能是向系统注册一个用于处理空闲状态的函数。此函数将会在系统进入空闲状态时被调用,以执行特定的任务或操作*/
|
|
|
|
#ifdef __cplusplus
|
|
|
|
#ifdef __cplusplus
|
|
|
|
#if __cplusplus
|
|
|
|
#if __cplusplus
|
|
|
|
}
|
|
|
|
}
|
|
|
|