Zephyr API Documentation  3.0.0
A Scalable Open Source RTOS
3.0.0
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
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
10#include <ipc/ipc_service.h>
11#include <openamp/open_amp.h>
12#include <metal/device.h>
13
14#ifdef __cplusplus
15extern "C" {
16#endif
17
25#define NUM_ENDPOINTS CONFIG_IPC_SERVICE_NUM_ENDPOINTS_PER_INSTANCE
26
27struct ipc_rpmsg_ept;
28
38typedef void (*rpmsg_ept_bound_cb)(struct ipc_rpmsg_ept *ept);
39
46 struct rpmsg_endpoint ep;
47
49 char name[RPMSG_NAME_SIZE];
50
53
55 volatile bool bound;
56
58 const struct ipc_service_cb *cb;
59
61 void *priv;
62};
63
71
73 struct rpmsg_virtio_device rvdev;
74
76 struct rpmsg_virtio_shm_pool shm_pool;
77
80
82 rpmsg_ept_cb cb;
83
85 struct k_mutex mtx;
86};
87
107 unsigned int role,
108 struct metal_io_region *shm_io,
109 struct virtio_device *vdev,
110 void *shb, size_t size,
111 rpmsg_ns_bind_cb ns_bind_cb);
112
125int ipc_rpmsg_register_ept(struct ipc_rpmsg_instance *instance, unsigned int role,
126 struct ipc_rpmsg_ept *ept);
127
132#ifdef __cplusplus
133}
134#endif
135
136#endif /* ZEPHYR_INCLUDE_IPC_SERVICE_IPC_RPMSG_H_ */
int ipc_rpmsg_register_ept(struct ipc_rpmsg_instance *instance, unsigned int role, struct ipc_rpmsg_ept *ept)
Register an endpoint.
int ipc_rpmsg_init(struct ipc_rpmsg_instance *instance, unsigned int role, 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.
void(* rpmsg_ept_bound_cb)(struct ipc_rpmsg_ept *ept)
Define the bound callback.
Definition: ipc_rpmsg.h:38
#define NUM_ENDPOINTS
Definition: ipc_rpmsg.h:25
__UINT32_TYPE__ uint32_t
Definition: stdint.h:60
Endpoint structure.
Definition: ipc_rpmsg.h:44
char name[RPMSG_NAME_SIZE]
Definition: ipc_rpmsg.h:49
struct rpmsg_endpoint ep
Definition: ipc_rpmsg.h:46
const struct ipc_service_cb * cb
Definition: ipc_rpmsg.h:58
volatile bool bound
Definition: ipc_rpmsg.h:55
void * priv
Definition: ipc_rpmsg.h:61
uint32_t dest
Definition: ipc_rpmsg.h:52
RPMsg instance structure.
Definition: ipc_rpmsg.h:68
struct ipc_rpmsg_ept endpoint[CONFIG_IPC_SERVICE_NUM_ENDPOINTS_PER_INSTANCE]
Definition: ipc_rpmsg.h:70
struct rpmsg_virtio_shm_pool shm_pool
Definition: ipc_rpmsg.h:76
rpmsg_ept_cb cb
Definition: ipc_rpmsg.h:82
rpmsg_ept_bound_cb bound_cb
Definition: ipc_rpmsg.h:79
struct rpmsg_virtio_device rvdev
Definition: ipc_rpmsg.h:73
struct k_mutex mtx
Definition: ipc_rpmsg.h:85
Event callback structure.
Definition: ipc_service.h:66
Definition: kernel.h:2629