Skip to content

Commit 77c02af

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 77c02af

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

Kconfig.sof

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ config COLD_STORE_EXECUTE_DEBUG
3939

4040
config FAST_GET
4141
bool "Enable simple refcounting DRAM data copier"
42+
depends on COLD_STORE_EXECUTE_DRAM
4243
help
4344
Enable simple refcounting DRAM data copier for copying processing
4445
module data from DRAM to SRAM when the data is needed and freeing

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__ */

0 commit comments

Comments
 (0)