From bb30a383dac1c0c8576b10f4057afbc8517d4bc5 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 "__cold" in front of their function definitions to place them in the .text.dram section, which will force their execution in DRAM 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..f8477fe7d9b3 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 && defined(LL_EXTENSION_BUILD) +#define __cold __section(".text.dram") +#else +#define __cold +#endif + #endif