Zephyr API 3.6.99
Loading...
Searching...
No Matches
ipc_static_vrings.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_STATIC_VRINGS_H_
8#define ZEPHYR_INCLUDE_IPC_SERVICE_IPC_STATIC_VRINGS_H_
9
11#include <openamp/open_amp.h>
12#include <metal/device.h>
13
14#ifdef __cplusplus
15extern "C" {
16#endif
17
26#define VRING_COUNT (2)
27
34#define MEM_ALIGNMENT CONFIG_IPC_SERVICE_STATIC_VRINGS_MEM_ALIGNMENT
35
45typedef void (*ipc_notify_cb)(struct virtqueue *vq, void *priv);
46
53 struct virtio_device vdev;
54
56 metal_phys_addr_t shm_physmap[1];
57
59 struct metal_device shm_device;
60
63
66
69
71 size_t vring_size;
72
75
77 size_t shm_size;
78
80 struct metal_io_region *shm_io;
81
83 struct virtio_vring_info rvrings[VRING_COUNT];
84
86 struct virtqueue *vq[VRING_COUNT];
87
89 void *priv;
90
93};
94
107int ipc_static_vrings_init(struct ipc_static_vrings *vr, unsigned int role);
108
119int ipc_static_vrings_deinit(struct ipc_static_vrings *vr, unsigned int role);
120
125#ifdef __cplusplus
126}
127#endif
128
129#endif /* ZEPHYR_INCLUDE_IPC_SERVICE_IPC_STATIC_VRINGS_H_ */
#define VRING_COUNT
Number of used VRING buffers.
Definition ipc_static_vrings.h:26
int ipc_static_vrings_init(struct ipc_static_vrings *vr, unsigned int role)
Init the static VRINGs.
void(* ipc_notify_cb)(struct virtqueue *vq, void *priv)
Define the notify callback.
Definition ipc_static_vrings.h:45
int ipc_static_vrings_deinit(struct ipc_static_vrings *vr, unsigned int role)
Deinitialise the static VRINGs.
__UINTPTR_TYPE__ uintptr_t
Definition stdint.h:105
Static VRINGs structure.
Definition ipc_static_vrings.h:51
ipc_notify_cb notify_cb
Notify callback.
Definition ipc_static_vrings.h:92
struct virtio_device vdev
virtIO device.
Definition ipc_static_vrings.h:53
struct metal_device shm_device
SHM device.
Definition ipc_static_vrings.h:59
struct metal_io_region * shm_io
SHM IO region.
Definition ipc_static_vrings.h:80
void * priv
Private data to be passed to the notify callback.
Definition ipc_static_vrings.h:89
uintptr_t rx_addr
RX VRING address.
Definition ipc_static_vrings.h:68
uintptr_t tx_addr
TX VRING address.
Definition ipc_static_vrings.h:65
size_t shm_size
Share memory region size.
Definition ipc_static_vrings.h:77
struct virtqueue * vq[(2)]
Virtqueues.
Definition ipc_static_vrings.h:86
size_t vring_size
VRING size.
Definition ipc_static_vrings.h:71
struct virtio_vring_info rvrings[(2)]
VRINGs.
Definition ipc_static_vrings.h:83
uintptr_t shm_addr
Shared memory region address.
Definition ipc_static_vrings.h:74
metal_phys_addr_t shm_physmap[1]
SHM physmap.
Definition ipc_static_vrings.h:56
uintptr_t status_reg_addr
SHM and addresses.
Definition ipc_static_vrings.h:62