Skip to content

Commit 2cd9308

Browse files
committed
llext: change a function parameter
llext_manager_link() doesn't the whole of struct module_data, it only needs a pointer to a pointer to struct llext. Modify it to only receive the scope, that it needs. Signed-off-by: Guennadi Liakhovetski <[email protected]>
1 parent 1cdebd6 commit 2cd9308

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/library_manager/llext_manager.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ static int llext_manager_unload_module(uint32_t module_id, const struct sof_man_
220220
}
221221

222222
static int llext_manager_link(struct sof_man_fw_desc *desc, struct sof_man_module *mod,
223-
uint32_t module_id, struct module_data *md, const void **buildinfo,
223+
uint32_t module_id, struct llext **llext, const void **buildinfo,
224224
const struct sof_man_module_manifest **mod_manifest)
225225
{
226226
size_t mod_size = desc->header.preload_page_count * PAGE_SZ - FILE_TEXT_OFFSET_V1_8;
@@ -233,14 +233,14 @@ static int llext_manager_link(struct sof_man_fw_desc *desc, struct sof_man_modul
233233
.relocate_local = !ctx->segment[LIB_MANAGER_TEXT].size,
234234
.pre_located = true,
235235
};
236-
int ret = llext_load(&ebl.loader, mod->name, &md->llext, &ldr_parm);
236+
int ret = llext_load(&ebl.loader, mod->name, llext, &ldr_parm);
237237

238238
if (ret)
239239
return ret;
240240

241241
ctx->segment[LIB_MANAGER_TEXT].addr = ebl.loader.sects[LLEXT_MEM_TEXT].sh_addr;
242242
ctx->segment[LIB_MANAGER_TEXT].file_offset =
243-
(uintptr_t)md->llext->mem[LLEXT_MEM_TEXT] - imr_base;
243+
(uintptr_t)(*llext)->mem[LLEXT_MEM_TEXT] - imr_base;
244244
ctx->segment[LIB_MANAGER_TEXT].size = ebl.loader.sects[LLEXT_MEM_TEXT].sh_size;
245245

246246
tr_dbg(&lib_manager_tr, ".text: start: %#lx size %#x offset %#x",
@@ -252,7 +252,7 @@ static int llext_manager_link(struct sof_man_fw_desc *desc, struct sof_man_modul
252252
ctx->segment[LIB_MANAGER_RODATA].addr =
253253
ebl.loader.sects[LLEXT_MEM_RODATA].sh_addr;
254254
ctx->segment[LIB_MANAGER_RODATA].file_offset =
255-
(uintptr_t)md->llext->mem[LLEXT_MEM_RODATA] - imr_base;
255+
(uintptr_t)(*llext)->mem[LLEXT_MEM_RODATA] - imr_base;
256256
ctx->segment[LIB_MANAGER_RODATA].size = ebl.loader.sects[LLEXT_MEM_RODATA].sh_size;
257257

258258
tr_dbg(&lib_manager_tr, ".rodata: start: %#lx size %#x offset %#x",
@@ -263,7 +263,7 @@ static int llext_manager_link(struct sof_man_fw_desc *desc, struct sof_man_modul
263263
ctx->segment[LIB_MANAGER_DATA].addr =
264264
ebl.loader.sects[LLEXT_MEM_DATA].sh_addr;
265265
ctx->segment[LIB_MANAGER_DATA].file_offset =
266-
(uintptr_t)md->llext->mem[LLEXT_MEM_DATA] - imr_base;
266+
(uintptr_t)(*llext)->mem[LLEXT_MEM_DATA] - imr_base;
267267
ctx->segment[LIB_MANAGER_DATA].size = ebl.loader.sects[LLEXT_MEM_DATA].sh_size;
268268

269269
tr_dbg(&lib_manager_tr, ".data: start: %#lx size %#x offset %#x",
@@ -317,8 +317,8 @@ uintptr_t llext_manager_allocate_module(struct processing_module *proc,
317317
mod_array = (struct sof_man_module *)((char *)desc + SOF_MAN_MODULE_OFFSET(0));
318318

319319
/* LLEXT linking is only needed once for all the modules in the library */
320-
ret = llext_manager_link(desc, mod_array, module_id, &proc->priv, (const void **)&buildinfo,
321-
&mod_manifest);
320+
ret = llext_manager_link(desc, mod_array, module_id, &proc->priv.llext,
321+
(const void **)&buildinfo, &mod_manifest);
322322
if (ret < 0)
323323
return 0;
324324

0 commit comments

Comments
 (0)