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];
123struct lib_manager_mod_ctx {
126 unsigned int load_type;
127 struct lib_manager_module *mod;
131 struct k_spinlock lock;
133#ifdef CONFIG_LIBCODE_MODULE_SUPPORT
134 uint32_t mods_exec_load_cnt;
136 struct ipc_lib_msg *lib_notif_pool;
137 uint32_t lib_notif_count;
144extern struct tr_ctx lib_manager_tr;
146static inline struct ext_library *ext_lib_get(
void)
151static inline struct lib_manager_mod_ctx *lib_manager_get_mod_ctx(
int module_id)
154 struct ext_library *_ext_lib = ext_lib_get();
159 return _ext_lib->desc[lib_id];
169const struct sof_man_module *lib_manager_get_module_manifest(
const uint32_t module_id);
206 const struct sof_man_module *mod,
Component API definition.
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)
void lib_manager_get_instance_bss_address(uint32_t instance_id, const struct sof_man_module *mod, void __sparse_cache **va_addr, size_t *size)
#define LIB_MANAGER_GET_LIB_ID(module_id)
Definition lib_manager.h:78
void lib_manager_init(void)
#define list_item(item, type, member)
Definition list.h:80
struct sof * sof_get(void)
uint32_t header
Definition msg.h:34
uint32_t type
Definition tlv.h:0
#define __sparse_cache
Definition compiler_attributes.h:11