Sound Open Firmware
Loading...
Searching...
No Matches
scheduler_ops Struct Reference

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.
 

Detailed Description

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.

Field Documentation

◆ reschedule_task

int(* scheduler_ops::reschedule_task) (void *data, struct task *task, uint64_t start)

Reschedule an already scheduled task with an updated start delay.

Parameters
[in,out]dataPrivate state of the selected scheduler.
[in,out]taskTask descriptor to reschedule.
[in]startNew start delay in microseconds.
Returns
0 on success, negative error code on failure.

This operation is optional.

◆ schedule_task

int(* scheduler_ops::schedule_task) (void *data, struct task *task, uint64_t start, uint64_t period)

Schedule a task with the given timing parameters.

Parameters
[in,out]dataPrivate state of the selected scheduler.
[in,out]taskTask descriptor to be scheduled.
[in]startStart timing parameter (scheduler-specific, e.g. start delay or absolute tick for LL).
[in]periodRepetition 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.
Returns
0 on success, negative error code on failure.

This operation is mandatory.

◆ schedule_task_after

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.

Parameters
[in,out]dataPrivate state of the selected scheduler.
[in,out]taskTask descriptor to be scheduled.
[in]startStart timing parameter (scheduler-specific).
[in]periodRepetition period in microseconds (scheduler-specific).
[in]afterReference task after which this task must be enqueued.
Returns
0 on success, negative error code on failure.

This operation is optional.

◆ schedule_task_before

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.

Parameters
[in,out]dataPrivate state of the selected scheduler.
[in,out]taskTask descriptor to be scheduled.
[in]startStart timing parameter (scheduler-specific).
[in]periodRepetition period in microseconds (scheduler-specific).
[in]beforeReference task before which this task must be enqueued.
Returns
0 on success, negative error code on failure.

This operation is optional.

◆ schedule_task_cancel

int(* scheduler_ops::schedule_task_cancel) (void *data, struct task *task)

Cancel a previously scheduled task.

Parameters
[in,out]dataPrivate state of the selected scheduler.
[in,out]taskTask descriptor to cancel.
Returns
0 on success, negative error code on failure.

This operation is mandatory.

◆ schedule_task_free

int(* scheduler_ops::schedule_task_free) (void *data, struct task *task)

Free scheduler resources associated with a task.

Parameters
[in,out]dataPrivate state of the selected scheduler.
[in,out]taskTask descriptor whose resources are to be freed.
Returns
0 on success, negative error code on failure.

This operation is mandatory.

◆ schedule_task_running

int(* scheduler_ops::schedule_task_running) (void *data, struct task *task)

Transition a task to running state and perform scheduler-specific execution hooks.

Parameters
[in,out]dataPrivate state of the selected scheduler.
[in,out]taskTask transitioning to running state.
Returns
0 on success, negative error code on failure.

This operation is optional.

◆ scheduler_init_context

struct k_thread *(* scheduler_ops::scheduler_init_context) (void *data, struct task *task)

Initialize execution thread context for a scheduled task.

Parameters
[in,out]dataPrivate state of the selected scheduler.
[in,out]taskTask requiring dedicated execution context.
Returns
Pointer to allocated Zephyr thread object, or NULL on error or unsupported.

This operation is optional.


The documentation for this struct was generated from the following file: