Skip to content

Commit

Permalink
edf_schedule: do not pass sof structure anymore
Browse files Browse the repository at this point in the history
Changes scheduler_init_edf and task_main_init function
definitions as sof structure is no longer needed. It was
only used to pass agent object to main idle task.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
  • Loading branch information
tlauda committed Oct 24, 2019
1 parent f3253eb commit 368a739
Show file tree
Hide file tree
Showing 11 changed files with 14 additions and 16 deletions.
2 changes: 1 addition & 1 deletion src/arch/xtensa/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ int slave_core_init(struct sof *sof)
platform_interrupt_init();

trace_point(TRACE_BOOT_PLATFORM_SCHED);
scheduler_init_edf(sof);
scheduler_init_edf();
scheduler_init_ll(platform_timer_domain);
scheduler_init_ll(platform_dma_domain);

Expand Down
4 changes: 1 addition & 3 deletions src/include/sof/schedule/edf_schedule.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@
#include <user/trace.h>
#include <stdint.h>

struct sof;

/* schedule tracing */
#define trace_edf_sch(format, ...) \
trace_event(TRACE_CLASS_EDF, format, ##__VA_ARGS__)
Expand All @@ -35,6 +33,6 @@ struct edf_task_pdata {
void *ctx;
};

int scheduler_init_edf(struct sof *sof);
int scheduler_init_edf(void);

#endif /* __SOF_SCHEDULE_EDF_SCHEDULE_H__ */
2 changes: 1 addition & 1 deletion src/include/sof/schedule/task.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ enum task_state task_main_master_core(void *data);

enum task_state task_main_slave_core(void *data);

void task_main_init(struct sof *sof);
void task_main_init(void);

void task_main_free(void);

Expand Down
2 changes: 1 addition & 1 deletion src/platform/baytrail/platform.c
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ int platform_init(struct sof *sof)
clock_init();

trace_point(TRACE_BOOT_PLATFORM_SCHED);
scheduler_init_edf(sof);
scheduler_init_edf();

/* init low latency timer domain and scheduler */
platform_timer_domain =
Expand Down
2 changes: 1 addition & 1 deletion src/platform/haswell/platform.c
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ int platform_init(struct sof *sof)
clock_init();

trace_point(TRACE_BOOT_PLATFORM_SCHED);
scheduler_init_edf(sof);
scheduler_init_edf();

/* init low latency timer domain and scheduler */
platform_timer_domain =
Expand Down
2 changes: 1 addition & 1 deletion src/platform/imx8/platform.c
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ int platform_init(struct sof *sof)

platform_interrupt_init();
clock_init();
scheduler_init_edf(sof);
scheduler_init_edf();

/* init low latency domains and schedulers */
platform_timer_domain =
Expand Down
2 changes: 1 addition & 1 deletion src/platform/intel/cavs/platform.c
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ int platform_init(struct sof *sof)
clock_init();

trace_point(TRACE_BOOT_PLATFORM_SCHED);
scheduler_init_edf(sof);
scheduler_init_edf();

/* init low latency timer domain and scheduler */
platform_timer_domain =
Expand Down
4 changes: 2 additions & 2 deletions src/schedule/edf_schedule.c
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ static void schedule_edf_task_free(void *data, struct task *task)
irq_local_enable(flags);
}

int scheduler_init_edf(struct sof *sof)
int scheduler_init_edf(void)
{
struct edf_schedule_data *edf_sch;

Expand All @@ -272,7 +272,7 @@ int scheduler_init_edf(struct sof *sof)
scheduler_init(SOF_SCHEDULE_EDF, &schedule_edf_ops, edf_sch);

/* initialize main task context before enabling interrupt */
task_main_init(sof);
task_main_init();

/* configure EDF scheduler interrupt */
edf_sch->irq = interrupt_get_irq(PLATFORM_SCHEDULE_IRQ,
Expand Down
6 changes: 3 additions & 3 deletions src/schedule/task.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ enum task_state task_main_master_core(void *data)
return SOF_TASK_STATE_COMPLETED;
}

void task_main_init(struct sof *sof)
void task_main_init(void)
{
struct task **main_task = task_main_get();
int cpu = cpu_get_id();
Expand All @@ -63,8 +63,8 @@ void task_main_init(struct sof *sof)
*main_task = rzalloc(RZONE_SYS, SOF_MEM_CAPS_RAM, sizeof(**main_task));

assert(!schedule_task_init(*main_task, SOF_SCHEDULE_EDF,
SOF_TASK_PRI_IDLE, main_main, NULL, sof, cpu,
SOF_SCHEDULE_FLAG_IDLE));
SOF_TASK_PRI_IDLE, main_main, NULL, NULL,
cpu, SOF_SCHEDULE_FLAG_IDLE));
}

void task_main_free(void)
Expand Down
2 changes: 1 addition & 1 deletion tools/testbench/common_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ int tb_pipeline_setup(struct sof *sof)
}

/* init scheduler */
if (scheduler_init_edf(sof) < 0) {
if (scheduler_init_edf() < 0) {
fprintf(stderr, "error: edf scheduler init\n");
return -EINVAL;
}
Expand Down
2 changes: 1 addition & 1 deletion tools/testbench/edf_schedule.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ static int schedule_edf_task_init(void *data, struct task *task)
}

/* initialize scheduler */
int scheduler_init_edf(struct sof *sof)
int scheduler_init_edf(void)
{
trace_edf_sch("edf_scheduler_init()");
sch = malloc(sizeof(*sch));
Expand Down

0 comments on commit 368a739

Please sign in to comment.