54#define CPUID_TO_AFFI_MASK(cpuid) (0x1u << (cpuid))
62#define LOS_TASK_STATUS_DETACHED 0x0U
70#define LOS_TASK_ATTR_JOINABLE 0x80000000
80#define LOS_ERRNO_TSK_NO_MEMORY LOS_ERRNO_OS_FATAL(LOS_MOD_TSK, 0x00)
90#define LOS_ERRNO_TSK_PTR_NULL LOS_ERRNO_OS_ERROR(LOS_MOD_TSK, 0x01)
100#define LOS_ERRNO_TSK_STKSZ_NOT_ALIGN LOS_ERRNO_OS_ERROR(LOS_MOD_TSK, 0x02)
110#define LOS_ERRNO_TSK_PRIOR_ERROR LOS_ERRNO_OS_ERROR(LOS_MOD_TSK, 0x03)
120#define LOS_ERRNO_TSK_ENTRY_NULL LOS_ERRNO_OS_ERROR(LOS_MOD_TSK, 0x04)
130#define LOS_ERRNO_TSK_NAME_EMPTY LOS_ERRNO_OS_ERROR(LOS_MOD_TSK, 0x05)
140#define LOS_ERRNO_TSK_STKSZ_TOO_SMALL LOS_ERRNO_OS_ERROR(LOS_MOD_TSK, 0x06)
150#define LOS_ERRNO_TSK_ID_INVALID LOS_ERRNO_OS_ERROR(LOS_MOD_TSK, 0x07)
160#define LOS_ERRNO_TSK_ALREADY_SUSPENDED LOS_ERRNO_OS_ERROR(LOS_MOD_TSK, 0x08)
170#define LOS_ERRNO_TSK_NOT_SUSPENDED LOS_ERRNO_OS_ERROR(LOS_MOD_TSK, 0x09)
180#define LOS_ERRNO_TSK_NOT_CREATED LOS_ERRNO_OS_ERROR(LOS_MOD_TSK, 0x0a)
190#define LOS_ERRNO_TSK_DELETE_LOCKED LOS_ERRNO_OS_FATAL(LOS_MOD_TSK, 0x0b)
200#define LOS_ERRNO_TSK_MSG_NONZERO LOS_ERRNO_OS_ERROR(LOS_MOD_TSK, 0x0c)
210#define LOS_ERRNO_TSK_DELAY_IN_INT LOS_ERRNO_OS_FATAL(LOS_MOD_TSK, 0x0d)
220#define LOS_ERRNO_TSK_DELAY_IN_LOCK LOS_ERRNO_OS_ERROR(LOS_MOD_TSK, 0x0e)
229#define LOS_ERRNO_TSK_YIELD_IN_LOCK LOS_ERRNO_OS_ERROR(LOS_MOD_TSK, 0x0f)
239#define LOS_ERRNO_TSK_YIELD_NOT_ENOUGH_TASK LOS_ERRNO_OS_ERROR(LOS_MOD_TSK, 0x10)
249#define LOS_ERRNO_TSK_TCB_UNAVAILABLE LOS_ERRNO_OS_ERROR(LOS_MOD_TSK, 0x11)
259#define LOS_ERRNO_TSK_HOOK_NOT_MATCH LOS_ERRNO_OS_ERROR(LOS_MOD_TSK, 0x12)
269#define LOS_ERRNO_TSK_HOOK_IS_FULL LOS_ERRNO_OS_ERROR(LOS_MOD_TSK, 0x13)
280#define LOS_ERRNO_TSK_OPERATE_SYSTEM_TASK LOS_ERRNO_OS_ERROR(LOS_MOD_TSK, 0x14)
290#define LOS_ERRNO_TSK_SUSPEND_LOCKED LOS_ERRNO_OS_FATAL(LOS_MOD_TSK, 0x15)
300#define LOS_ERRNO_TSK_FREE_STACK_FAILED LOS_ERRNO_OS_ERROR(LOS_MOD_TSK, 0x17)
310#define LOS_ERRNO_TSK_STKAREA_TOO_SMALL LOS_ERRNO_OS_ERROR(LOS_MOD_TSK, 0x18)
320#define LOS_ERRNO_TSK_ACTIVE_FAILED LOS_ERRNO_OS_FATAL(LOS_MOD_TSK, 0x19)
330#define LOS_ERRNO_TSK_CONFIG_TOO_MANY LOS_ERRNO_OS_ERROR(LOS_MOD_TSK, 0x1a)
340#define LOS_ERRNO_TSK_CP_SAVE_AREA_NOT_ALIGN LOS_ERRNO_OS_ERROR(LOS_MOD_TSK, 0x1b)
350#define LOS_ERRNO_TSK_MSG_Q_TOO_MANY LOS_ERRNO_OS_ERROR(LOS_MOD_TSK, 0x1d)
360#define LOS_ERRNO_TSK_CP_SAVE_AREA_NULL LOS_ERRNO_OS_ERROR(LOS_MOD_TSK, 0x1e)
370#define LOS_ERRNO_TSK_SELF_DELETE_ERR LOS_ERRNO_OS_ERROR(LOS_MOD_TSK, 0x1f)
380#define LOS_ERRNO_TSK_STKSZ_TOO_LARGE LOS_ERRNO_OS_ERROR(LOS_MOD_TSK, 0x20)
390#define LOS_ERRNO_TSK_SUSPEND_SWTMR_NOT_ALLOWED LOS_ERRNO_OS_ERROR(LOS_MOD_TSK, 0x21)
400#define LOS_ERRNO_TSK_DELAY_IN_SWTMR_TSK LOS_ERRNO_OS_FATAL(LOS_MOD_TSK, 0x22)
410#define LOS_ERRNO_TSK_CPU_AFFINITY_MASK_ERR LOS_ERRNO_OS_FATAL(LOS_MOD_TSK, 0x23)
420#define LOS_ERRNO_TSK_YIELD_IN_INT LOS_ERRNO_OS_ERROR(LOS_MOD_TSK, 0x24)
430#define LOS_ERRNO_TSK_MP_SYNC_RESOURCE LOS_ERRNO_OS_ERROR(LOS_MOD_TSK, 0x25)
440#define LOS_ERRNO_TSK_MP_SYNC_FAILED LOS_ERRNO_OS_ERROR(LOS_MOD_TSK, 0x26)
450#define LOS_ERRNO_TSK_TIMEOUT LOS_ERRNO_OS_FATAL(LOS_MOD_TSK, 0x27)
460#define LOS_ERRNO_TSK_NOT_SELF_PROCESS LOS_ERRNO_OS_FATAL(LOS_MOD_TSK, 0x28)
480typedef VOID *(*TSK_ENTRY_FUNC)(
UINTPTR param1,
510#ifdef LOSCFG_KERNEL_SMP
525#define LOS_TASK_NAMELEN 32
UINT32 LOS_TaskCpuAffiSet(UINT32 uwTaskID, UINT16 usCpuAffiMask)
Set the affinity mask of the task scheduling cpu.
VOID LOS_TaskUnlock(VOID)
Unlock the task scheduling.
UINT32 LOS_TaskDelete(UINT32 taskID)
Delete a task.
UINT32 LOS_CurTaskPriSet(UINT16 taskPrio)
Set the priority of the current running task to a specified priority.
UINT32 LOS_TaskResume(UINT32 taskID)
Resume a task.
UINT32 LOS_TaskDetach(UINT32 taskID)
Change the joinable attribute of the task to detach.
UINT32 LOS_CurTaskIDGet(VOID)
Obtain current running task ID.
UINT32 LOS_GetSystemTaskMaximum(VOID)
Gets the maximum number of threads supported by the system.
UINT16 LOS_TaskPriGet(UINT32 taskID)
Obtain a task priority.
UINT32 LOS_TaskYield(VOID)
Change the scheduling sequence of tasks with the same priority.
UINT32 LOS_TaskPriSet(UINT32 taskID, UINT16 taskPrio)
Set a task priority.
INT32 LOS_GetTaskScheduler(INT32 taskID)
Get the scheduling policy for the task.
UINT32 LOS_TaskCreateOnly(UINT32 *taskID, TSK_INIT_PARAM_S *initParam)
Create a task and suspend.
INT32 LOS_SetTaskScheduler(INT32 taskID, UINT16 policy, UINT16 priority)
Set the scheduling policy and priority for the task.
struct tagTskInitParam TSK_INIT_PARAM_S
UINT32 LOS_TaskSuspend(UINT32 taskID)
Suspend a task.
VOID LOS_TaskLock(VOID)
Lock the task scheduling.
UINT32 LOS_TaskCreate(UINT32 *taskID, TSK_INIT_PARAM_S *initParam)
Create a task.
VOID LOS_Schedule(VOID)
Trigger active task scheduling.
UINT32 LOS_TaskDelay(UINT32 tick)
Delay a task.
UINT32 LOS_TaskInfoGet(UINT32 taskID, TSK_INFO_S *taskInfo)
Obtain a task information structure.
struct tagTskInfo TSK_INFO_S
VOID *(* TSK_ENTRY_FUNC)(UINTPTR param1, UINTPTR param2, UINTPTR param3, UINTPTR param4)
Define the type of a task entrance function.
UINT32 LOS_TaskJoin(UINT32 taskID, UINTPTR *retval)
Wait for the specified task to finish and reclaim its resources.
UINT16 LOS_TaskCpuAffiGet(UINT32 taskID)
Get the affinity mask of the task scheduling cpu.
双向链表由内联函数实现 http://weharmonyos.com/openharmony/zh-cn/device-dev/kernel/kernel-small-apx-dll....
UINT32 userMapSize
用户空间的栈大小,栈底 = userMapBase + userMapSize
UINTPTR userArea
用户空间的堆区开始位置
UINTPTR userMapBase
用户空间的栈顶位置.
UINTPTR userSP
用户空间当前栈指针位置
CHAR acName[LOS_TASK_NAMELEN]
TSK_ENTRY_FUNC pfnTaskEntry
UserTaskParam userParam
任务用户态运行时任何参数