LLEXT: persistent dependency by lyakh · Pull Request #9804 · thesofproject/sof · GitHub
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/audio/module_adapter/module/modules.c
3 changes: 0 additions & 3 deletions src/include/module/module/base.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ struct module_config {
#endif
};

struct llext;

/*
* A structure containing a module's private data, intended for its exclusive use.
*
Expand All @@ -60,7 +58,6 @@ struct module_data {
void *runtime_params;
struct module_memory memory; /**< memory allocated by module */
struct module_processing_data mpd; /**< shared data comp <-> module */
struct llext *llext; /**< Zephyr loadable extension context */
#endif /* SOF_MODULE_PRIVATE */
};

Expand Down
12 changes: 12 additions & 0 deletions src/include/module/module/llext.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,18 @@
} \
}

#define SOF_LLEXT_AUX_MANIFEST(manifest_name, entry, mod_uuid) \
{ \
.module = { \
.name = manifest_name, \
.uuid = mod_uuid, \
.entry_point = (uint32_t)(entry), \
.type = { \
.load_type = SOF_MAN_MOD_TYPE_LLEXT_AUX, \
}, \
} \
}

#define SOF_LLEXT_MOD_ENTRY(name, interface) \
static const struct module_interface *name##_llext_entry(void *mod_cfg, \
void *parent_ppl, void **mod_ptr) \
Expand Down
8 changes: 6 additions & 2 deletions src/include/sof/lib_manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ enum {
LIB_MANAGER_TEXT,
LIB_MANAGER_DATA,
LIB_MANAGER_RODATA,
LIB_MANAGER_BSS,
LIB_MANAGER_N_SEGMENTS,
};

Expand All @@ -95,10 +96,14 @@ struct lib_manager_segment_desc {
size_t size;
};

struct llext;

struct lib_manager_module {
unsigned int start_idx; /* Index of the first driver from this module in
* the library-global driver list */
const struct sof_man_module_manifest *mod_manifest;
struct llext *llext; /* Zephyr loadable extension context */
bool mapped;
struct lib_manager_segment_desc segment[LIB_MANAGER_N_SEGMENTS];
};

Expand Down Expand Up @@ -189,8 +194,7 @@ 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.
*/
uintptr_t lib_manager_allocate_module(struct processing_module *proc,
const struct comp_ipc_config *ipc_config,
uintptr_t lib_manager_allocate_module(const struct comp_ipc_config *ipc_config,
const void *ipc_specific_config);

/*
Expand Down
12 changes: 7 additions & 5 deletions src/include/sof/llext_manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,23 @@ struct comp_ipc_config;

static inline bool module_is_llext(const struct sof_man_module *mod)
{
return mod->type.load_type == SOF_MAN_MOD_TYPE_LLEXT;
return mod->type.load_type == SOF_MAN_MOD_TYPE_LLEXT ||
mod->type.load_type == SOF_MAN_MOD_TYPE_LLEXT_AUX;
}

uintptr_t llext_manager_allocate_module(struct processing_module *proc,
const struct comp_ipc_config *ipc_config,
uintptr_t llext_manager_allocate_module(const struct comp_ipc_config *ipc_config,
const void *ipc_specific_config);

int llext_manager_free_module(const uint32_t component_id);

int llext_manager_add_library(uint32_t module_id);

bool comp_is_llext(struct comp_dev *comp);
#else
#define module_is_llext(mod) false
#define llext_manager_allocate_module(proc, ipc_config, ipc_specific_config) 0
#define llext_manager_allocate_module(ipc_config, ipc_specific_config) 0
#define llext_manager_free_module(component_id) 0
#define llext_unload(ext) 0
#define llext_manager_add_library(module_id) 0
#define comp_is_llext(comp) false
#endif

Expand Down
46 changes: 21 additions & 25 deletions src/library_manager/lib_manager.c
Loading