9#ifndef __SOF_SCHEDULE_SCHEDULE_H__
10#define __SOF_SCHEDULE_SCHEDULE_H__
15#include <sof/trace/trace.h>
20#include <ipc4/base_fw.h>
49#define SOF_SCHEDULER_FREE_IRQ_ONLY BIT(0)
85 uint64_t period,
struct task *before);
99 uint64_t period,
struct task *after);
143#if CONFIG_SOF_BOOT_TEST_STANDALONE || CONFIG_LIBRARY
152 void (*scheduler_free)(
void *
data, uint32_t flags);
163 struct k_thread *(*scheduler_init_context)(
void *
data,
struct task *
task);
256 uint64_t period,
struct task *before)
260 if (!
task || !before)
274 uint64_t period,
struct task *after)
332#if CONFIG_SOF_BOOT_TEST_STANDALONE || CONFIG_LIBRARY
334static inline void schedule_free(uint32_t flags)
342 if (sch->
ops->scheduler_free)
343 sch->
ops->scheduler_free(sch->
data, flags);
377 void *
data, uint16_t core, uint32_t flags);
394 uint32_t *data_off_size,
struct list_item *tasks);
#define container_of(ptr, type, member)
Definition common.h:119
uint32_t data[]
Definition debug_stream_slot.h:2
static int schedule_task_before(struct task *task, uint64_t start, uint64_t period, struct task *before)
See scheduler_ops::schedule_task_before.
Definition schedule.h:255
static void * scheduler_list_get_data(struct schedulers *schedulers, uint16_t type)
Definition schedule.h:189
void scheduler_init(int type, const struct scheduler_ops *ops, void *data)
Initializes scheduler.
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.
static struct k_thread * scheduler_init_context(struct task *task)
See scheduler_ops::scheduler_init_context.
Definition schedule.h:349
static void * scheduler_get_user_data(uint16_t type)
Retrieves userspace scheduler's data.
Definition schedule.h:221
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.
static int schedule_task_free(struct task *task)
See scheduler_ops::schedule_task_free.
Definition schedule.h:319
static int reschedule_task(struct task *task, uint64_t start)
See scheduler_ops::reschedule_task.
Definition schedule.h:291
static int schedule_task_cancel(struct task *task)
See scheduler_ops::schedule_task_cancel.
Definition schedule.h:306
static int schedule_task(struct task *task, uint64_t start, uint64_t period)
See scheduler_ops::schedule_task.
Definition schedule.h:241
static int schedule_task_after(struct task *task, uint64_t start, uint64_t period, struct task *after)
See scheduler_ops::schedule_task_after.
Definition schedule.h:273
static void * scheduler_get_data(uint16_t type)
Retrieves scheduler's data.
Definition schedule.h:211
static int schedule_task_running(struct task *task)
See scheduler_ops::schedule_task_running.
Definition schedule.h:227
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)
@ SOF_SCHEDULE_LL_DMA
Low latency DMA, schedules immediately on scheduling component's DMA interrupt.
Definition schedule.h:32
@ SOF_SCHEDULE_LL_TIMER
Low latency timer, schedules immediately on selected timer's tick.
Definition schedule.h:29
@ SOF_SCHEDULE_COUNT
indicates number of scheduler types
Definition schedule.h:45
@ SOF_SCHEDULE_TWB
Tasks With Budget scheduler based on Zephyr peemptive threads for each SOF task that has pre-allocate...
Definition schedule.h:41
@ SOF_SCHEDULE_EDF
EDF, schedules based on task's deadline.
Definition schedule.h:28
@ SOF_SCHEDULE_DP
DataProcessing scheduler Scheduler based on Zephyr peemptive threads TODO: DP will become the Zephyr ...
Definition schedule.h:35
#define list_item(item, type, member)
Definition list.h:80
#define list_for_item(item, list)
Definition list.h:92
#define assert(x)
Definition panic.h:19
Holds information about scheduler.
Definition schedule.h:167
struct list_item list
list of schedulers
Definition schedule.h:168
int type
SOF_SCHEDULE_ type.
Definition schedule.h:169
void * data
pointer to private data
Definition schedule.h:171
const struct scheduler_ops * ops
scheduler operations
Definition schedule.h:170
Scheduler operations.
Definition schedule.h:59
int(* schedule_task_before)(void *data, struct task *task, uint64_t start, uint64_t period, struct task *before)
Schedules task with given scheduling parameters.
Definition schedule.h:84
int(* schedule_task_after)(void *data, struct task *task, uint64_t start, uint64_t period, struct task *after)
Schedules task with given scheduling parameters.
Definition schedule.h:98
struct k_thread *(* scheduler_init_context)(void *data, struct task *task)
Initializes context.
Definition schedule.h:163
int(* schedule_task)(void *data, struct task *task, uint64_t start, uint64_t period)
Schedules task with given scheduling parameters.
Definition schedule.h:70
int(* schedule_task_cancel)(void *data, struct task *task)
Cancels previously scheduled task.
Definition schedule.h:131
int(* schedule_task_free)(void *data, struct task *task)
Frees task's resources.
Definition schedule.h:141
int(* schedule_task_running)(void *data, struct task *task)
Sets task into running state along with executing additional scheduler specific operations.
Definition schedule.h:110
int(* reschedule_task)(void *data, struct task *task, uint64_t start)
Reschedules already scheduled task with new start time.
Definition schedule.h:121
Holds list of all registered schedulers.
Definition schedule.h:175
struct list_item list
list of schedulers
Definition schedule.h:176
Connects UUID with component description.
Definition uuid.h:77
Task used by schedulers.
Definition task.h:56
struct schedule_data * sch
scheduler bound to task
Definition task.h:63
task_state
Task states.
Definition task.h:36
uint32_t type
Definition tlv.h:0