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 committed Nov 2, 2023
1 parent 8b8f7bd commit b150c22
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 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 @@ -66,8 +66,8 @@ static int modules_init(struct processing_module *mod)
struct comp_ipc_config *config = &(mod->dev->ipc_config);
/* At this point module resources are allocated and it is moved to L2 memory. */
const void *buildinfo = NULL;
uint32_t module_entry_point = lib_manager_allocate_module(mod, config,
src_cfg, &buildinfo);
uintptr_t 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!");
Expand Down
2 changes: 1 addition & 1 deletion src/include/sof/audio/module_adapter/module/generic.h
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,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 */
};

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 @@ -137,9 +137,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
12 changes: 6 additions & 6 deletions src/library_manager/lib_manager.c
Original file line number Diff line number Diff line change
Expand Up @@ -250,9 +250,9 @@ static int lib_manager_free_module_instance(uint32_t module_id, uint32_t instanc
#include <zephyr/llext/loader.h>
#include <zephyr/llext/llext.h>

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 @@ -353,9 +353,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)
uintptr_t lib_manager_allocate_module(struct processing_module *proc,
struct comp_ipc_config *ipc_config,
const void *ipc_specific_config)
{
tr_err(&lib_manager_tr,
"lib_manager_allocate_module(): Dynamic module allocation is not supported");
Expand Down

0 comments on commit b150c22

Please sign in to comment.