Skip to content
Draft
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
5 changes: 4 additions & 1 deletion app/boards/intel_adsp_ace30_ptl.conf
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ CONFIG_SOF_LOG_LEVEL_INF=y
# Zephyr / OS features
CONFIG_COUNTER=y
CONFIG_HEAP_MEM_POOL_SIZE=8192
CONFIG_LLEXT=y
CONFIG_LLEXT=n
CONFIG_LLEXT_STORAGE_WRITABLE=y
CONFIG_LLEXT_EXPERIMENTAL=y
CONFIG_MODULES=y
Expand All @@ -65,3 +65,6 @@ CONFIG_LOG_BACKEND_ADSP=n
CONFIG_LOG_FLUSH_SLEEP_US=5000
CONFIG_LOG_OUTPUT_FORMAT_LINUX_TIMESTAMP=y
CONFIG_WINSTREAM_CONSOLE=n

CONFIG_USERSPACE=y
CONFIG_SOF_USERSPACE_PROXY=y
4 changes: 4 additions & 0 deletions src/audio/module_adapter/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ if(zephyr) ### Zephyr ###
library/native_system_service.c
)

zephyr_library_sources_ifdef(CONFIG_SOF_USERSPACE_PROXY
library/userspace_proxy.c
)

zephyr_library_sources_ifdef(CONFIG_PASSTHROUGH_CODEC
module/passthrough.c
)
Expand Down
15 changes: 9 additions & 6 deletions src/audio/module_adapter/iadk/system_agent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#include <stddef.h>
#include <stdint.h>
#include <rtos/string.h>
#include <rtos/userspace_helper.h>
#include <utilities/array.h>
#include <module/iadk/adsp_error_code.h>
#include <system_service.h>
Expand All @@ -21,6 +22,7 @@
#include <iadk_module_adapter.h>
#include <system_agent.h>
#include <sof/audio/module_adapter/library/native_system_service.h>
#include <sof/audio/module_adapter/library/native_system_agent.h>

using namespace intel_adsp;
using namespace intel_adsp::system;
Expand All @@ -37,7 +39,7 @@ namespace system
{

/* Structure storing handles to system service operations */
const AdspSystemService SystemAgent::system_service_ = {
const APP_TASK_DATA AdspSystemService SystemAgent::system_service_ = {
native_system_service_log_message,
native_system_service_safe_memcpy,
native_system_service_safe_memmove,
Expand Down Expand Up @@ -124,16 +126,17 @@ int SystemAgent::CheckIn(ProcessingModuleFactoryInterface& module_factory,
typedef int (*create_instance_f)(uint32_t module_id, uint32_t instance_id, uint32_t core_id,
void *mod_cfg, void *parent_ppl, void **mod_ptr);

int system_agent_start(uintptr_t entry_point, uint32_t module_id, uint32_t instance_id,
uint32_t core_id, uint32_t log_handle, void* mod_cfg,
int system_agent_start(const struct system_agent_params *params,
const void **adapter)
{
uint32_t ret;
SystemAgent system_agent(module_id, instance_id, core_id, log_handle);
SystemAgent system_agent(params->module_id, params->instance_id, params->core_id,
params->log_handle);
void* system_agent_p = reinterpret_cast<void*>(&system_agent);

create_instance_f ci = (create_instance_f)(entry_point);
ret = ci(module_id, instance_id, core_id, mod_cfg, NULL, &system_agent_p);
create_instance_f ci = (create_instance_f)(params->entry_point);
ret = ci(params->module_id, params->instance_id, params->core_id, params->mod_cfg, NULL,
&system_agent_p);

IadkModuleAdapter* module_adapter = reinterpret_cast<IadkModuleAdapter*>(system_agent_p);
*adapter = module_adapter;
Expand Down
15 changes: 7 additions & 8 deletions src/audio/module_adapter/library/native_system_agent.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,20 @@ typedef void* (*native_create_instance_f)(void *mod_cfg, void *parent_ppl,

struct native_system_agent native_sys_agent;

int native_system_agent_start(uintptr_t entry_point, uint32_t module_id, uint32_t instance_id,
uint32_t core_id, uint32_t log_handle, void *mod_cfg,
int native_system_agent_start(const struct system_agent_params *params,
const void **iface)
{
native_sys_agent.module_id = module_id;
native_sys_agent.instance_id = instance_id;
native_sys_agent.core_id = core_id;
native_sys_agent.log_handle = log_handle;
native_sys_agent.module_id = params->module_id;
native_sys_agent.instance_id = params->instance_id;
native_sys_agent.core_id = params->core_id;
native_sys_agent.log_handle = params->log_handle;
const void *ret;

void *system_agent_p = &native_sys_agent;

native_create_instance_f ci = (native_create_instance_f)entry_point;
native_create_instance_f ci = (native_create_instance_f)params->entry_point;

ret = ci(mod_cfg, NULL, &system_agent_p);
ret = ci(params->mod_cfg, NULL, &system_agent_p);
if (!ret)
return -EINVAL;

Expand Down
3 changes: 2 additions & 1 deletion src/audio/module_adapter/library/native_system_service.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include <native_system_service.h>
#include <sof/lib_manager.h>
#include <module/module/logger.h>
#include <rtos/userspace_helper.h>

#define RSIZE_MAX 0x7FFFFFFF

Expand Down Expand Up @@ -162,7 +163,7 @@ AdspErrorCode native_system_service_get_interface(enum interface_id id,
return ADSP_NO_ERROR;
}

const struct native_system_service native_system_service = {
const APP_TASK_DATA struct native_system_service native_system_service = {
.basic = {
.log_message = native_system_service_log_message,
.safe_memcpy = native_system_service_safe_memcpy,
Expand Down
Loading
Loading