Skip to content

Commit 3666c3e

Browse files
committed
schedule: zephyr_ll: add user_ll_grant_access()
Add function user_ll_grant_access() to allow other threads to access the scheduler mutex. This is needed if work is submitted from other threads to the scheduler. Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
1 parent 158e0e9 commit 3666c3e

2 files changed

Lines changed: 8 additions & 0 deletions

File tree

src/include/sof/schedule/ll_schedule_domain.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ struct task *zephyr_ll_task_alloc(void);
120120
struct k_heap *zephyr_ll_user_heap(void);
121121
bool zephyr_ll_user_heap_verify(struct k_heap *heap);
122122
void zephyr_ll_user_resources_init(void);
123+
void user_ll_grant_access(struct k_thread *thread, int core);
123124
void user_ll_lock_sched(int core);
124125
void user_ll_unlock_sched(int core);
125126
#ifdef CONFIG_ASSERT

src/schedule/zephyr_ll.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -625,6 +625,13 @@ struct task *zephyr_ll_task_alloc(void)
625625
return task;
626626
}
627627

628+
void user_ll_grant_access(struct k_thread *thread, int core)
629+
{
630+
assert(core < CONFIG_CORE_COUNT && zephyr_ll_locks[core] != NULL);
631+
632+
k_thread_access_grant(thread, zephyr_ll_locks[core]);
633+
}
634+
628635
/**
629636
* Lock the LL scheduler to prevent it from processing tasks.
630637
*

0 commit comments

Comments
 (0)