diff --git a/src/include/sof/lib/fast-get.h b/src/include/sof/lib/fast-get.h index fa34ecea128d..71bd81bd58a7 100644 --- a/src/include/sof/lib/fast-get.h +++ b/src/include/sof/lib/fast-get.h @@ -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__ */ diff --git a/src/schedule/zephyr_dp_schedule.c b/src/schedule/zephyr_dp_schedule.c index 3c88573b92e5..4b2df1cfd6d3 100644 --- a/src/schedule/zephyr_dp_schedule.c +++ b/src/schedule/zephyr_dp_schedule.c @@ -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 */ diff --git a/src/schedule/zephyr_dp_schedule_thread.c b/src/schedule/zephyr_dp_schedule_thread.c index e21644797310..a2d703528b33 100644 --- a/src/schedule/zephyr_dp_schedule_thread.c +++ b/src/schedule/zephyr_dp_schedule_thread.c @@ -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) { @@ -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) { diff --git a/zephyr/CMakeLists.txt b/zephyr/CMakeLists.txt index 61ed49a3d15f..9f95170c8bdc 100644 --- a/zephyr/CMakeLists.txt +++ b/zephyr/CMakeLists.txt @@ -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