Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/include/sof/lib/fast-get.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,17 @@

struct k_heap;

#if (CONFIG_COLD_STORE_EXECUTE_DRAM && \
(CONFIG_LLEXT_TYPE_ELF_RELOCATABLE || !defined(LL_EXTENSION_BUILD))) || \
!CONFIG_SOF_FULL_ZEPHYR_APPLICATION
const void *fast_get(struct k_heap *heap, const void * const dram_ptr, size_t size);
void fast_put(struct k_heap *heap, const void *sram_ptr);
#else
static inline const void *fast_get(struct k_heap *heap, const void * const dram_ptr, size_t size)
{
return dram_ptr;
}
static inline void fast_put(struct k_heap *heap, const void *sram_ptr) {}
#endif

#endif /* __SOF_LIB_FAST_GET_H__ */
2 changes: 0 additions & 2 deletions src/schedule/zephyr_dp_schedule.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,7 @@ void scheduler_dp_unlock(unsigned int key)

void scheduler_dp_grant(k_tid_t thread_id, uint16_t core)
{
#if CONFIG_USERSPACE
k_thread_access_grant(thread_id, &dp_lock[core]);
#endif
}

/* dummy LL task - to start LL on secondary cores */
Expand Down
6 changes: 3 additions & 3 deletions src/schedule/zephyr_dp_schedule_thread.c
Original file line number Diff line number Diff line change
Expand Up @@ -269,9 +269,6 @@ int scheduler_dp_task_init(struct task **task,
stack_size, dp_thread_fn, *task, NULL, NULL,
CONFIG_DP_THREAD_PRIORITY, (*task)->flags, K_FOREVER);

k_thread_access_grant(pdata->thread_id, pdata->event);
scheduler_dp_grant(pdata->thread_id, cpu_get_id());

/* pin the thread to specific core */
ret = k_thread_cpu_pin(pdata->thread_id, core);
if (ret < 0) {
Expand All @@ -280,6 +277,9 @@ int scheduler_dp_task_init(struct task **task,
}

#ifdef CONFIG_USERSPACE
k_thread_access_grant(pdata->thread_id, pdata->event);
scheduler_dp_grant(pdata->thread_id, cpu_get_id());

if ((*task)->flags & K_USER) {
ret = user_memory_init_shared(pdata->thread_id, pdata->mod);
if (ret < 0) {
Expand Down
2 changes: 2 additions & 0 deletions zephyr/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,9 @@ zephyr_library_sources(
# SOF module interface functions
add_subdirectory(../src/module module_unused_install/)

if(CONFIG_COLD_STORE_EXECUTE_DRAM)
zephyr_library_sources_ifdef(CONFIG_FAST_GET lib/fast-get.c)
endif()

# Optional SOF sources - depends on Kconfig - WIP

Expand Down
Loading