Zephyr API Documentation 4.5.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
ipc_rpmsg.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2021 Carlo Caione <ccaione@baylibre.com>
3 * Copyright 2025-2026 Arm Limited and/or its affiliates <open-source-office@arm.com>
4 *
5 * SPDX-License-Identifier: Apache-2.0
6 */
7
8#ifndef ZEPHYR_INCLUDE_IPC_IPC_RPMSG_H_
9#define ZEPHYR_INCLUDE_IPC_IPC_RPMSG_H_
10
12#include <openamp/open_amp.h>
13#include <metal/device.h>
14
15#ifdef __cplusplus
16extern "C" {
17#endif
18
25
27#define NUM_ENDPOINTS CONFIG_IPC_SERVICE_RPMSG_NUM_ENDPOINTS_PER_INSTANCE
28
29struct ipc_rpmsg_ept;
30
40typedef void (*rpmsg_ept_bound_cb)(struct ipc_rpmsg_ept *ept);
41
48 struct rpmsg_endpoint ep;
49
51 char name[RPMSG_NAME_SIZE];
52
55
57 volatile bool bound;
58
60 const struct ipc_service_cb *cb;
61
63 void *priv;
64};
65
73
75 struct rpmsg_virtio_device rvdev;
76
78 struct rpmsg_virtio_shm_pool shm_pool;
79
82
84 rpmsg_ept_cb cb;
85
87 struct k_mutex mtx;
88};
89
110 unsigned int role,
111 unsigned int buffer_size,
112 struct metal_io_region *shm_io,
113 struct virtio_device *vdev,
114 void *shb, size_t size,
115 rpmsg_ns_bind_cb ns_bind_cb);
116
117
129 unsigned int role);
130
143int ipc_rpmsg_register_ept(struct ipc_rpmsg_instance *instance, unsigned int role,
144 struct ipc_rpmsg_ept *ept);
145
149
150#ifdef __cplusplus
151}
152#endif
153
154#endif /* ZEPHYR_INCLUDE_IPC_IPC_RPMSG_H_ */
int ipc_rpmsg_init(struct ipc_rpmsg_instance *instance, unsigned int role, unsigned int buffer_size, struct metal_io_region *shm_io, struct virtio_device *vdev, void *shb, size_t size, rpmsg_ns_bind_cb ns_bind_cb)
Init an RPMsg instance.
int ipc_rpmsg_register_ept(struct ipc_rpmsg_instance *instance, unsigned int role, struct ipc_rpmsg_ept *ept)
Register an endpoint.
void(* rpmsg_ept_bound_cb)(struct ipc_rpmsg_ept *ept)
Define the bound callback.
Definition ipc_rpmsg.h:40
#define NUM_ENDPOINTS
Number of endpoints.
Definition ipc_rpmsg.h:27
int ipc_rpmsg_deinit(struct ipc_rpmsg_instance *instance, unsigned int role)
Deinit an RPMsg instance.
__UINT32_TYPE__ uint32_t
Definition stdint.h:90
Endpoint structure.
Definition ipc_rpmsg.h:46
char name[RPMSG_NAME_SIZE]
Name of the endpoint.
Definition ipc_rpmsg.h:51
struct rpmsg_endpoint ep
RPMsg endpoint.
Definition ipc_rpmsg.h:48
const struct ipc_service_cb * cb
Callbacks.
Definition ipc_rpmsg.h:60
volatile bool bound
Bound flag.
Definition ipc_rpmsg.h:57
void * priv
Private data to be passed to the endpoint callbacks.
Definition ipc_rpmsg.h:63
uint32_t dest
Destination endpoint.
Definition ipc_rpmsg.h:54
RPMsg instance structure.
Definition ipc_rpmsg.h:70
struct rpmsg_virtio_shm_pool shm_pool
SHM pool.
Definition ipc_rpmsg.h:78
rpmsg_ept_cb cb
EPT (instance) callback.
Definition ipc_rpmsg.h:84
rpmsg_ept_bound_cb bound_cb
EPT (instance) bound callback.
Definition ipc_rpmsg.h:81
struct rpmsg_virtio_device rvdev
RPMsg virtIO device.
Definition ipc_rpmsg.h:75
struct ipc_rpmsg_ept endpoint[CONFIG_IPC_SERVICE_RPMSG_NUM_ENDPOINTS_PER_INSTANCE]
Endpoints in the instance.
Definition ipc_rpmsg.h:72
struct k_mutex mtx
Mutex for the instance.
Definition ipc_rpmsg.h:87
Event callback structure.
Definition ipc_service.h:147
Kernel mutex structure.
Definition kernel.h:3774