|
Sound Open Firmware
|
Scheduler operations interface table. More...
#include <src/include/sof/schedule/schedule.h>
Data Fields | |
| int(* | schedule_task )(void *data, struct task *task, uint64_t start, uint64_t period) |
| Schedule a task with the given timing parameters. | |
| int(* | schedule_task_before )(void *data, struct task *task, uint64_t start, uint64_t period, struct task *before) |
| Schedule a task to execute before a specified reference task. | |
| int(* | schedule_task_after )(void *data, struct task *task, uint64_t start, uint64_t period, struct task *after) |
| Schedule a task to execute after a specified reference task. | |
| int(* | schedule_task_running )(void *data, struct task *task) |
| Transition a task to running state and perform scheduler-specific execution hooks. | |
| int(* | reschedule_task )(void *data, struct task *task, uint64_t start) |
| Reschedule an already scheduled task with an updated start delay. | |
| int(* | schedule_task_cancel )(void *data, struct task *task) |
| Cancel a previously scheduled task. | |
| int(* | schedule_task_free )(void *data, struct task *task) |
| Free scheduler resources associated with a task. | |
| struct k_thread *(* | scheduler_init_context )(void *data, struct task *task) |
| Initialize execution thread context for a scheduled task. | |
Scheduler operations interface table.
Schedulers implement this interface to plug into the unified SOF scheduling abstraction. Almost all schedule operations must return 0 for success and negative values for errors. Only the optional scheduler_free operation returns void.
Reschedule an already scheduled task with an updated start delay.
| [in,out] | data | Private state of the selected scheduler. |
| [in,out] | task | Task descriptor to reschedule. |
| [in] | start | New start delay in microseconds. |
This operation is optional.
| int(* scheduler_ops::schedule_task) (void *data, struct task *task, uint64_t start, uint64_t period) |
Schedule a task with the given timing parameters.
| [in,out] | data | Private state of the selected scheduler. |
| [in,out] | task | Task descriptor to be scheduled. |
| [in] | start | Start timing parameter (scheduler-specific, e.g. start delay or absolute tick for LL). |
| [in] | period | Repetition period in microseconds for periodic schedulers (such as LL, where 0 denotes one-shot). Schedulers such as DP and TWB ignore this parameter as rescheduling is governed by the task's returned execution state. |
This operation is mandatory.
| int(* scheduler_ops::schedule_task_after) (void *data, struct task *task, uint64_t start, uint64_t period, struct task *after) |
Schedule a task to execute after a specified reference task.
| [in,out] | data | Private state of the selected scheduler. |
| [in,out] | task | Task descriptor to be scheduled. |
| [in] | start | Start timing parameter (scheduler-specific). |
| [in] | period | Repetition period in microseconds (scheduler-specific). |
| [in] | after | Reference task after which this task must be enqueued. |
This operation is optional.
| int(* scheduler_ops::schedule_task_before) (void *data, struct task *task, uint64_t start, uint64_t period, struct task *before) |
Schedule a task to execute before a specified reference task.
| [in,out] | data | Private state of the selected scheduler. |
| [in,out] | task | Task descriptor to be scheduled. |
| [in] | start | Start timing parameter (scheduler-specific). |
| [in] | period | Repetition period in microseconds (scheduler-specific). |
| [in] | before | Reference task before which this task must be enqueued. |
This operation is optional.
Cancel a previously scheduled task.
| [in,out] | data | Private state of the selected scheduler. |
| [in,out] | task | Task descriptor to cancel. |
This operation is mandatory.
Free scheduler resources associated with a task.
| [in,out] | data | Private state of the selected scheduler. |
| [in,out] | task | Task descriptor whose resources are to be freed. |
This operation is mandatory.
Transition a task to running state and perform scheduler-specific execution hooks.
| [in,out] | data | Private state of the selected scheduler. |
| [in,out] | task | Task transitioning to running state. |
This operation is optional.
Initialize execution thread context for a scheduled task.
| [in,out] | data | Private state of the selected scheduler. |
| [in,out] | task | Task requiring dedicated execution context. |
This operation is optional.