Tsk Task Management Module
The Tsk module provides a series of functions that access and manage task objects through Tsk_handle handles. The Dsp/bios task management module runs according to the priority of the task object and switches from one task to another by switching functions.
Each task has four execution states: Run, Ready (Ready), paused (blocked), and terminated. Once a task is created, it is always in one of four states.
The Dsp/bios can also define one or more hook functions, which will run whenever the state of the task States changes.
In addition, the user can define a toggle function that will be invoked when the new task becomes a running state. The toggle function allows the application to access the current and next task object handles between task transformations.
TSK Module API functions:
Tsk_checkstatcks: Check the task stack
Tsk_create: Create a new task
Tsk_delete: Delete Task
Tsk_deltatime: Updated task Time Statistics parameters
Tsk_disable: Disable Dsp/bios kernel for task management scheduling
Tsk_enable: Allow Dsp/bios kernel to perform task management scheduling
Tsk_exit: Terminates running of the current task
TSK_GETNV: Returns the environment variable for a task
Tsk_geterr: Return task error code
Tsk_getname: Returns the name of the task
TSK_GETPRI: Returns the priority level of a task
Tsk_getsts: Returns the statistic results of a task from the STS module
Tsk_itick: System Alarm clock plus 1 (for interrupts only)
Tsk_self: Returns the handle to the current task
TSK_SETNV: Setting environment Variables for tasks
Tsk_seterr: Set the error code for the task
TSK_SETPRI: Set the priority of a task
Tsk_settime: Set the start time for task statistics
Tsk_sleep: Delay Execution of current task
Tsk_stat: Returns the status parameters of a task
Tsk_tick: System Alarm Clock plus 1
Tsk_time: Returns the system clock for the task
Tsk_yield: Switch to next task
2.HOOK hook Function Management module
The hook module is an extension of the task management module, allowing us to perform multiple hook functions at important execution points. Each Hook object has a dedicated data area reserved for each task that uses the hook function. The hook function can be invoked when the program is initialized or when the task function runs.
The hook module manages a set of objects that involve a hook function. During Dsp/bios initialization, each hook object is assigned a numeric identifier. Each hook module has an initialization function that runs before the hook function call. When the initialization function is invoked, the Dsp/bois kernel passes the identifier of the hook object to the initialization function as a parameter.
3.IDL Module--dsp/bios admin, lowest level thread, IDL module executes Dsp/bios API function, Dsp/bios kernel really utilizes these functions to handle communication with host and CPU load calculation.
The IDL module provides only one API function:
Idl_run: All IDL functions defined by the IDL module are executed at once, which returns after all IDL functions have been executed once.