From ebdab32a5ce7971d62acf3d8a0ebc8df7f556f3b Mon Sep 17 00:00:00 2001 From: Guennadi Liakhovetski Date: Fri, 14 Jun 2024 15:44:34 +0200 Subject: [PATCH] llext: add maximum instance count support Maximum instance count cannot be zero, they have to be supplied by respective modules. Signed-off-by: Guennadi Liakhovetski --- src/audio/eq_iir/eq_iir.c | 2 +- src/audio/mixin_mixout/mixin_mixout.c | 4 ++-- src/include/module/module/llext.h | 3 ++- src/samples/audio/smart_amp_test_ipc4.c | 1 + 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/audio/eq_iir/eq_iir.c b/src/audio/eq_iir/eq_iir.c index 6c298e4d59ff..9cfab900c9fa 100644 --- a/src/audio/eq_iir/eq_iir.c +++ b/src/audio/eq_iir/eq_iir.c @@ -271,7 +271,7 @@ SOF_MODULE_INIT(eq_iir, sys_comp_module_eq_iir_interface_init); SOF_LLEXT_MOD_ENTRY(eq_iir, &eq_iir_interface); static const struct sof_man_module_manifest mod_manifest __section(".module") __used = - SOF_LLEXT_MODULE_MANIFEST("EQIIR", eq_iir_llext_entry, 1, UUID_EQIIR); + SOF_LLEXT_MODULE_MANIFEST("EQIIR", eq_iir_llext_entry, 1, UUID_EQIIR, 40); SOF_LLEXT_BUILDINFO; diff --git a/src/audio/mixin_mixout/mixin_mixout.c b/src/audio/mixin_mixout/mixin_mixout.c index 5171cbda22e0..cee5140c0f6b 100644 --- a/src/audio/mixin_mixout/mixin_mixout.c +++ b/src/audio/mixin_mixout/mixin_mixout.c @@ -982,8 +982,8 @@ SOF_LLEXT_MOD_ENTRY(mixout, &mixout_interface); static const struct sof_man_module_manifest mod_manifest[] __section(".module") __used = { - SOF_LLEXT_MODULE_MANIFEST("MIXIN", mixin_llext_entry, 1, UUID_MIXIN), - SOF_LLEXT_MODULE_MANIFEST("MIXOUT", mixout_llext_entry, 1, UUID_MIXOUT), + SOF_LLEXT_MODULE_MANIFEST("MIXIN", mixin_llext_entry, 1, UUID_MIXIN, 30), + SOF_LLEXT_MODULE_MANIFEST("MIXOUT", mixout_llext_entry, 1, UUID_MIXOUT, 30), }; SOF_LLEXT_BUILDINFO; diff --git a/src/include/module/module/llext.h b/src/include/module/module/llext.h index 61532e3fb70f..05b8f0ffb5f5 100644 --- a/src/include/module/module/llext.h +++ b/src/include/module/module/llext.h @@ -6,12 +6,13 @@ #ifndef MODULE_LLEXT_H #define MODULE_LLEXT_H -#define SOF_LLEXT_MODULE_MANIFEST(manifest_name, entry, affinity, mod_uuid) \ +#define SOF_LLEXT_MODULE_MANIFEST(manifest_name, entry, affinity, mod_uuid, instances) \ { \ .module = { \ .name = manifest_name, \ .uuid = {mod_uuid}, \ .entry_point = (uint32_t)(entry), \ + .instance_max_count = instances, \ .type = { \ .load_type = SOF_MAN_MOD_TYPE_LLEXT, \ .domain_ll = 1, \ diff --git a/src/samples/audio/smart_amp_test_ipc4.c b/src/samples/audio/smart_amp_test_ipc4.c index c0d6acc872aa..4faa8d967030 100644 --- a/src/samples/audio/smart_amp_test_ipc4.c +++ b/src/samples/audio/smart_amp_test_ipc4.c @@ -417,6 +417,7 @@ static const struct sof_man_module_manifest main_manifest __section(".module") _ .uuid = {0x1E, 0x96, 0x7A, 0x16, 0xE4, 0x8A, 0xEA, 0x11, 0x89, 0xF1, 0x00, 0x0C, 0x29, 0xCE, 0x16, 0x35}, .entry_point = (uint32_t)smart_amp_test_llext_entry, + .instance_max_count = 1, .type = { #ifdef __SOF_MODULE_SERVICE_BUILD__ .load_type = SOF_MAN_MOD_TYPE_MODULE,