Sound Open Firmware
Loading...
Searching...
No Matches
Schedule API

Data Structures

struct  scheduler_ops
 Scheduler operations. More...
struct  schedule_data
 Holds information about scheduler. More...
struct  schedulers
 Holds list of all registered schedulers. More...

Macros

#define SOF_SCHEDULER_FREE_IRQ_ONLY   BIT(0)
 Scheduler free available flags.

Enumerations

enum  {
  SOF_SCHEDULE_EDF = 0 , SOF_SCHEDULE_LL_TIMER , SOF_SCHEDULE_LL_DMA , SOF_SCHEDULE_DP ,
  SOF_SCHEDULE_TWB , SOF_SCHEDULE_COUNT
}
 Type of scheduler, comes from topology. More...

Functions

struct schedulers ** arch_schedulers_get (void)
 Retrieves registered schedulers.
struct schedulers ** arch_user_schedulers_get (void)
struct schedulers ** arch_user_schedulers_get_for_core (int core)
static void * scheduler_list_get_data (struct schedulers *schedulers, uint16_t type)
static void * scheduler_get_data (uint16_t type)
 Retrieves scheduler's data.
static void * scheduler_get_user_data (uint16_t type)
 Retrieves userspace scheduler's data.
static int schedule_task_running (struct task *task)
 See scheduler_ops::schedule_task_running.
static int schedule_task (struct task *task, uint64_t start, uint64_t period)
 See scheduler_ops::schedule_task.
static int schedule_task_before (struct task *task, uint64_t start, uint64_t period, struct task *before)
 See scheduler_ops::schedule_task_before.
static int schedule_task_after (struct task *task, uint64_t start, uint64_t period, struct task *after)
 See scheduler_ops::schedule_task_after.
static int reschedule_task (struct task *task, uint64_t start)
 See scheduler_ops::reschedule_task.
static int schedule_task_cancel (struct task *task)
 See scheduler_ops::schedule_task_cancel.
static int schedule_task_free (struct task *task)
 See scheduler_ops::schedule_task_free.
static struct k_thread * scheduler_init_context (struct task *task)
 See scheduler_ops::scheduler_init_context.
int schedule_task_init (struct task *task, const struct sof_uuid_entry *uid, uint16_t type, int16_t priority, enum task_state(*run)(void *data), void *data, uint16_t core, uint32_t flags)
 Initializes scheduling task.
void scheduler_init (int type, const struct scheduler_ops *ops, void *data)
 Initializes scheduler.
void scheduler_get_task_info (struct scheduler_props *scheduler_props, uint32_t *data_off_size, struct list_item *tasks)
 Extract scheduler's task information from tasks.

Detailed Description

Macro Definition Documentation

◆ SOF_SCHEDULER_FREE_IRQ_ONLY

#define SOF_SCHEDULER_FREE_IRQ_ONLY   BIT(0)

Scheduler free available flags.

Free function disables only interrupts

Enumeration Type Documentation

◆ anonymous enum

anonymous enum

Type of scheduler, comes from topology.

Enumerator
SOF_SCHEDULE_EDF 

EDF, schedules based on task's deadline.

SOF_SCHEDULE_LL_TIMER 

Low latency timer, schedules immediately on selected timer's tick.

SOF_SCHEDULE_LL_DMA 

Low latency DMA, schedules immediately on scheduling component's DMA interrupt.

SOF_SCHEDULE_DP 

DataProcessing scheduler Scheduler based on Zephyr peemptive threads TODO: DP will become the Zephyr EDF scheduler type and will be unified with SOF_SCHEDULE_EDF for Zephyr builds current implementation of Zephyr based EDF is depreciated now.

SOF_SCHEDULE_TWB 

Tasks With Budget scheduler based on Zephyr peemptive threads for each SOF task that has pre-allocated MCPS budget renewed with every system tick.

SOF_SCHEDULE_COUNT 

indicates number of scheduler types

Function Documentation

◆ arch_schedulers_get()

struct schedulers ** arch_schedulers_get ( void )

Retrieves registered schedulers.

Returns
List of registered schedulers.

◆ arch_user_schedulers_get()

struct schedulers ** arch_user_schedulers_get ( void )

◆ arch_user_schedulers_get_for_core()

struct schedulers ** arch_user_schedulers_get_for_core ( int core)

◆ reschedule_task()

int reschedule_task ( struct task * task,
uint64_t start )
inlinestatic

◆ schedule_task()

int schedule_task ( struct task * task,
uint64_t start,
uint64_t period )
inlinestatic

◆ schedule_task_after()

int schedule_task_after ( struct task * task,
uint64_t start,
uint64_t period,
struct task * after )
inlinestatic

◆ schedule_task_before()

int schedule_task_before ( struct task * task,
uint64_t start,
uint64_t period,
struct task * before )
inlinestatic

◆ schedule_task_cancel()

int schedule_task_cancel ( struct task * task)
inlinestatic

◆ schedule_task_free()

int schedule_task_free ( struct task * task)
inlinestatic

◆ schedule_task_init()

int schedule_task_init ( struct task * task,
const struct sof_uuid_entry * uid,
uint16_t type,
int16_t priority,
enum task_state(* run )(void *data),
void * data,
uint16_t core,
uint32_t flags )

Initializes scheduling task.

Parameters
taskTask to be initialized.
uidStatically assigned task uuid.
typeSOF_SCHEDULE_ type.
priorityTask's priority.
runPointer to task's execution function.
dataPointer to task's execution data.
coreCore on which task should be run.
flagsSpecial scheduling flags.
Returns
0 if succeeded, error code otherwise.

◆ schedule_task_running()

int schedule_task_running ( struct task * task)
inlinestatic

◆ scheduler_get_data()

void * scheduler_get_data ( uint16_t type)
inlinestatic

Retrieves scheduler's data.

Parameters
typeSOF_SCHEDULE_ type.
Returns
Pointer to scheduler's data.

◆ scheduler_get_task_info()

void scheduler_get_task_info ( struct scheduler_props * scheduler_props,
uint32_t * data_off_size,
struct list_item * tasks )

Extract scheduler's task information from tasks.

Parameters
scheduler_propsStructure to be filled
data_off_sizePointer to the current size of the scheduler_props, to be updated
tasksScheduler's task list

◆ scheduler_get_user_data()

void * scheduler_get_user_data ( uint16_t type)
inlinestatic

Retrieves userspace scheduler's data.

Parameters
typeSOF_SCHEDULE_ type.
Returns
Pointer to scheduler's data.

◆ scheduler_init()

void scheduler_init ( int type,
const struct scheduler_ops * ops,
void * data )

Initializes scheduler.

Parameters
typeSOF_SCHEDULE_ type.
opsPointer to scheduler's operations.
dataScheduler's private data.

◆ scheduler_init_context()

struct k_thread * scheduler_init_context ( struct task * task)
inlinestatic

◆ scheduler_list_get_data()

void * scheduler_list_get_data ( struct schedulers * schedulers,
uint16_t type )
inlinestatic