50#define CPUID_TO_AFFI_MASK(cpuid) (0x1u << (cpuid))
56#define LOS_TASK_PRIORITY_HIGHEST 0
62#define LOS_TASK_PRIORITY_LOWEST 31
87#define LOS_ERRNO_TSK_NO_MEMORY LOS_ERRNO_OS_FATAL(LOS_MOD_TSK, 0x00)
97#define LOS_ERRNO_TSK_PTR_NULL LOS_ERRNO_OS_ERROR(LOS_MOD_TSK, 0x01)
107#define LOS_ERRNO_TSK_STKSZ_NOT_ALIGN LOS_ERRNO_OS_ERROR(LOS_MOD_TSK, 0x02)
117#define LOS_ERRNO_TSK_PRIOR_ERROR LOS_ERRNO_OS_ERROR(LOS_MOD_TSK, 0x03)
127#define LOS_ERRNO_TSK_ENTRY_NULL LOS_ERRNO_OS_ERROR(LOS_MOD_TSK, 0x04)
137#define LOS_ERRNO_TSK_NAME_EMPTY LOS_ERRNO_OS_ERROR(LOS_MOD_TSK, 0x05)
147#define LOS_ERRNO_TSK_STKSZ_TOO_SMALL LOS_ERRNO_OS_ERROR(LOS_MOD_TSK, 0x06)
157#define LOS_ERRNO_TSK_ID_INVALID LOS_ERRNO_OS_ERROR(LOS_MOD_TSK, 0x07)
167#define LOS_ERRNO_TSK_ALREADY_SUSPENDED LOS_ERRNO_OS_ERROR(LOS_MOD_TSK, 0x08)
177#define LOS_ERRNO_TSK_NOT_SUSPENDED LOS_ERRNO_OS_ERROR(LOS_MOD_TSK, 0x09)
187#define LOS_ERRNO_TSK_NOT_CREATED LOS_ERRNO_OS_ERROR(LOS_MOD_TSK, 0x0a)
197#define LOS_ERRNO_TSK_DELETE_LOCKED LOS_ERRNO_OS_FATAL(LOS_MOD_TSK, 0x0b)
208#define LOS_ERRNO_TSK_MSG_NONZERO LOS_ERRNO_OS_ERROR(LOS_MOD_TSK, 0x0c)
218#define LOS_ERRNO_TSK_DELAY_IN_INT LOS_ERRNO_OS_FATAL(LOS_MOD_TSK, 0x0d)
228#define LOS_ERRNO_TSK_DELAY_IN_LOCK LOS_ERRNO_OS_ERROR(LOS_MOD_TSK, 0x0e)
238#define LOS_ERRNO_TSK_YIELD_IN_LOCK LOS_ERRNO_OS_ERROR(LOS_MOD_TSK, 0x0f)
248#define LOS_ERRNO_TSK_YIELD_NOT_ENOUGH_TASK LOS_ERRNO_OS_ERROR(LOS_MOD_TSK, 0x10)
258#define LOS_ERRNO_TSK_TCB_UNAVAILABLE LOS_ERRNO_OS_ERROR(LOS_MOD_TSK, 0x11)
269#define LOS_ERRNO_TSK_HOOK_NOT_MATCH LOS_ERRNO_OS_ERROR(LOS_MOD_TSK, 0x12)
280#define LOS_ERRNO_TSK_HOOK_IS_FULL LOS_ERRNO_OS_ERROR(LOS_MOD_TSK, 0x13)
291#define LOS_ERRNO_TSK_OPERATE_SYSTEM_TASK LOS_ERRNO_OS_ERROR(LOS_MOD_TSK, 0x14)
301#define LOS_ERRNO_TSK_SUSPEND_LOCKED LOS_ERRNO_OS_FATAL(LOS_MOD_TSK, 0x15)
312#define LOS_ERRNO_TSK_FREE_STACK_FAILED LOS_ERRNO_OS_ERROR(LOS_MOD_TSK, 0x17)
323#define LOS_ERRNO_TSK_STKAREA_TOO_SMALL LOS_ERRNO_OS_ERROR(LOS_MOD_TSK, 0x18)
334#define LOS_ERRNO_TSK_ACTIVE_FAILED LOS_ERRNO_OS_FATAL(LOS_MOD_TSK, 0x19)
345#define LOS_ERRNO_TSK_CONFIG_TOO_MANY LOS_ERRNO_OS_ERROR(LOS_MOD_TSK, 0x1a)
354#define LOS_ERRNO_TSK_CP_SAVE_AREA_NOT_ALIGN LOS_ERRNO_OS_ERROR(LOS_MOD_TSK, 0x1b)
363#define LOS_ERRNO_TSK_MSG_Q_TOO_MANY LOS_ERRNO_OS_ERROR(LOS_MOD_TSK, 0x1d)
372#define LOS_ERRNO_TSK_CP_SAVE_AREA_NULL LOS_ERRNO_OS_ERROR(LOS_MOD_TSK, 0x1e)
381#define LOS_ERRNO_TSK_SELF_DELETE_ERR LOS_ERRNO_OS_ERROR(LOS_MOD_TSK, 0x1f)
391#define LOS_ERRNO_TSK_STKSZ_TOO_LARGE LOS_ERRNO_OS_ERROR(LOS_MOD_TSK, 0x20)
402#define LOS_ERRNO_TSK_SUSPEND_SWTMR_NOT_ALLOWED LOS_ERRNO_OS_ERROR(LOS_MOD_TSK, 0x21)
412#define LOS_ERRNO_TSK_CPU_AFFINITY_MASK_ERR LOS_ERRNO_OS_FATAL(LOS_MOD_TSK, 0x23)
422#define LOS_ERRNO_TSK_YIELD_IN_INT LOS_ERRNO_OS_ERROR(LOS_MOD_TSK, 0x24)
432#define LOS_ERRNO_TSK_MP_SYNC_RESOURCE LOS_ERRNO_OS_ERROR(LOS_MOD_TSK, 0x25)
442#define LOS_ERRNO_TSK_MP_SYNC_FAILED LOS_ERRNO_OS_ERROR(LOS_MOD_TSK, 0x26)
452#define LOS_ERRNO_TSK_ALLOC_SECURE_INT LOS_ERRNO_OS_ERROR(LOS_MOD_TSK, 0x27)
462#define LOS_ERRNO_TSK_SECURE_ALREADY_ALLOC LOS_ERRNO_OS_ERROR(LOS_MOD_TSK, 0x28)
472#define LOS_ERRNO_TSK_ALLOC_SECURE_FAILED LOS_ERRNO_OS_ERROR(LOS_MOD_TSK, 0x29)
482#define LOS_ERRNO_TSK_FREE_SECURE_FAILED LOS_ERRNO_OS_ERROR(LOS_MOD_TSK, 0x2a)
492#define LOS_ERRNO_TSK_NOT_ALLOW_IN_INT LOS_ERRNO_OS_ERROR(LOS_MOD_TSK, 0x2b)
502#define LOS_ERRNO_TSK_SCHED_LOCKED LOS_ERRNO_OS_ERROR(LOS_MOD_TSK, 0x2c)
512#define LOS_ERRNO_TSK_ALREADY_JOIN LOS_ERRNO_OS_ERROR(LOS_MOD_TSK, 0x2d)
522#define LOS_ERRNO_TSK_IS_DETACHED LOS_ERRNO_OS_ERROR(LOS_MOD_TSK, 0x2e)
532#define LOS_ERRNO_TSK_NOT_JOIN_SELF LOS_ERRNO_OS_ERROR(LOS_MOD_TSK, 0x2f)
542#define LOS_ERRNO_TSK_IS_ZOMBIE LOS_ERRNO_OS_ERROR(LOS_MOD_TSK, 0x30)
551#define LOS_TASK_MIN_STACK_SIZE (LOS_Align(KERNEL_TSK_MIN_STACK_SIZE, LOSCFG_STACK_POINT_ALIGN_SIZE))
553#ifdef LOSCFG_BASE_CORE_TSK_MONITOR
586extern VOID LOS_TaskSwitchHookReg(TSKSWITCHHOOK hook);
608#ifdef LOSCFG_OBSOLETE_API
625#ifdef LOSCFG_OBSOLETE_API
634#ifdef LOSCFG_KERNEL_SMP
654#define LOS_TASK_NAMELEN 32
681#ifdef LOSCFG_TASK_STACK_STATIC_ALLOCATION
787#ifdef LOSCFG_TASK_STACK_DYNAMIC_ALLOCATION
1328#ifdef LOSCFG_OBSOLETE_API
1329 #define LOS_TASK_PARAM_INIT_ARG_0(initParam, arg) \
1330 (initParam.auwArgs[0] = (UINTPTR)(arg))
1331 #define LOS_TASK_PARAM_INIT_ARG(initParam, arg) LOS_TASK_PARAM_INIT_ARG_0(initParam, arg)
1333 #define LOS_TASK_PARAM_INIT_ARG(initParam, arg) \
1334 (initParam.pArgs = (VOID *)(arg))
1411#ifdef LOSCFG_TRUSTZONE
TaskAttrBits
Definition los_task.h:68
UINT32 LOS_TaskResume(UINT32 taskId)
Resume a task.
UINT32 LOS_TaskSuspend(UINT32 taskId)
Suspend a task.
UINT16 LOS_TaskPriGet(UINT32 taskId)
Obtain a task priority.
void LOS_TaskResRecycle(void)
Recycle task stack resource.
UINT32 LOS_CurTaskPriSet(UINT16 taskPrio)
Set the priority of the current running task to a specified priority.
UINT32 LOS_TaskPriSet(UINT32 taskId, UINT16 taskPrio)
Set a task priority.
UINT32 LOS_TaskInfoGet(UINT32 taskId, TSK_INFO_S *taskInfo)
Obtain a task information structure.
UINT16 LOS_TaskCpuAffiGet(UINT32 taskId)
Get the affinity mask of the task scheduling cpu.
UINT32 LOS_TaskCpuAffiSet(UINT32 taskId, UINT16 usCpuAffiMask)
Set the affinity mask of the task scheduling cpu.
struct tagTskInitParam TSK_INIT_PARAM_S
BOOL LOS_TaskIsScheduled(void)
To check if the current running core is scheduled.
void *(* TSK_ENTRY_FUNC)(void *param)
Define the type of a task entrance function.
Definition los_task.h:614
UINT32 LOS_TaskDelay(UINT32 tick)
Delay a task.
UINT32 LOS_CurTaskIDGet(void)
Obtain current running task ID.
void(* IDLEHANDLERHOOK)(void)
Define the type of idle handler hook function.
Definition los_task.h:1390
UINT32 LOS_TaskDelete(UINT32 taskId)
Delete a task.
struct tagTskInfo TSK_INFO_S
UINT32 LOS_TaskJoin(UINT32 taskId, UINTPTR *retval)
Join with a terminated thread.
UINT32 LOS_TaskDetach(UINT32 taskId)
Modify the task attributes to detach.
void LOS_TaskUnlockNoSched(void)
Unlock the task scheduling and no scheduling is generated.
void LOS_LowpowerHookReg(LOWPOWERIDLEHOOK hook)
Register a hook to enter lowpower framework process.
void(* LOWPOWERIDLEHOOK)(void)
Define the lowpower framework process function type.
Definition los_task.h:1354
void LOS_IdleHandlerHookReg(IDLEHANDLERHOOK hook)
Register the hook function for idle task.
void LOS_TaskUnlock(void)
Unlock the task scheduling.
UINT32 LOS_TaskYield(void)
Change the scheduling sequence of tasks with the same priority.
void LOS_TaskLock(void)
Lock the task scheduling.
#define LOS_TASK_NAMELEN
Definition los_task.h:654
@ LOS_TASK_STATUS_JOINABLE
Definition los_task.h:71
@ LOS_TASK_STATUS_DETACHED
Definition los_task.h:74
@ LOS_TASK_OS_ALLOC_SECURE
Definition los_task.h:69
unsigned short UINT16
Definition los_typedef.h:51
#define VOID
Definition los_typedef.h:88
unsigned int UINTPTR
Definition los_typedef.h:74
unsigned int UINT32
Definition los_typedef.h:52
char CHAR
Definition los_typedef.h:58
size_t BOOL
Definition los_typedef.h:83
Definition los_event.h:164
Definition los_task.h:661
UINT16 usTaskPrio
Definition los_task.h:666
void * pTaskSem
Definition los_task.h:667
EVENT_CB_S uwEvent
Definition los_task.h:669
void * pTaskMux
Definition los_task.h:668
UINT16 usTaskStatus
Definition los_task.h:665
UINT32 uwStackSize
Definition los_task.h:671
UINTPTR uwBottomOfStack
Definition los_task.h:673
UINT32 uwPeakUsed
Definition los_task.h:676
UINT32 uwTaskID
Definition los_task.h:664
UINTPTR uwSP
Definition los_task.h:674
UINT32 uwCurrUsed
Definition los_task.h:675
BOOL bOvf
Definition los_task.h:677
CHAR acName[32]
Definition los_task.h:662
UINTPTR uwTopOfStack
Definition los_task.h:672
UINT32 uwEventMask
Definition los_task.h:670
Definition los_task.h:622
UINT16 usTaskPrio
Definition los_task.h:624
UINT32 uwStackSize
Definition los_task.h:632
CHAR * pcName
Definition los_task.h:633
TSK_ENTRY_FUNC pfnTaskEntry
Definition los_task.h:623
UINT32 uwResved
Definition los_task.h:637
void * pArgs
Definition los_task.h:630