@@ -346,25 +346,21 @@ uint32_t lib_manager_allocate_module(const struct comp_driver *drv,
346346 struct comp_ipc_config * ipc_config ,
347347 const void * ipc_specific_config )
348348{
349- struct sof_man_fw_desc * desc ;
350349 const struct sof_man_module * mod ;
351350 const struct ipc4_base_module_cfg * base_cfg = ipc_specific_config ;
352351 int ret ;
353352 uint32_t module_id = IPC4_MOD_ID (ipc_config -> id );
354- uint32_t entry_index = LIB_MANAGER_GET_MODULE_INDEX (module_id );
355353
356354 tr_dbg (& lib_manager_tr , "lib_manager_allocate_module(): mod_id: %#x" ,
357355 ipc_config -> id );
358356
359- desc = lib_manager_get_library_module_desc (module_id );
360- if (!desc ) {
357+ mod = lib_manager_get_library_manifest (module_id );
358+ if (!mod ) {
361359 tr_err (& lib_manager_tr ,
362360 "lib_manager_allocate_module(): failed to get module descriptor" );
363361 return 0 ;
364362 }
365363
366- mod = (struct sof_man_module * )((char * )desc + SOF_MAN_MODULE_OFFSET (entry_index ));
367-
368364 if (module_is_llext (mod ))
369365 return llext_manager_allocate_module (drv , ipc_config , ipc_specific_config );
370366
@@ -398,16 +394,13 @@ uint32_t lib_manager_allocate_module(const struct comp_driver *drv,
398394int lib_manager_free_module (const struct comp_driver * drv ,
399395 struct comp_ipc_config * ipc_config )
400396{
401- struct sof_man_fw_desc * desc ;
402397 const struct sof_man_module * mod ;
403398 uint32_t module_id = IPC4_MOD_ID (ipc_config -> id );
404- uint32_t entry_index = LIB_MANAGER_GET_MODULE_INDEX (module_id );
405399 int ret ;
406400
407401 tr_dbg (& lib_manager_tr , "lib_manager_free_module(): mod_id: %#x" , ipc_config -> id );
408402
409- desc = lib_manager_get_library_module_desc (module_id );
410- mod = (struct sof_man_module * )((char * )desc + SOF_MAN_MODULE_OFFSET (entry_index ));
403+ mod = lib_manager_get_library_manifest (module_id );
411404
412405 if (module_is_llext (mod ))
413406 return llext_manager_free_module (drv , ipc_config );
@@ -462,16 +455,6 @@ void lib_manager_init(void)
462455 sof -> ext_library = & loader_ext_lib ;
463456}
464457
465- struct sof_man_fw_desc * lib_manager_get_library_module_desc (int module_id )
466- {
467- struct lib_manager_mod_ctx * ctx = lib_manager_get_mod_ctx (module_id );
468- uint8_t * buffptr = (uint8_t * )(ctx ? ctx -> desc : NULL );
469-
470- if (!buffptr )
471- return NULL ;
472- return (struct sof_man_fw_desc * )(buffptr + SOF_MAN_ELF_TEXT_OFFSET );
473- }
474-
475458static void lib_manager_update_sof_ctx (struct sof_man_fw_desc * desc , uint32_t lib_id )
476459{
477460 struct ext_library * _ext_lib = ext_lib_get ();
0 commit comments