Sound Open Firmware
Loading...
Searching...
No Matches
llext_manager.h
Go to the documentation of this file.
1/* SPDX-License-Identifier: BSD-3-Clause
2 *
3 * Copyright(c) 2024 Intel Corporation. All rights reserved.
4 */
5
6#ifndef __SOF_LLEXT_MANAGER_H__
7#define __SOF_LLEXT_MANAGER_H__
8
9#include <stdbool.h>
10#include <stdint.h>
11
12#if CONFIG_LLEXT
13#include <rimage/sof/user/manifest.h>
14
15struct comp_dev;
16struct comp_driver;
17struct comp_ipc_config;
18struct k_mem_domain;
19
20static inline bool module_is_llext(const struct sof_man_module *mod)
21{
22 return mod->type.load_type == SOF_MAN_MOD_TYPE_LLEXT ||
23 mod->type.load_type == SOF_MAN_MOD_TYPE_LLEXT_AUX;
24}
25
26uintptr_t llext_manager_allocate_module(const struct comp_ipc_config *ipc_config,
27 const void *ipc_specific_config);
28
29int llext_manager_free_module(const uint32_t component_id);
30
31int llext_manager_add_library(uint32_t module_id);
32
33int llext_manager_add_domain(const uint32_t component_id, struct k_mem_domain *domain);
34int llext_manager_rm_domain(const uint32_t component_id, struct k_mem_domain *domain);
35
36bool comp_is_llext(struct comp_dev *comp);
37#else
38#define module_is_llext(mod) false
39#define llext_manager_allocate_module(ipc_config, ipc_specific_config) 0
40#define llext_manager_free_module(component_id) 0
41#define llext_manager_add_library(module_id) 0
42#define llext_manager_add_domain(component_id, domain) 0
43#define comp_is_llext(comp) false
44#endif
45
46#if CONFIG_LLEXT_EXPERIMENTAL && !CONFIG_ADSP_IMR_CONTEXT_SAVE
49#else
50#define llext_manager_store_to_dram() 0
51#define llext_manager_restore_from_dram() -ENOSYS
52#endif
53
54#endif
#define comp_is_llext(comp)
Definition llext_manager.h:43
#define llext_manager_allocate_module(ipc_config, ipc_specific_config)
Definition llext_manager.h:39
#define llext_manager_add_library(module_id)
Definition llext_manager.h:41
#define module_is_llext(mod)
Definition llext_manager.h:38
#define llext_manager_restore_from_dram()
Definition llext_manager.h:51
#define llext_manager_add_domain(component_id, domain)
Definition llext_manager.h:42
#define llext_manager_store_to_dram()
Definition llext_manager.h:50
#define llext_manager_free_module(component_id)
Definition llext_manager.h:40
Audio component base device "class".
Definition component.h:645
Audio component base driver "class".
Definition component.h:587
Audio component base configuration from IPC at creation.
Definition component.h:613
enum sof_comp_type type
component type
Definition component.h:618