Skip to content

Commit

Permalink
module: use the module name from the manifest for loading
Browse files Browse the repository at this point in the history
The module name is present in the manifest, use it as an argument to
module_load().

Signed-off-by: Guennadi Liakhovetski <[email protected]>
  • Loading branch information
lyakh committed Sep 11, 2023
1 parent 4433c3a commit d555a77
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/library_manager/lib_manager.c
Original file line number Diff line number Diff line change
Expand Up @@ -278,23 +278,22 @@ 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 -
SOF_MAN_ELF_TEXT_OFFSET + 0x8000,
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] -
Expand Down

0 comments on commit d555a77

Please sign in to comment.