Skip to content

Commit

Permalink
[TEST] ipc: switch IPC tak scheduler to TWB
Browse files Browse the repository at this point in the history
This will change scheduler type for IPC task

Signed-off-by: Adrian Bonislawski <[email protected]>
  • Loading branch information
abonislawski committed Jun 18, 2024
1 parent c4f7a3e commit 3f8de64
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 2 deletions.
4 changes: 4 additions & 0 deletions src/include/sof/ipc/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,11 @@ struct ipc {
struct list_item comp_list; /* list of component devices */

/* processing task */
#if CONFIG_ZEPHYR_TWB_SCHEDULER
struct task *ipc_task;
#else
struct task ipc_task;
#endif

#ifdef __ZEPHYR__
struct k_work_delayable z_delayed_work;
Expand Down
4 changes: 4 additions & 0 deletions src/ipc/ipc-common.c
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,11 @@ static void ipc_work_handler(struct k_work *work)

void ipc_schedule_process(struct ipc *ipc)
{
#if CONFIG_ZEPHYR_TWB_SCHEDULER
schedule_task(ipc->ipc_task, 0, IPC_PERIOD_USEC);
#else
schedule_task(&ipc->ipc_task, 0, IPC_PERIOD_USEC);
#endif
}

int ipc_init(struct sof *sof)
Expand Down
15 changes: 13 additions & 2 deletions src/ipc/ipc-zephyr.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
#include <sof/list.h>
#include <sof/platform.h>
#include <sof/schedule/edf_schedule.h>
#include <sof/schedule/twb_schedule.h>
#include <sof/schedule/schedule.h>
#include <rtos/task.h>
#include <rtos/spinlock.h>
Expand Down Expand Up @@ -162,9 +163,14 @@ static int ipc_device_resume_handler(const struct device *dev, void *arg)
intel_adsp_ipc_set_message_handler(INTEL_ADSP_IPC_HOST_DEV, message_handler, ipc);

/* schedule task */
#if CONFIG_ZEPHYR_TWB_SCHEDULER
scheduler_twb_task_init(&ipc->ipc_task, SOF_UUID(ipc_task_uuid),
&ipc_task_ops, ipc, 0, "IPC", ZEPHYR_TWB_STACK_SIZE,
CONFIG_TWB_THREAD_MEDIUM_PRIORITY, 5);
#else
schedule_task_init_edf(&ipc->ipc_task, SOF_UUID(ipc_task_uuid),
&ipc_task_ops, ipc, 0, 0);

#endif
return 0;
}
#endif /* CONFIG_PM_DEVICE */
Expand Down Expand Up @@ -280,9 +286,14 @@ int platform_ipc_init(struct ipc *ipc)
ipc_set_drvdata(ipc, NULL);

/* schedule task */
#if CONFIG_ZEPHYR_TWB_SCHEDULER
scheduler_twb_task_init(&ipc->ipc_task, SOF_UUID(ipc_task_uuid),
&ipc_task_ops, ipc, 0, "IPC", ZEPHYR_TWB_STACK_SIZE,
CONFIG_TWB_THREAD_MEDIUM_PRIORITY, 5);
#else
schedule_task_init_edf(&ipc->ipc_task, SOF_UUID(ipc_task_uuid),
&ipc_task_ops, ipc, 0, 0);

#endif
/* configure interrupt - work is done internally by Zephyr API */

/* attach handlers */
Expand Down

0 comments on commit 3f8de64

Please sign in to comment.