Skip to content

Commit 90dd2d6

Browse files
committed
syscall test
1 parent 7c41577 commit 90dd2d6

3 files changed

Lines changed: 34 additions & 1 deletion

File tree

src/audio/module_adapter/library/userspace_proxy_user.c

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,21 @@
2525
#include <sof/audio/module_adapter/library/userspace_proxy.h>
2626
#include <sof/audio/module_adapter/library/userspace_proxy_user.h>
2727

28+
/* include definitions from generated file */
29+
#include <zephyr/syscalls/userspace_proxy_user.h>
30+
2831
void userspace_proxy_handle_request(struct processing_module *mod, struct module_params *params)
2932
{
3033
const struct module_interface *ops = params->context->interface;
31-
34+
params->core = get_core_id();
3235
switch (params->cmd) {
3336
case USER_PROXY_MOD_CMD_AGENT_START:
3437
/* Set pointer to user accessible mod_cfg structure. */
3538
params->ext.agent.params.mod_cfg = &params->ext.agent.mod_cfg;
3639

3740
params->status = params->ext.agent.start_fn(&params->ext.agent.params,
3841
&params->ext.agent.out_interface);
42+
cache_flush(params->dump_ptr, CONFIG_MM_DRV_PAGE_SIZE);
3943
break;
4044

4145
case USER_PROXY_MOD_CMD_INIT:
@@ -120,3 +124,26 @@ void userspace_proxy_worker_handler(struct k_work_user *work_item)
120124
userspace_proxy_handle_request(params->mod, params);
121125
k_event_post(user_work_item->event, DP_TASK_EVENT_IPC_DONE);
122126
}
127+
128+
#include <zephyr/internal/syscall_handler.h>
129+
int z_impl_get_core_id(void)
130+
{
131+
return cpu_get_id() + 100;
132+
}
133+
int z_vrfy_get_core_id(void)
134+
{
135+
return z_impl_get_core_id();
136+
}
137+
#include <zephyr/syscalls/get_core_id_mrsh.c>
138+
139+
int z_impl_cache_flush(void* addr, uint32_t size)
140+
{
141+
sys_cache_data_flush_range((__sparse_force void *)addr, size);
142+
//sys_cache_data_flush_all();
143+
return 0;
144+
}
145+
int z_vrfy_cache_flush(void* addr, uint32_t size)
146+
{
147+
return z_impl_cache_flush(addr, size);
148+
}
149+
#include <zephyr/syscalls/cache_flush_mrsh.c>

src/include/sof/audio/module_adapter/library/userspace_proxy_user.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88
#ifndef __SOF_AUDIO_USERSPACE_PROXY_USER_H__
99
#define __SOF_AUDIO_USERSPACE_PROXY_USER_H__
1010

11+
__syscall int get_core_id(void);
12+
__syscall int cache_flush(void *addr, uint32_t size);
13+
1114
#if CONFIG_SOF_USERSPACE_PROXY
1215
struct module_agent_params {
1316
system_agent_start_fn start_fn;
@@ -63,6 +66,7 @@ enum userspace_proxy_cmd {
6366
struct module_params {
6467
enum userspace_proxy_cmd cmd;
6568
int status;
69+
int core;
6670
struct processing_module *mod;
6771
struct userspace_context *context;
6872
/* The field used in the union depends on the value of cmd */

zephyr/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -495,6 +495,8 @@ if(CONFIG_SOF_USERSPACE_INTERFACE_DMA)
495495
zephyr_syscall_header(include/sof/lib/sof_dma.h)
496496
endif()
497497

498+
zephyr_syscall_header(${SOF_SRC_PATH}/include/sof/audio/module_adapter/library/userspace_proxy_user.h)
499+
498500
# Mandatory Files used on all platforms.
499501
# Commented files will be added/removed as integration dictates.
500502
zephyr_library_sources(

0 commit comments

Comments
 (0)