Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 21 additions & 7 deletions src/include/sof/schedule/schedule.h
Original file line number Diff line number Diff line change
Expand Up @@ -186,14 +186,8 @@ struct schedulers **arch_user_schedulers_get(void);

struct schedulers **arch_user_schedulers_get_for_core(int core);

/**
* Retrieves scheduler's data.
* @param type SOF_SCHEDULE_ type.
* @return Pointer to scheduler's data.
*/
static inline void *scheduler_get_data(uint16_t type)
static inline void *scheduler_list_get_data(struct schedulers *schedulers, uint16_t type)
{
struct schedulers *schedulers = *arch_schedulers_get();
struct schedule_data *sch;
struct list_item *slist;

Expand All @@ -209,6 +203,26 @@ static inline void *scheduler_get_data(uint16_t type)
return NULL;
}

/**
* Retrieves scheduler's data.
* @param type SOF_SCHEDULE_ type.
* @return Pointer to scheduler's data.
*/
static inline void *scheduler_get_data(uint16_t type)
{
return scheduler_list_get_data(*arch_schedulers_get(), type);
}

/**
* Retrieves userspace scheduler's data.
* @param type SOF_SCHEDULE_ type.
* @return Pointer to scheduler's data.
*/
static inline void *scheduler_get_user_data(uint16_t type)
{
return scheduler_list_get_data(*arch_user_schedulers_get(), type);
}
Comment on lines +216 to +224

/** See scheduler_ops::schedule_task_running */
static inline int schedule_task_running(struct task *task)
{
Expand Down
10 changes: 9 additions & 1 deletion src/schedule/zephyr_ll.c
Original file line number Diff line number Diff line change
Expand Up @@ -889,9 +889,13 @@ void scheduler_get_task_info_ll(struct scheduler_props *scheduler_props,
uint32_t *data_off_size)
{
uint32_t flags;
#if CONFIG_SOF_USERSPACE_LL
struct zephyr_ll *ll_sch = scheduler_get_user_data(SOF_SCHEDULE_LL_TIMER);
#else
struct zephyr_ll *ll_sch = scheduler_get_data(SOF_SCHEDULE_LL_TIMER);
#endif

scheduler_props->processing_domain = COMP_PROCESSING_DOMAIN_LL;
struct zephyr_ll *ll_sch = scheduler_get_data(SOF_SCHEDULE_LL_TIMER);

zephyr_ll_lock(ll_sch, &flags);
scheduler_get_task_info(scheduler_props, data_off_size, &ll_sch->tasks);
Expand All @@ -901,7 +905,11 @@ void scheduler_get_task_info_ll(struct scheduler_props *scheduler_props,
/* Return a pointer to the LL scheduler timer domain */
struct ll_schedule_domain *zephyr_ll_domain(void)
{
#if CONFIG_SOF_USERSPACE_LL
struct zephyr_ll *ll_sch = scheduler_get_user_data(SOF_SCHEDULE_LL_TIMER);
#else
struct zephyr_ll *ll_sch = scheduler_get_data(SOF_SCHEDULE_LL_TIMER);
#endif

return ll_sch ? ll_sch->ll_domain : NULL;
}
Loading