From 696f8bc97926f8a57dd0d306d5786dc179727454 Mon Sep 17 00:00:00 2001 From: Guennadi Liakhovetski Date: Fri, 8 Nov 2024 16:48:03 +0200 Subject: [PATCH] LLEXT: add a macro to place selected functions in .text.dram With this macro modules can use __sof_llext_dram_text(CONFIG__MODULE) in front of their functions to place them in the .text.dram section where they then will also be executed without being copied to SRAM. Signed-off-by: Guennadi Liakhovetski --- src/include/module/module/llext.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/include/module/module/llext.h b/src/include/module/module/llext.h index 05b8f0ffb5f5..638300d52aa0 100644 --- a/src/include/module/module/llext.h +++ b/src/include/module/module/llext.h @@ -34,4 +34,10 @@ static const struct sof_module_api_build_info buildinfo __section(".mod_buildinf .api_version_number.full = SOF_MODULE_API_CURRENT_VERSION, \ } +#if CONFIG_LLEXT_TYPE_ELF_RELOCATABLE +#define __sof_llext_dram_text(m) IF_ENABLED(m, (__section(".text.dram"))) +#else +#define __sof_llext_dram_text(m) +#endif + #endif