diff --git a/src/library_manager/lib_manager.c b/src/library_manager/lib_manager.c index 9d2a6f505b7f..b87fe4d062cd 100644 --- a/src/library_manager/lib_manager.c +++ b/src/library_manager/lib_manager.c @@ -278,6 +278,8 @@ uint32_t lib_manager_allocate_module(const struct comp_driver *drv, return 0; } + mod = (struct sof_man_module *)((char *)desc + SOF_MAN_MODULE_OFFSET(entry_index)); + size_t mod_size = desc->header.preload_page_count * CONFIG_MM_DRV_PAGE_SIZE; /* FIXME: where does the module begin?? */ struct module_buf_stream mbs = MODULE_BUF_STREAM((uint8_t *)desc - @@ -285,16 +287,13 @@ uint32_t lib_manager_allocate_module(const struct comp_driver *drv, mod_size); struct module *m; - /* FIXME: get a name from the manifest */ - ret = module_load(&mbs.stream, "SMATEST", &m); + ret = module_load(&mbs.stream, mod->name, &m); if (ret < 0) return ret; const struct sof_man_module_manifest *mod_manifest = module_peek(&mbs.stream, m->module_offset); - mod = (struct sof_man_module *)((char *)desc + SOF_MAN_MODULE_OFFSET(entry_index)); - mod->segment[SOF_MAN_SEGMENT_TEXT].v_base_addr = mbs.stream.sects[MOD_SECT_TEXT].sh_addr; mod->segment[SOF_MAN_SEGMENT_TEXT].flags.r.length = mbs.stream.sects[MOD_SECT_TEXT].sh_size; mod->segment[SOF_MAN_SEGMENT_TEXT].file_offset = (uintptr_t)m->mem[MOD_MEM_TEXT] -