62#ifndef __SOF_LIB_MANAGER_H__
63#define __SOF_LIB_MANAGER_H__
68#include <rimage/sof/user/manifest.h>
69#if CONFIG_LIBRARY_AUTH_SUPPORT
74#define LIB_MANAGER_MAX_LIBS 16
75#define LIB_MANAGER_LIB_ID_SHIFT 12
76#define LIB_MANAGER_LIB_NOTIX_MAX_COUNT 4
78#define LIB_MANAGER_GET_LIB_ID(module_id) (((module_id) & 0xF000) >> LIB_MANAGER_LIB_ID_SHIFT)
79#define LIB_MANAGER_GET_MODULE_INDEX(module_id) ((module_id) & 0xFFF)
80#define LIB_MANAGER_PACK_MODULE_ID(lib_index, module_index) (((module_index) & 0xFFF) | \
81 (((lib_index) << LIB_MANAGER_LIB_ID_SHIFT) & 0xF000))
82#define LIB_MANAGER_PACK_LIB_ID(lib_index) LIB_MANAGER_PACK_MODULE_ID(lib_index, 0x0)
84#ifdef CONFIG_LIBRARY_MANAGER
90struct sof_man_module_manifest;
98 LIB_MANAGER_COLDRODATA,
99 LIB_MANAGER_N_SEGMENTS,
102struct lib_manager_segment_desc {
108struct llext_buf_loader;
110struct lib_manager_module {
111 unsigned int start_idx;
113 const struct sof_man_module_manifest *mod_manifest;
115 struct llext_buf_loader *ebl;
116 unsigned int n_dependent;
120 struct lib_manager_segment_desc segment[LIB_MANAGER_N_SEGMENTS];
121 struct lib_manager_segment_desc writable_merged;
124struct lib_manager_mod_ctx {
127 unsigned int load_type;
128 struct lib_manager_module *mod;
132 struct k_spinlock lock;
134#ifdef CONFIG_LIBCODE_MODULE_SUPPORT
135 uint32_t mods_exec_load_cnt;
137 struct ipc_lib_msg *lib_notif_pool;
138 uint32_t lib_notif_count;
145extern struct tr_ctx lib_manager_tr;
147static inline struct ext_library *ext_lib_get(
void)
152static inline struct lib_manager_mod_ctx *lib_manager_get_mod_ctx(
int module_id)
155 struct ext_library *_ext_lib = ext_lib_get();
160 return _ext_lib->desc[lib_id];
170const struct sof_man_module *lib_manager_get_module_manifest(
const uint32_t
module_id);
207 const struct sof_man_module *mod,
208 void __sparse_cache **va_addr,
size_t *size);
224struct userspace_context;
230 const void *spec,
void **adapter_priv,
231 struct userspace_context **userspace,
234#if defined(__ZEPHYR__) && defined(CONFIG_SOF_FULL_ZEPHYR_APPLICATION)
237#include <zephyr/syscalls/lib_manager.h>
239int z_impl_lib_manager_free_module(
const uint32_t component_id);
240#define lib_manager_free_module z_impl_lib_manager_free_module
Component API definition.
void lib_manager_get_instance_bss_address(uint32_t instance_id, const struct sof_man_module *mod, void **va_addr, size_t *size)
int lib_manager_load_library(uint32_t dma_id, uint32_t lib_id, uint32_t type)
void lib_notif_msg_send(struct ipc_msg *msg)
int lib_manager_register_module(const uint32_t component_id)
const struct sof_man_fw_desc * lib_manager_get_library_manifest(int module_id)
void lib_notif_msg_clean(bool leave_one_handle)
#define LIB_MANAGER_MAX_LIBS
Definition lib_manager.h:74
struct ipc_msg * lib_notif_msg_init(uint32_t header, uint32_t size)
int lib_manager_mod_create_priv(const struct comp_driver *drv, const struct comp_ipc_config *config, const void *spec, void **adapter_priv, struct userspace_context **userspace, const struct module_interface **ops)
int lib_manager_free_module(const uint32_t component_id)
#define LIB_MANAGER_GET_LIB_ID(module_id)
Definition lib_manager.h:78
void lib_manager_init(void)
struct sof * sof_get(void)
Get the global Sound Open Firmware runtime instance pointer.
Audio component base driver "class".
Definition component.h:528
Audio component base configuration from IPC at creation.
Definition component.h:560
uint32_t header
Definition msg.h:35
3rd party processing module interface
Definition interface.h:102