Sound Open Firmware
Loading...
Searching...
No Matches
twb_schedule.h
Go to the documentation of this file.
1/* SPDX-License-Identifier: BSD-3-Clause */
2/*
3 * Copyright(c) 2023 Intel Corporation. All rights reserved.
4 *
5 * Author: Adrian Bonislawski <adrian.bonislawski@intel.com>
6 */
7
31#ifndef __SOF_SCHEDULE_TWB_SCHEDULE_H__
32#define __SOF_SCHEDULE_TWB_SCHEDULE_H__
33
34#include <rtos/task.h>
35#include <stdint.h>
36
44#define ZEPHYR_TWB_STACK_SIZE 8192
45
49#define ZEPHYR_TWB_BUDGET_MAX (CONFIG_SYS_CLOCK_TICKS_PER_SEC / 1000)
50
55#define SYS_TICKS_TO_HW_CYCLES(x) (x * CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC / CONFIG_SYS_CLOCK_TICKS_PER_SEC)
56
61#define HW_CYCLES_TO_SYS_TICKS(x) (x * CONFIG_SYS_CLOCK_TICKS_PER_SEC / CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC)
62
71
89 const struct sof_uuid_entry *uid,
90 const struct task_ops *ops,
91 void *data,
92 int32_t core,
93 const char *name,
94 size_t stack_size,
95 int32_t thread_priority,
96 uint32_t cycles_granted);
97
100#endif /* __SOF_SCHEDULE_TWB_SCHEDULE_H__ */
int scheduler_twb_init(void)
Initialize the Thread With Budget (TWB) scheduler on the calling core.
int scheduler_twb_task_init(struct task **task, const struct sof_uuid_entry *uid, const struct task_ops *ops, void *data, int32_t core, const char *name, size_t stack_size, int32_t thread_priority, uint32_t cycles_granted)
Initialize a TWB task with a dedicated Zephyr worker thread and cycle budget.
uint8_t data[0]
Binary byte payload for raw controls.
Definition header.h:5
Connects UUID with component description.
Definition uuid.h:77
Operations and callbacks associated with a scheduling task.
Definition task.h:72
Core task structure managed by SOF schedulers.
Definition task.h:81
Core task descriptor, task operations, and task execution state machine.