Skip to content

Commit 7cbaffe

Browse files
committed
fast-get: limit scope
fast-get is only needed when DRAM is used, i.e. when CONFIG_COLD_STORE_EXECUTE_DRAM is selectef. It's also unneeded in modules when CONFIG_LLEXT_TYPE_ELF_SHAREDLIB is used, i.e. in gcc builds, because also in those builds no .cold and .coldrodata sections are created. Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
1 parent 353e1e4 commit 7cbaffe

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

src/include/sof/lib/fast-get.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,17 @@
1212

1313
struct k_heap;
1414

15+
#if (CONFIG_COLD_STORE_EXECUTE_DRAM && \
16+
(CONFIG_LLEXT_TYPE_ELF_RELOCATABLE || !defined(LL_EXTENSION_BUILD))) || \
17+
!CONFIG_SOF_FULL_ZEPHYR_APPLICATION
1518
const void *fast_get(struct k_heap *heap, const void * const dram_ptr, size_t size);
1619
void fast_put(struct k_heap *heap, const void *sram_ptr);
20+
#else
21+
static inline const void *fast_get(struct k_heap *heap, const void * const dram_ptr, size_t size)
22+
{
23+
return dram_ptr;
24+
}
25+
static inline void fast_put(struct k_heap *heap, const void *sram_ptr) {}
26+
#endif
1727

1828
#endif /* __SOF_LIB_FAST_GET_H__ */

zephyr/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -518,7 +518,9 @@ zephyr_library_sources(
518518
# SOF module interface functions
519519
add_subdirectory(../src/module module_unused_install/)
520520

521+
if(CONFIG_COLD_STORE_EXECUTE_DRAM)
521522
zephyr_library_sources_ifdef(CONFIG_FAST_GET lib/fast-get.c)
523+
endif()
522524

523525
# Optional SOF sources - depends on Kconfig - WIP
524526

0 commit comments

Comments
 (0)