|
WS63 SDK 文档 7021f4f@fbb_ws63
ws63 和 ws63e 解决方案的 SDK 文档
|
函数 | |
| osal_task * | osal_kthread_create (osal_kthread_handler handler, void *data, const char *name, unsigned int stack_size) |
| Provides an interface for creating a thread and invokes kthread_run for creating a kernel thread. | |
| int | osal_kthread_set_priority (osal_task *task, unsigned int priority) |
| Setting the priority of a thread. | |
| void | osal_kthread_set_affinity (osal_task *task, int cpu_mask) |
| Setting the CPU Affinity of a Task. | |
| int | osal_kthread_should_stop (void) |
| Check whether the thread is running. | |
| int | osal_kthread_wakeup_process (osal_task *task) |
| This function is used to wake up a thread. | |
| void | osal_kthread_bind (osal_task *task, unsigned int cpu) |
| Bind the created thread to run on the execution CPU core. | |
| void | osal_kthread_lock (void) |
| Lock the task scheduling. | |
| void | osal_kthread_unlock (void) |
| Unlock the task scheduling. | |
| void | osal_kthread_destroy (osal_task *task, unsigned int stop_flag) |
| Used to destroy the threads you created. | |
| void | osal_kthread_schedule (unsigned int sleep_ns) |
| In this state, it cannot be woken up by an external signal and can only be woken up by the kernel itself. | |
| void | osal_kthread_set_uninterrupt (void) |
| Set the current thread to the Task_UNINTERRUPTIBLE state. | |
| void | osal_kthread_set_running (void) |
| Set the current thread status to TASK_RUNNING. | |
| void | osal_cond_resched (void) |
| Programs running in kernel mode can call osal_cond_resched to actively give up CPU resources. | |
| void | osal_schedule (void) |
| This function put the current task back to the ready queue and try to do the schedule. | |
| void | osal_kneon_begin (void) |
| Enabling NEON Algorithm Acceleration. | |
| void | osal_kneon_end (void) |
| Disable NEON Algorithm Acceleration. | |
| void | osal_yield (void) |
| Pause the current thread. | |
| long | osal_get_current_pid (void) |
| Obtains the pid of the current thread. | |
| long | osal_get_current_tid (void) |
| Obtains the tid of the current thread. | |
| int | osal_get_current_tgid (void) |
| Obtains the tgid of the current thread. | |
| char * | osal_get_current_taskname (void) |
| Obtains the name of a thread. | |
| unsigned long | osal_msleep (unsigned int msecs) |
| sleep. | |
| void | osal_msleep_uninterruptible (unsigned int msecs) |
| sleep safely even with waitqueue interruptions. | |
| void | osal_udelay (unsigned int usecs) |
| spinning-delay in microsecond (us). | |
| void | osal_mdelay (unsigned int msecs) |
| spinning-delay in millisecond (ms). | |
| void | osal_kthread_suspend (osal_task *task) |
| Suspend a task. | |
| void | osal_kthread_resume (osal_task *task) |
| Resume a task. | |
| void osal_cond_resched | ( | void | ) |
Programs running in kernel mode can call osal_cond_resched to actively give up CPU resources.
| long osal_get_current_pid | ( | void | ) |
Obtains the pid of the current thread.
| char * osal_get_current_taskname | ( | void | ) |
Obtains the name of a thread.
| int osal_get_current_tgid | ( | void | ) |
Obtains the tgid of the current thread.
| long osal_get_current_tid | ( | void | ) |
Obtains the tid of the current thread.
| void osal_kneon_begin | ( | void | ) |
Enabling NEON Algorithm Acceleration.
| void osal_kneon_end | ( | void | ) |
Disable NEON Algorithm Acceleration.
| void osal_kthread_bind | ( | osal_task * | task, |
| unsigned int | cpu | ||
| ) |
Bind the created thread to run on the execution CPU core.
| task | [in] Thread you want to bind. |
| cpu | [in] This kernel thread is bound to the CPU. |
| osal_task * osal_kthread_create | ( | osal_kthread_handler | handler, |
| void * | data, | ||
| const char * | name, | ||
| unsigned int | stack_size | ||
| ) |
Provides an interface for creating a thread and invokes kthread_run for creating a kernel thread.
| stack_size | [in] Size of the stack space of the thread. |
| handler | [in] Functions to be processed by the thread |
| data | [in] Function handler data. |
| name | [in] Thread name displayed. |
| osal_task* | If the thread is successfully created, the pointer of the thread is returned. |
| NULL | If the thread fails to be created, NULL is returned. |
| void osal_kthread_destroy | ( | osal_task * | task, |
| unsigned int | stop_flag | ||
| ) |
Used to destroy the threads you created.
| task | [in] Threads you want to destroy. |
| stop_flag | [in] Indicates whether the current thread exits. If the value of stop_flag is 0, The current thread does not exit. The stop flag is not 0. |
| void osal_kthread_lock | ( | void | ) |
Lock the task scheduling.
| void osal_kthread_resume | ( | osal_task * | task | ) |
Resume a task.
| task | [in] Thread to be resumed. |
| void osal_kthread_schedule | ( | unsigned int | sleep_ns | ) |
In this state, it cannot be woken up by an external signal and can only be woken up by the kernel itself.
| sleep_ns | [in] Sleep time, units is nanosecond(ns). |
| void osal_kthread_set_affinity | ( | osal_task * | task, |
| int | cpu_mask | ||
| ) |
Setting the CPU Affinity of a Task.
| task | [in] Thread to change |
| cpu_mask | [in] Specifies the mask of the CPU.You can only choose one of the following OSAL_CPU_ALL, OSAL_CPU_0, OSAL_CPU_1, OSAL_CPU_2, OSAL_CPU_3. |
| int osal_kthread_set_priority | ( | osal_task * | task, |
| unsigned int | priority | ||
| ) |
Setting the priority of a thread.
| task | [in] Threads to be prioritized. |
| priority | [in] Priority to be set, It must be one of the following three priorities. OSAL_TASK_PRIORITY_HIGH, OSAL_TASK_PRIORITY_MIDDLE, OSAL_TASK_PRIORITY_LOW. |
| void osal_kthread_set_running | ( | void | ) |
Set the current thread status to TASK_RUNNING.
| void osal_kthread_set_uninterrupt | ( | void | ) |
Set the current thread to the Task_UNINTERRUPTIBLE state.
| int osal_kthread_should_stop | ( | void | ) |
Check whether the thread is running.
| 0 | If one of the current threads continues to run in the kernel. |
| 1 | If a current thread is stopped somewhere in the kernel by using kthread_stop(struct task_struct *). |
| void osal_kthread_suspend | ( | osal_task * | task | ) |
Suspend a task.
| task | [in] Thread to be suspended. |
| void osal_kthread_unlock | ( | void | ) |
Unlock the task scheduling.
| int osal_kthread_wakeup_process | ( | osal_task * | task | ) |
This function is used to wake up a thread.
| task | [in] Thread you want to wake up. |
| 0 | If the wakeup is successful, 0 is returned. |
| -1 | If the wakeup fails, -1 is returned. |
| void osal_mdelay | ( | unsigned int | msecs | ) |
spinning-delay in millisecond (ms).
| msecs | [in] Time in milliseconds to wait for. |
| unsigned long osal_msleep | ( | unsigned int | msecs | ) |
sleep.
| msecs | [in] Time in milliseconds to sleep for. |
| void osal_msleep_uninterruptible | ( | unsigned int | msecs | ) |
sleep safely even with waitqueue interruptions.
| msecs | [in] Time in milliseconds to sleep for. |
| void osal_schedule | ( | void | ) |
This function put the current task back to the ready queue and try to do the schedule.
| void osal_udelay | ( | unsigned int | usecs | ) |
spinning-delay in microsecond (us).
| usecs | [in] Time in microseconds to wait for. |
| void osal_yield | ( | void | ) |
Pause the current thread.