Skip to content

Commit 226be91

Browse files
committed
ipc: introduce IPC message service
This introduces a new IPC mechanism: IPC message service, where IPC transactions are centered around messages instead of raw byte streams. This provides a bit more clarity in the code as this shows what type of message is being sent. This also allows backend to select the delivery mechanism based on the message type for supported hardware. Signed-off-by: Daniel Leung <daniel.leung@intel.com>
1 parent 6a0aede commit 226be91

File tree

12 files changed

+854
-0
lines changed

12 files changed

+854
-0
lines changed

include/zephyr/ipc/ipc_msg_evts.h

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
/*
2+
* Copyright (c) 2025 Intel Corporation
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
#ifndef ZEPHYR_INCLUDE_IPC_IPC_MSG_EVTS_H_
8+
#define ZEPHYR_INCLUDE_IPC_IPC_MSG_EVTS_H_
9+
10+
#include <stddef.h>
11+
12+
#ifdef __cplusplus
13+
extern "C" {
14+
#endif
15+
16+
/**
17+
* @brief IPC Message Service Event Types
18+
* @defgroup ipc_msg_service_evt_types IPC Message Service Event Types
19+
* @ingroup ipc_msg_service_api
20+
* @{
21+
*/
22+
23+
enum ipc_msg_evts {
24+
/**
25+
* Start event type number for common event types.
26+
*
27+
* @note Starting at 1 to avoid having a type with value 0.
28+
*/
29+
IPC_MSG_EVT_COMMON_START = 1,
30+
31+
/** Remote has acknowleged the message. */
32+
IPC_MSG_EVT_REMOTE_ACK = IPC_MSG_EVT_COMMON_START,
33+
34+
/** Remote has done processing the message. */
35+
IPC_MSG_EVT_REMOTE_DONE,
36+
37+
/** Max number for common event types. */
38+
IPC_MSG_EVT_COMMON_MAX,
39+
40+
/** Starting number to define custom event types. */
41+
IPC_MSG_EVT_CUSTOM_START = 128,
42+
43+
/** Maximum number of event types. */
44+
IPC_MSG_EVT_MAX = 255
45+
};
46+
47+
/**
48+
* @}
49+
*/
50+
51+
#ifdef __cplusplus
52+
}
53+
#endif
54+
55+
#endif /* ZEPHYR_INCLUDE_IPC_IPC_MSG_EVTS_H_ */

include/zephyr/ipc/ipc_msg_queries.h

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
/*
2+
* Copyright (c) 2025 Intel Corporation
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
#ifndef ZEPHYR_INCLUDE_IPC_IPC_MSG_QUERIES_H_
8+
#define ZEPHYR_INCLUDE_IPC_IPC_MSG_QUERIES_H_
9+
10+
#include <stddef.h>
11+
12+
#ifdef __cplusplus
13+
extern "C" {
14+
#endif
15+
16+
/**
17+
* @brief IPC Message Service Query Types
18+
* @defgroup ipc_msg_service_query_types IPC Message Service Query Types
19+
* @ingroup ipc_msg_service_api
20+
* @{
21+
*/
22+
23+
enum ipc_msg_queries {
24+
/**
25+
* Start event type number for common query types.
26+
*
27+
* @note Starting at 1 to avoid having a type with value 0.
28+
*/
29+
IPC_MSG_QUERY_COMMON_START = 1,
30+
31+
/**
32+
* Ask if the backend is ready.
33+
*
34+
* Returns 0 if backend is ready. Negative value if not.
35+
*/
36+
IPC_MSG_QUERY_IS_READY = IPC_MSG_QUERY_COMMON_START,
37+
38+
/** Max number for common query types. */
39+
IPC_MSG_QUERY_COMMON_MAX,
40+
41+
/** Starting number to define custom query types. */
42+
IPC_MSG_QUERY_CUSTOM_START = 128,
43+
44+
/** Maximum number of query types. */
45+
IPC_MSG_QUERY_MAX = 255
46+
};
47+
48+
/**
49+
* @}
50+
*/
51+
52+
#ifdef __cplusplus
53+
}
54+
#endif
55+
56+
#endif /* ZEPHYR_INCLUDE_IPC_IPC_MSG_QUERIES_H_ */

0 commit comments

Comments
 (0)