diff --git a/scripts/llext_link_helper.py b/scripts/llext_link_helper.py index 325d65a4e3de..c745b388cd03 100755 --- a/scripts/llext_link_helper.py +++ b/scripts/llext_link_helper.py @@ -136,10 +136,10 @@ def main(): # run at arbitrary memory locations. One of the use-cases is running # parts of the module directly in DRAM - sacrificing performance but # saving scarce SRAM. We achieve this by placing non-performance - # critical functions in a .text.dram ELF section. When compiling and - # linking such functions, an additional .literal.dram section is - # automatically created. Note, that for some reason the compiler also - # marks that section as executable. + # critical functions in a .cold ELF section. When compiling and linking + # such functions, an additional .cold.literal section is automatically + # created. Note, that for some reason the compiler also marks that + # section as executable. # This script links those sections at address 0. We could hard-code # section names, but so far we choose to only link .text the "original" # way and all other executable sections we link at 0. diff --git a/src/include/module/module/llext.h b/src/include/module/module/llext.h index f8477fe7d9b3..05b8f0ffb5f5 100644 --- a/src/include/module/module/llext.h +++ b/src/include/module/module/llext.h @@ -34,10 +34,4 @@ 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 diff --git a/src/platform/ace30/include/platform/lib/memory.h b/src/platform/ace30/include/platform/lib/memory.h index 6232b77af907..dab9d94c062a 100644 --- a/src/platform/ace30/include/platform/lib/memory.h +++ b/src/platform/ace30/include/platform/lib/memory.h @@ -58,6 +58,12 @@ */ #define HEAPMEM_SIZE 0xD0000 +#if CONFIG_COLD_STORE_EXECUTE_DRAM && \ + (CONFIG_LLEXT_TYPE_ELF_RELOCATABLE || !defined(LL_EXTENSION_BUILD)) +#define __cold __section(".cold") +#define __cold_rodata __section(".coldrodata") +#endif + #endif /* __PLATFORM_LIB_MEMORY_H__ */ #else diff --git a/src/platform/lunarlake/include/platform/lib/memory.h b/src/platform/lunarlake/include/platform/lib/memory.h index e23fd7556482..b5bda0ede464 100644 --- a/src/platform/lunarlake/include/platform/lib/memory.h +++ b/src/platform/lunarlake/include/platform/lib/memory.h @@ -58,6 +58,12 @@ */ #define HEAPMEM_SIZE 0xF0000 +#if CONFIG_COLD_STORE_EXECUTE_DRAM && \ + (CONFIG_LLEXT_TYPE_ELF_RELOCATABLE || !defined(LL_EXTENSION_BUILD)) +#define __cold __section(".cold") +#define __cold_rodata __section(".coldrodata") +#endif + #endif /* __PLATFORM_LIB_MEMORY_H__ */ #else diff --git a/src/platform/meteorlake/include/platform/lib/memory.h b/src/platform/meteorlake/include/platform/lib/memory.h index 77e8b7c1b25b..76b60f98fabb 100644 --- a/src/platform/meteorlake/include/platform/lib/memory.h +++ b/src/platform/meteorlake/include/platform/lib/memory.h @@ -58,6 +58,12 @@ */ #define HEAPMEM_SIZE 0xF0000 +#if CONFIG_COLD_STORE_EXECUTE_DRAM && \ + (CONFIG_LLEXT_TYPE_ELF_RELOCATABLE || !defined(LL_EXTENSION_BUILD)) +#define __cold __section(".cold") +#define __cold_rodata __section(".coldrodata") +#endif + #endif /* __PLATFORM_LIB_MEMORY_H__ */ #else diff --git a/zephyr/include/sof/lib/memory.h b/zephyr/include/sof/lib/memory.h index 8cde3c0f589d..f58686a92981 100644 --- a/zephyr/include/sof/lib/memory.h +++ b/zephyr/include/sof/lib/memory.h @@ -8,4 +8,12 @@ #include +#ifndef __cold +#define __cold +#endif + +#ifndef __cold_rodata +#define __cold_rodata +#endif + #endif /* __SOF_LIB_MEMORY_H__ */