-
Notifications
You must be signed in to change notification settings - Fork 350
Expand file tree
/
Copy pathzephyr_dp_schedule.h
More file actions
59 lines (52 loc) · 2.06 KB
/
zephyr_dp_schedule.h
File metadata and controls
59 lines (52 loc) · 2.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
/* SPDX-License-Identifier: BSD-3-Clause */
/*
* Copyright(c) 2023 Intel Corporation. All rights reserved.
*
* Author: Marcin Szkudlinski
*/
#include <rtos/task.h>
#include <sof/audio/module_adapter/module/generic.h>
#include <sof/list.h>
#include <sof/compiler_attributes.h>
#include <zephyr/app_memory/mem_domain.h>
#include <stdbool.h>
#include <stdint.h>
struct scheduler_dp_data {
struct list_item tasks; /* list of active dp tasks */
struct task ll_tick_src; /* LL task - source of DP tick */
uint32_t last_ll_tick_timestamp;/* a timestamp as k_cycle_get_32 of last LL tick,
* "NOW" for DP deadline calculation
*/
};
enum sof_dp_part_type {
SOF_DP_PART_HEAP,
SOF_DP_PART_HEAP_CACHE,
SOF_DP_PART_CFG,
SOF_DP_PART_CFG_CACHE,
SOF_DP_PART_TYPE_COUNT,
};
struct ipc4_flat;
struct task_dp_pdata {
k_tid_t thread_id; /* zephyr thread ID */
struct k_thread *thread; /* pointer to the kernels' thread object */
struct k_thread thread_struct; /* thread object for kernel threads */
uint32_t deadline_clock_ticks; /* dp module deadline in Zephyr ticks */
k_thread_stack_t *p_stack; /* pointer to thread stack */
struct processing_module *mod; /* the module to be scheduled */
uint32_t ll_cycles_to_start; /* current number of LL cycles till delayed start */
#if CONFIG_SOF_USERSPACE_APPLICATION
struct ipc4_flat *flat;
struct k_mem_partition mpart[SOF_DP_PART_TYPE_COUNT];
#endif
struct k_event *event; /* pointer to event for task scheduling */
struct k_event event_struct; /* event for task scheduling for kernel threads */
};
void scheduler_dp_recalculate(struct scheduler_dp_data *dp_sch, bool is_ll_post_run);
void dp_thread_fn(void *p1, void *p2, void *p3);
unsigned int scheduler_dp_lock(uint16_t core);
void scheduler_dp_unlock(unsigned int key);
void scheduler_dp_grant(k_tid_t thread_id, uint16_t core);
int scheduler_dp_task_init(struct task **task, const struct sof_uuid_entry *uid,
const struct task_ops *ops, struct processing_module *mod,
uint16_t core, size_t stack_size, uint32_t options);
void scheduler_dp_internal_free(struct task *task);