Skip to content

Commit aa1e277

Browse files
committed
[TEST] ipc: switch IPC tak scheduler to TWB
This will change scheduler type for IPC task Signed-off-by: Adrian Bonislawski <adrian.bonislawski@intel.com>
1 parent dbd1943 commit aa1e277

File tree

3 files changed

+21
-2
lines changed

3 files changed

+21
-2
lines changed

src/include/sof/ipc/common.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,11 @@ struct ipc {
6868
struct list_item comp_list; /* list of component devices */
6969

7070
/* processing task */
71+
#if CONFIG_ZEPHYR_TWB_SCHEDULER
72+
struct task *ipc_task;
73+
#else
7174
struct task ipc_task;
75+
#endif
7276

7377
#ifdef CONFIG_SOF_TELEMETRY_IO_PERFORMANCE_MEASUREMENTS
7478
/* io performance measurement */

src/ipc/ipc-common.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,11 @@ static void ipc_work_handler(struct k_work *work)
276276

277277
void ipc_schedule_process(struct ipc *ipc)
278278
{
279+
#if CONFIG_ZEPHYR_TWB_SCHEDULER
280+
schedule_task(ipc->ipc_task, 0, IPC_PERIOD_USEC);
281+
#else
279282
schedule_task(&ipc->ipc_task, 0, IPC_PERIOD_USEC);
283+
#endif
280284
}
281285

282286
int ipc_init(struct sof *sof)

src/ipc/ipc-zephyr.c

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
#include <sof/list.h>
3232
#include <sof/platform.h>
3333
#include <sof/schedule/edf_schedule.h>
34+
#include <sof/schedule/twb_schedule.h>
3435
#include <sof/schedule/schedule.h>
3536
#include <rtos/task.h>
3637
#include <rtos/spinlock.h>
@@ -160,9 +161,14 @@ static int ipc_device_resume_handler(const struct device *dev, void *arg)
160161
intel_adsp_ipc_set_message_handler(INTEL_ADSP_IPC_HOST_DEV, message_handler, ipc);
161162

162163
/* schedule task */
164+
#if CONFIG_ZEPHYR_TWB_SCHEDULER
165+
scheduler_twb_task_init(&ipc->ipc_task, SOF_UUID(zipc_task_uuid),
166+
&ipc_task_ops, ipc, 0, "IPC", ZEPHYR_TWB_STACK_SIZE,
167+
CONFIG_TWB_THREAD_MEDIUM_PRIORITY, 5);
168+
#else
163169
schedule_task_init_edf(&ipc->ipc_task, SOF_UUID(zipc_task_uuid),
164170
&ipc_task_ops, ipc, 0, 0);
165-
171+
#endif
166172
return 0;
167173
}
168174
#endif /* CONFIG_PM_DEVICE */
@@ -278,9 +284,14 @@ int platform_ipc_init(struct ipc *ipc)
278284
ipc_set_drvdata(ipc, NULL);
279285

280286
/* schedule task */
287+
#if CONFIG_ZEPHYR_TWB_SCHEDULER
288+
scheduler_twb_task_init(&ipc->ipc_task, SOF_UUID(zipc_task_uuid),
289+
&ipc_task_ops, ipc, 0, "IPC", ZEPHYR_TWB_STACK_SIZE,
290+
CONFIG_TWB_THREAD_MEDIUM_PRIORITY, 5);
291+
#else
281292
schedule_task_init_edf(&ipc->ipc_task, SOF_UUID(zipc_task_uuid),
282293
&ipc_task_ops, ipc, 0, 0);
283-
294+
#endif
284295
/* configure interrupt - work is done internally by Zephyr API */
285296

286297
/* attach handlers */

0 commit comments

Comments
 (0)