Skip to content

Commit bf84398

Browse files
lrgirdwolgirdwood
authored andcommitted
userspace: split ipc files into user and kernel features
This is a mostly mechanical split of initial ipc logic into kernel and user files. This is the 1st stage in supporting both privileged kernel and non privileged userspace IPC commands and security surfaces. At a high level library loading and PM will reside as kernel IPC and pipeline and module will become user IPCs. There will be no impact for devices without MMU. Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
1 parent 4a74239 commit bf84398

File tree

4 files changed

+749
-563
lines changed

4 files changed

+749
-563
lines changed

src/include/ipc4/handler.h

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
/* SPDX-License-Identifier: BSD-3-Clause
2+
*
3+
* Copyright(c) 2026 Intel Corporation.
4+
*/
5+
6+
#ifndef __SOF_IPC4_HANDLER_H__
7+
#define __SOF_IPC4_HANDLER_H__
8+
9+
struct ipc4_message_request;
10+
11+
/**
12+
* \brief Processes IPC4 userspace module message.
13+
* @param[in] ipc4 IPC4 message request.
14+
* @param[in] reply IPC message reply structure.
15+
* @return IPC4_SUCCESS on success, error code otherwise.
16+
*/
17+
int ipc4_user_process_module_message(struct ipc4_message_request *ipc4, struct ipc_msg *reply);
18+
19+
/**
20+
* \brief Processes IPC4 userspace global message.
21+
* @param[in] ipc4 IPC4 message request.
22+
* @param[in] reply IPC message reply structure.
23+
* @return IPC4_SUCCESS on success, error code otherwise.
24+
*/
25+
int ipc4_user_process_glb_message(struct ipc4_message_request *ipc4, struct ipc_msg *reply);
26+
27+
/**
28+
* \brief Increment the IPC compound message pre-start counter.
29+
* @param[in] msg_id IPC message ID.
30+
*/
31+
void ipc_compound_pre_start(int msg_id);
32+
33+
/**
34+
* \brief Decrement the IPC compound message pre-start counter on return value status.
35+
* @param[in] msg_id IPC message ID.
36+
* @param[in] ret Return value of the IPC command.
37+
* @param[in] delayed True if the reply is delayed.
38+
*/
39+
void ipc_compound_post_start(uint32_t msg_id, int ret, bool delayed);
40+
41+
/**
42+
* \brief Complete the IPC compound message.
43+
* @param[in] msg_id IPC message ID.
44+
* @param[in] error Error code of the IPC command.
45+
*/
46+
void ipc_compound_msg_done(uint32_t msg_id, int error);
47+
48+
/**
49+
* \brief Wait for the IPC compound message to complete.
50+
* @return 0 on success, error code otherwise on timeout.
51+
*/
52+
int ipc_wait_for_compound_msg(void);
53+
54+
#endif /* __SOF_IPC4_HANDLER_H__ */

src/ipc/ipc4/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
# Files common to Zephyr and XTOS
44
add_local_sources(sof
55
dai.c
6-
handler.c
6+
handler-user.c
7+
handler-kernel.c
78
helper.c
89
logging.c
910
notification.c

0 commit comments

Comments
 (0)