Skip to content

Commit

Permalink
lib-manager: use an appropriate type for a pointer integer
Browse files Browse the repository at this point in the history
lib_manager_allocate_module() returns a pointer as an integer, use
uintptr_t for it.

Signed-off-by: Guennadi Liakhovetski <[email protected]>
  • Loading branch information
lyakh authored and kv2019i committed Mar 8, 2024
1 parent ca29bfb commit 1481770
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 18 deletions.
4 changes: 2 additions & 2 deletions src/audio/module_adapter/module/modules.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,15 +58,15 @@ DECLARE_TR_CTX(intel_codec_tr, SOF_UUID(intel_uuid), LOG_LEVEL_INFO);
*/
static int modules_init(struct processing_module *mod)
{
uint32_t module_entry_point;
struct module_data *md = &mod->priv;
struct comp_dev *dev = mod->dev;
const struct ipc4_base_module_cfg *src_cfg = &md->cfg.base_cfg;
struct comp_ipc_config *config = &(dev->ipc_config);
/* At this point module resources are allocated and it is moved to L2 memory. */
const void *buildinfo = NULL;
uintptr_t module_entry_point = lib_manager_allocate_module(mod, config, src_cfg,
&buildinfo);

module_entry_point = lib_manager_allocate_module(mod, config, src_cfg, &buildinfo);
if (module_entry_point == 0) {
comp_err(dev, "modules_init(), lib_manager_allocate_module() failed!");
return -EINVAL;
Expand Down
2 changes: 1 addition & 1 deletion src/include/module/module/base.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ struct module_data {
struct module_memory memory; /**< memory allocated by module */
struct module_processing_data mpd; /**< shared data comp <-> module */
void *module_adapter; /**<loadable module interface handle */
uint32_t module_entry_point; /**<loadable module entry point address */
uintptr_t module_entry_point; /**<loadable module entry point address */
struct llext *llext; /**< Zephyr loadable extension context */
#endif /* SOF_MODULE_PRIVATE */
};
Expand Down
6 changes: 3 additions & 3 deletions src/include/sof/lib_manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -155,9 +155,9 @@ struct processing_module;
* Function is responsible to allocate module in available free memory and assigning proper address.
* (WIP) These feature will contain module validation and proper memory management.
*/
uint32_t lib_manager_allocate_module(struct processing_module *proc,
struct comp_ipc_config *ipc_config,
const void *ipc_specific_config, const void **buildinfo);
uintptr_t lib_manager_allocate_module(struct processing_module *proc,
struct comp_ipc_config *ipc_config,
const void *ipc_specific_config, const void **buildinfo);

/*
* \brief Free module
Expand Down
6 changes: 3 additions & 3 deletions src/include/sof/llext_manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
struct comp_driver;
struct comp_ipc_config;

uint32_t llext_manager_allocate_module(struct processing_module *proc,
struct comp_ipc_config *ipc_config,
const void *ipc_specific_config, const void **buildinfo);
uintptr_t llext_manager_allocate_module(struct processing_module *proc,
struct comp_ipc_config *ipc_config,
const void *ipc_specific_config, const void **buildinfo);
int llext_manager_free_module(struct processing_module *proc,
struct comp_ipc_config *ipc_config);

Expand Down
12 changes: 6 additions & 6 deletions src/library_manager/lib_manager.c
Original file line number Diff line number Diff line change
Expand Up @@ -342,9 +342,9 @@ static bool module_is_llext(struct sof_man_module *mod)
return mod->type.load_type == SOF_MAN_MOD_TYPE_LLEXT;
}

uint32_t lib_manager_allocate_module(struct processing_module *proc,
struct comp_ipc_config *ipc_config,
const void *ipc_specific_config, const void **buildinfo)
uintptr_t lib_manager_allocate_module(struct processing_module *proc,
struct comp_ipc_config *ipc_config,
const void *ipc_specific_config, const void **buildinfo)
{
struct sof_man_fw_desc *desc;
struct sof_man_module *mod;
Expand Down Expand Up @@ -436,9 +436,9 @@ int lib_manager_free_module(struct processing_module *proc,

#define PAGE_SZ 4096 /* equals to MAN_PAGE_SIZE used by rimage */

uint32_t lib_manager_allocate_module(struct processing_module *proc,
struct comp_ipc_config *ipc_config,
const void *ipc_specific_config, const void **buildinfo)
uintptr_t lib_manager_allocate_module(struct processing_module *proc,
struct comp_ipc_config *ipc_config,
const void *ipc_specific_config, const void **buildinfo)
{
tr_err(&lib_manager_tr,
"lib_manager_allocate_module(): Dynamic module allocation is not supported");
Expand Down
6 changes: 3 additions & 3 deletions src/library_manager/llext_manager.c
Original file line number Diff line number Diff line change
Expand Up @@ -229,9 +229,9 @@ static int llext_manager_link(struct sof_man_fw_desc *desc, struct sof_man_modul
return 0;
}

uint32_t llext_manager_allocate_module(struct processing_module *proc,
struct comp_ipc_config *ipc_config,
const void *ipc_specific_config, const void **buildinfo)
uintptr_t llext_manager_allocate_module(struct processing_module *proc,
struct comp_ipc_config *ipc_config,
const void *ipc_specific_config, const void **buildinfo)
{
struct sof_man_fw_desc *desc;
struct sof_man_module *mod;
Expand Down

0 comments on commit 1481770

Please sign in to comment.