结构体 | |
struct | OsTaskRobin |
struct | UserTaskParam |
struct | tagTskInitParam |
struct | tagTskInfo |
类型定义 | |
typedef VOID *(* | TSK_ENTRY_FUNC) (UINTPTR param1, UINTPTR param2, UINTPTR param3, UINTPTR param4) |
Define the type of a task entrance function. 更多... | |
typedef struct tagTskInitParam | TSK_INIT_PARAM_S |
typedef struct tagTskInfo | TSK_INFO_S |
函数 | |
UINT32 | OsStackWaterLineGet (const UINTPTR *stackBottom, const UINTPTR *stackTop, UINT32 *peakUsed) |
Get stack waterline. 更多... | |
UINT32 | LOS_TaskCreateOnly (UINT32 *taskID, TSK_INIT_PARAM_S *initParam) |
Create a task and suspend. 更多... | |
UINT32 | LOS_TaskCreate (UINT32 *taskID, TSK_INIT_PARAM_S *initParam) |
Create a task. 更多... | |
UINT32 | LOS_TaskResume (UINT32 taskID) |
Resume a task. 更多... | |
UINT32 | LOS_TaskSuspend (UINT32 taskID) |
Suspend a task. 更多... | |
UINT32 | LOS_TaskDelete (UINT32 taskID) |
Delete a task. 更多... | |
UINT32 | LOS_TaskDelay (UINT32 tick) |
Delay a task. 更多... | |
VOID | LOS_TaskLock (VOID) |
Lock the task scheduling. 更多... | |
VOID | LOS_TaskUnlock (VOID) |
Unlock the task scheduling. 更多... | |
UINT32 | LOS_TaskPriSet (UINT32 taskID, UINT16 taskPrio) |
Set a task priority. 更多... | |
UINT32 | LOS_CurTaskPriSet (UINT16 taskPrio) |
Set the priority of the current running task to a specified priority. 更多... | |
UINT32 | LOS_TaskYield (VOID) |
Change the scheduling sequence of tasks with the same priority. 更多... | |
UINT16 | LOS_TaskPriGet (UINT32 taskID) |
Obtain a task priority. 更多... | |
UINT32 | LOS_CurTaskIDGet (VOID) |
Obtain current running task ID. 更多... | |
UINT32 | LOS_GetSystemTaskMaximum (VOID) |
Gets the maximum number of threads supported by the system. 更多... | |
UINT32 | LOS_TaskInfoGet (UINT32 taskID, TSK_INFO_S *taskInfo) |
Obtain a task information structure. 更多... | |
UINT32 | LOS_TaskCpuAffiSet (UINT32 uwTaskID, UINT16 usCpuAffiMask) |
Set the affinity mask of the task scheduling cpu. 更多... | |
UINT16 | LOS_TaskCpuAffiGet (UINT32 taskID) |
Get the affinity mask of the task scheduling cpu. 更多... | |
INT32 | LOS_GetTaskScheduler (INT32 taskID) |
Get the scheduling policy for the task. 更多... | |
INT32 | LOS_SetTaskScheduler (INT32 taskID, UINT16 policy, UINT16 priority) |
Set the scheduling policy and priority for the task. 更多... | |
VOID | LOS_Schedule (VOID) |
Trigger active task scheduling. 更多... | |
UINT32 | LOS_TaskJoin (UINT32 taskID, UINTPTR *retval) |
Wait for the specified task to finish and reclaim its resources. 更多... | |
UINT32 | LOS_TaskDetach (UINT32 taskID) |
Change the joinable attribute of the task to detach. 更多... | |
变量 | |
UINT32 | g_taskMaxNum |
任务最大数量 默认128个 更多... | |
LosTaskCB * | g_taskCBArray |
外部变量 任务池 默认128个 更多... | |
Define the type of a task entrance function.
param1 | [IN] Type UINTPTR The first parameter passed to the task handling function. |
param2 | [IN] Type UINTPTR The second parameter passed to the task handling function. |
param3 | [IN] Type UINTPTR The third parameter passed to the task handling function. |
param4 | [IN] Type UINTPTR The fourth parameter passed to the task handling function. |
None. |
在文件 los_task.h 第 480 行定义.
typedef struct tagTskInfo TSK_INFO_S |
Task information structure.
typedef struct tagTskInitParam TSK_INIT_PARAM_S |
Define the structure of the parameters used for task creation.
Information of specified parameters passed in during task creation.
UINT32 LOS_CurTaskIDGet | ( | VOID | ) |
Obtain current running task ID.
#LOS_ERRNO_TSK_ID_INVALID | Invalid Task ID. |
UINT32 | Task ID. |
在文件 los_task.c 第 331 行定义.
Set the priority of the current running task to a specified priority.
taskPrio | [IN] Type UINT16 Task priority. |
#LOS_ERRNO_TSK_PRIOR_ERROR | Incorrect task priority.Re-configure the task priority |
#LOS_ERRNO_TSK_OPERATE_IDLE | Check the task ID and do not operate on the idle task. |
#LOS_ERRNO_TSK_ID_INVALID | Invalid Task ID |
#LOS_ERRNO_TSK_NOT_CREATED | The task is not created. |
#LOS_OK | The priority of the current running task is successfully set to a specified priority. |
Set the priority of the current running task to a specified priority.
在文件 los_task.c 第 1109 行定义.
UINT32 LOS_GetSystemTaskMaximum | ( | VOID | ) |
Gets the maximum number of threads supported by the system.
None. |
在文件 los_task.c 第 1637 行定义.
Get the scheduling policy for the task.
taskID | [IN] Type UINT32 Task ID. The task id value is obtained from task creation. |
#-LOS_ESRCH | Invalid task id. |
#-LOS_EPERM | The process is not currently running. |
INT32 | the scheduling policy. |
Get the scheduling policy for the task.
在文件 los_task.c 第 1467 行定义.
VOID LOS_Schedule | ( | VOID | ) |
Trigger active task scheduling.
None |
Nobe |
在文件 los_sched.c 第 469 行定义.
Set the scheduling policy and priority for the task.
taskID | [IN] Type UINT32 Task ID. The task id value is obtained from task creation. |
policy | [IN] Type UINT16 Task scheduling policy. |
priority | [IN] Type UINT16 Task scheduling priority. |
-LOS_ESRCH | Invalid task id. |
-LOS_EOPNOTSUPP | Unsupported fields. |
-LOS_EPERM | The process is not currently running. |
#0 | Set up the success. |
在文件 los_task.c 第 1493 行定义.
Get the affinity mask of the task scheduling cpu.
taskID | [IN] Type UINT32 Task ID. The task id value is obtained from task creation. |
#0 | The cpu affinity mask fails to be obtained. |
UINT16 | The scheduling cpu mask. The low to high bit of the mask corresponds to the cpu number. |
Get the affinity mask of the task scheduling cpu.
在文件 los_task.c 第 1263 行定义.
Set the affinity mask of the task scheduling cpu.
uwTaskID | [IN] Type UINT32 Task ID. The task id value is obtained from task creation. |
usCpuAffiMask | [IN] Type UINT32 The scheduling cpu mask.The low to high bit of the mask corresponds to the cpu number, the high bit that exceeding the CPU number is ignored. |
#LOS_ERRNO_TSK_ID_INVALID | Invalid task ID. |
#LOS_ERRNO_TSK_NOT_CREATED | The task is not created. |
#LOS_ERRNO_TSK_CPU_AFFINITY_MASK_ERR | The task cpu affinity mask is incorrect. |
#LOS_OK | The task cpu affinity mask is successfully setted. |
在文件 los_task.c 第 1231 行定义.
UINT32 LOS_TaskCreate | ( | UINT32 * | taskID, |
TSK_INIT_PARAM_S * | initParam | ||
) |
Create a task.
taskID | [OUT] Type UINT32 * Task ID. |
initParam | [IN] Type TSK_INIT_PARAM_S * Parameter for task creation. |
#LOS_ERRNO_TSK_ID_INVALID | Invalid Task ID, param taskID is NULL. |
#LOS_ERRNO_TSK_PTR_NULL | Param initParam is NULL. |
#LOS_ERRNO_TSK_NAME_EMPTY | The task name is NULL. |
#LOS_ERRNO_TSK_ENTRY_NULL | The task entrance is NULL. |
#LOS_ERRNO_TSK_PRIOR_ERROR | Incorrect task priority. |
#LOS_ERRNO_TSK_STKSZ_TOO_LARGE | The task stack size is too large. |
#LOS_ERRNO_TSK_STKSZ_TOO_SMALL | The task stack size is too small. |
#LOS_ERRNO_TSK_TCB_UNAVAILABLE | No free task control block is available. |
#LOS_ERRNO_TSK_NO_MEMORY | Insufficient memory for task creation. |
#LOS_OK | The task is successfully created. |
Create a task.
在文件 los_task.c 第 718 行定义.
UINT32 LOS_TaskCreateOnly | ( | UINT32 * | taskID, |
TSK_INIT_PARAM_S * | initParam | ||
) |
Create a task and suspend.
taskID | [OUT] Type UINT32 * Task ID. |
initParam | [IN] Type TSK_INIT_PARAM_S * Parameter for task creation. |
#LOS_ERRNO_TSK_ID_INVALID | Invalid Task ID, param taskID is NULL. |
#LOS_ERRNO_TSK_PTR_NULL | Param initParam is NULL. |
#LOS_ERRNO_TSK_NAME_EMPTY | The task name is NULL. |
#LOS_ERRNO_TSK_ENTRY_NULL | The task entrance is NULL. |
#LOS_ERRNO_TSK_PRIOR_ERROR | Incorrect task priority. |
#LOS_ERRNO_TSK_STKSZ_TOO_LARGE | The task stack size is too large. |
#LOS_ERRNO_TSK_STKSZ_TOO_SMALL | The task stack size is too small. |
#LOS_ERRNO_TSK_TCB_UNAVAILABLE | No free task control block is available. |
#LOS_ERRNO_TSK_NO_MEMORY | Insufficient memory for task creation. |
#LOS_OK | The task is successfully created. |
Create a task and suspend.
initParam | |
taskID |
在文件 los_task.c 第 663 行定义.
Delay a task.
tick | [IN] Type UINT32 Number of Ticks for which the task is delayed. |
#LOS_ERRNO_TSK_DELAY_IN_INT | The task delay occurs during an interrupt. |
#LOS_ERRNO_TSK_DELAY_IN_LOCK | The task delay occurs when the task scheduling is locked. |
#LOS_ERRNO_TSK_ID_INVALID | Invalid Task ID |
#LOS_ERRNO_TSK_YIELD_NOT_ENOUGH_TASK | No tasks with the same priority is available for scheduling. |
#LOS_OK | The task is successfully delayed. |
Delay a task.
在文件 los_task.c 第 1020 行定义.
Delete a task.
taskID | [IN] Type UINT32 Task ID. The task id value is obtained from task creation. |
#LOS_ERRNO_TSK_OPERATE_IDLE | Check the task ID and do not operate on the idle task. |
#LOS_ERRNO_TSK_SUSPEND_SWTMR_NOT_ALLOWED | Check the task ID and do not operate on the swtmr task. |
#LOS_ERRNO_TSK_ID_INVALID | Invalid Task ID |
#LOS_ERRNO_TSK_NOT_CREATED | The task is not created. |
#LOS_ERRNO_TSK_DELETE_LOCKED | The task being deleted is current task and task scheduling is locked. |
#LOS_OK | The task is successfully deleted. |
在文件 los_task.c 第 968 行定义.
Change the joinable attribute of the task to detach.
taskID | [IN] task ID. |
LOS_OK | successful |
LOS_EINVAL | Invalid parameter or invalid operation |
LOS_EINTR | Disallow calls in interrupt handlers |
LOS_EPERM | Waiting tasks and calling tasks do not belong to the same process |
LOS_ESRCH | Cannot modify the Joinable attribute of a task that is waiting for completion. |
在文件 los_task.c 第 1601 行定义.
UINT32 LOS_TaskInfoGet | ( | UINT32 | taskID, |
TSK_INFO_S * | taskInfo | ||
) |
Obtain a task information structure.
taskID | [IN] Type UINT32 Task ID. The task id value is obtained from task creation. |
taskInfo | [OUT] Type TSK_INFO_S* Pointer to the task information structure to be obtained. |
#LOS_ERRNO_TSK_PTR_NULL | Null parameter. |
#LOS_ERRNO_TSK_ID_INVALID | Invalid task ID. |
#LOS_ERRNO_TSK_NOT_CREATED | The task is not created. |
#LOS_OK | The task information structure is successfully obtained. |
在文件 los_task.c 第 1161 行定义.
Wait for the specified task to finish and reclaim its resources.
taskID | [IN] task ID. |
retval | [OUT] wait for the return value of the task. |
LOS_OK | successful |
LOS_EINVAL | Invalid parameter or invalid operation |
LOS_EINTR | Disallow calls in interrupt handlers |
LOS_EPERM | Waiting tasks and calling tasks do not belong to the same process |
LOS_EDEADLK | The waiting task is the same as the calling task |
在文件 los_task.c 第 1561 行定义.
VOID LOS_TaskLock | ( | VOID | ) |
Lock the task scheduling.
None. |
None. |
在文件 los_task.c 第 1139 行定义.
Obtain a task priority.
taskID | [IN] Type UINT32 Task ID. The task id value is obtained from task creation. |
#OS_INVALID | The task priority fails to be obtained. |
UINT16 | The task priority. |
Obtain a task priority.
在文件 los_task.c 第 1050 行定义.
Set a task priority.
taskID | [IN] Type UINT32 Task ID. The task id value is obtained from task creation. |
taskPrio | [IN] Type UINT16 Task priority. |
#LOS_ERRNO_TSK_PRIOR_ERROR | Incorrect task priority.Re-configure the task priority |
#LOS_ERRNO_TSK_OPERATE_IDLE | Check the task ID and do not operate on the idle task. |
#LOS_ERRNO_TSK_ID_INVALID | Invalid Task ID |
#LOS_ERRNO_TSK_NOT_CREATED | The task is not created. |
#LOS_OK | The task priority is successfully set to a specified priority. |
Set a task priority.
在文件 los_task.c 第 1071 行定义.
Resume a task.
taskID | [IN] Type UINT32 Task ID. The task id value is obtained from task creation. |
#LOS_ERRNO_TSK_ID_INVALID | Invalid Task ID |
#LOS_ERRNO_TSK_NOT_CREATED | The task is not created. |
#LOS_ERRNO_TSK_NOT_SUSPENDED | The task is not suspended. |
#LOS_OK | The task is successfully resumed. |
Resume a task.
在文件 los_task.c 第 758 行定义.
Suspend a task.
taskID | [IN] Type UINT32 Task ID. The task id value is obtained from task creation. |
#LOS_ERRNO_TSK_OPERATE_IDLE | Check the task ID and do not operate on the idle task. |
#LOS_ERRNO_TSK_SUSPEND_SWTMR_NOT_ALLOWED | Check the task ID and do not operate on the swtmr task. |
#LOS_ERRNO_TSK_ID_INVALID | Invalid Task ID |
#LOS_ERRNO_TSK_NOT_CREATED | The task is not created. |
#LOS_ERRNO_TSK_ALREADY_SUSPENDED | The task is already suspended. |
#LOS_ERRNO_TSK_SUSPEND_LOCKED | The task being suspended is current task and task scheduling is locked. |
#LOS_OK | The task is successfully suspended. |
Suspend a task.
在文件 los_task.c 第 855 行定义.
VOID LOS_TaskUnlock | ( | VOID | ) |
Unlock the task scheduling.
None. |
None. |
在文件 los_task.c 第 1148 行定义.
UINT32 LOS_TaskYield | ( | VOID | ) |
Change the scheduling sequence of tasks with the same priority.
None. |
#LOS_ERRNO_TSK_ID_INVALID | Invalid Task ID |
#LOS_ERRNO_TSK_YIELD_NOT_ENOUGH_TASK | No tasks with the same priority is available for scheduling. |
#LOS_OK | The scheduling sequence of tasks with same priority is successfully changed. |
在文件 los_task.c 第 1115 行定义.
UINT32 OsStackWaterLineGet | ( | const UINTPTR * | stackBottom, |
const UINTPTR * | stackTop, | ||
UINT32 * | peakUsed | ||
) |
Get stack waterline.
stackBottom | [IN] Type #const UINTPTR * pointer to stack bottom. |
stackTop | [IN] Type #const UINTPTR * pointer to stack top. |
peakUsed | [OUT] Type UINT32 * stack waterline. |
#LOS_NOK | stack overflow |
#LOS_OK | stack is normal, not overflow |
Get stack waterline.
在文件 los_stackinfo.c 第 70 行定义.
|
extern |
|
extern |