Skip to content

Commit a439ea9

Browse files
lyakhlgirdwood
authored andcommitted
zephyr: ll-schedule: switch over to a simplified implementation
Switch SOF under Zephyr to use a simplified native low-latency scheduler implementation. Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
1 parent 83f86de commit a439ea9

File tree

5 files changed

+483
-2
lines changed

5 files changed

+483
-2
lines changed

src/include/sof/schedule/ll_schedule.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,24 @@ struct ll_task_pdata {
3434
uint16_t skip_cnt; /**< how many times the task was skipped for execution */
3535
};
3636

37+
#ifndef __ZEPHYR__
3738
int scheduler_init_ll(struct ll_schedule_domain *domain);
3839

3940
int schedule_task_init_ll(struct task *task,
4041
const struct sof_uuid_entry *uid, uint16_t type,
4142
uint16_t priority, enum task_state (*run)(void *data),
4243
void *data, uint16_t core, uint32_t flags);
44+
#else
45+
int zephyr_ll_scheduler_init(struct ll_schedule_domain *domain);
46+
47+
int zephyr_ll_task_init(struct task *task,
48+
const struct sof_uuid_entry *uid, uint16_t type,
49+
uint16_t priority, enum task_state (*run)(void *data),
50+
void *data, uint16_t core, uint32_t flags);
51+
52+
#define scheduler_init_ll zephyr_ll_scheduler_init
53+
#define schedule_task_init_ll zephyr_ll_task_init
54+
55+
#endif
4356

4457
#endif /* __SOF_SCHEDULE_LL_SCHEDULE_H__ */

src/include/sof/schedule/ll_schedule_domain.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
#include <stdbool.h>
2323
#include <stdint.h>
2424

25+
#define LL_TIMER_PERIOD_US 1000ULL /* default period in microseconds */
26+
2527
struct dma;
2628
struct ll_schedule_domain;
2729
struct task;

src/schedule/zephyr_domain.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@
3434

3535
#define ZEPHYR_LL_STACK_SIZE 8192
3636

37-
#define LL_TIMER_PERIOD_US 1000ULL /* period in microseconds */
3837
#define LL_TIMER_PERIOD_TICKS (CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC * LL_TIMER_PERIOD_US / 1000000ULL)
3938

4039
K_KERNEL_STACK_ARRAY_DEFINE(ll_sched_stack, CONFIG_CORE_COUNT, ZEPHYR_LL_STACK_SIZE);

0 commit comments

Comments
 (0)