Zephyr API Documentation 4.0.0
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 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
7#ifndef ZEPHYR_INCLUDE_IPC_SERVICE_IPC_RPMSG_H_
8#define ZEPHYR_INCLUDE_IPC_SERVICE_IPC_RPMSG_H_
9
11#include <openamp/open_amp.h>
12#include <metal/device.h>
13
14#ifdef __cplusplus
15extern "C" {
16#endif
17
26#define NUM_ENDPOINTS CONFIG_IPC_SERVICE_BACKEND_RPMSG_NUM_ENDPOINTS_PER_INSTANCE
27
28struct ipc_rpmsg_ept;
29
39typedef void (*rpmsg_ept_bound_cb)(struct ipc_rpmsg_ept *ept);
40
47 struct rpmsg_endpoint ep;
48
50 char name[RPMSG_NAME_SIZE];
51
54
56 volatile bool bound;
57
59 const struct ipc_service_cb *cb;
60
62 void *priv;
63};
64
72
74 struct rpmsg_virtio_device rvdev;
75
77 struct rpmsg_virtio_shm_pool shm_pool;
78
81
83 rpmsg_ept_cb cb;
84
86 struct k_mutex mtx;
87};
88
109 unsigned int role,
110 unsigned int buffer_size,
111 struct metal_io_region *shm_io,
112 struct virtio_device *vdev,
113 void *shb, size_t size,
114 rpmsg_ns_bind_cb ns_bind_cb);
115
116
128 unsigned int role);
129
142int ipc_rpmsg_register_ept(struct ipc_rpmsg_instance *instance, unsigned int role,
143 struct ipc_rpmsg_ept *ept);
144
149#ifdef __cplusplus
150}
151#endif
152
153#endif /* ZEPHYR_INCLUDE_IPC_SERVICE_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:39
#define NUM_ENDPOINTS
Number of endpoints.
Definition ipc_rpmsg.h:26
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:45
char name[RPMSG_NAME_SIZE]
Name of the endpoint.
Definition ipc_rpmsg.h:50
struct rpmsg_endpoint ep
RPMsg endpoint.
Definition ipc_rpmsg.h:47
const struct ipc_service_cb * cb
Callbacks.
Definition ipc_rpmsg.h:59
volatile bool bound
Bound flag.
Definition ipc_rpmsg.h:56
void * priv
Private data to be passed to the endpoint callbacks.
Definition ipc_rpmsg.h:62
uint32_t dest
Destination endpoint.
Definition ipc_rpmsg.h:53
RPMsg instance structure.
Definition ipc_rpmsg.h:69
struct rpmsg_virtio_shm_pool shm_pool
SHM pool.
Definition ipc_rpmsg.h:77
rpmsg_ept_cb cb
EPT (instance) callback.
Definition ipc_rpmsg.h:83
rpmsg_ept_bound_cb bound_cb
EPT (instance) bound callback.
Definition ipc_rpmsg.h:80
struct rpmsg_virtio_device rvdev
RPMsg virtIO device.
Definition ipc_rpmsg.h:74
struct k_mutex mtx
Mutex for the instance.
Definition ipc_rpmsg.h:86
struct ipc_rpmsg_ept endpoint[CONFIG_IPC_SERVICE_BACKEND_RPMSG_NUM_ENDPOINTS_PER_INSTANCE]
Endpoints in the instance.
Definition ipc_rpmsg.h:71
Event callback structure.
Definition ipc_service.h:145
Mutex Structure.
Definition kernel.h:2994