Zephyr API Documentation 4.0.0-rc2
A Scalable Open Source RTOS
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
13#ifdef __cplusplus
14extern "C" {
15#endif
16
25#define VRING_COUNT (2)
26
33#define MEM_ALIGNMENT CONFIG_IPC_SERVICE_STATIC_VRINGS_MEM_ALIGNMENT
34
44typedef void (*ipc_notify_cb)(struct virtqueue *vq, void *priv);
45
52 struct virtio_device vdev;
53
55 metal_phys_addr_t shm_physmap[1];
56
59
62
65
67 size_t vring_size;
68
71
73 size_t shm_size;
74
76 struct metal_io_region shm_io;
77
79 struct virtio_vring_info rvrings[VRING_COUNT];
80
82 struct virtqueue *vq[VRING_COUNT];
83
85 void *priv;
86
89};
90
103int ipc_static_vrings_init(struct ipc_static_vrings *vr, unsigned int role);
104
115int ipc_static_vrings_deinit(struct ipc_static_vrings *vr, unsigned int role);
116
121#ifdef __cplusplus
122}
123#endif
124
125#endif /* ZEPHYR_INCLUDE_IPC_SERVICE_IPC_STATIC_VRINGS_H_ */
#define VRING_COUNT
Number of used VRING buffers.
Definition ipc_static_vrings.h:25
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:44
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:50
ipc_notify_cb notify_cb
Notify callback.
Definition ipc_static_vrings.h:88
struct virtio_device vdev
virtIO device.
Definition ipc_static_vrings.h:52
void * priv
Private data to be passed to the notify callback.
Definition ipc_static_vrings.h:85
uintptr_t rx_addr
RX VRING address.
Definition ipc_static_vrings.h:64
uintptr_t tx_addr
TX VRING address.
Definition ipc_static_vrings.h:61
size_t shm_size
Share memory region size.
Definition ipc_static_vrings.h:73
struct virtqueue * vq[(2)]
Virtqueues.
Definition ipc_static_vrings.h:82
size_t vring_size
VRING size.
Definition ipc_static_vrings.h:67
struct metal_io_region shm_io
SHM IO region.
Definition ipc_static_vrings.h:76
struct virtio_vring_info rvrings[(2)]
VRINGs.
Definition ipc_static_vrings.h:79
uintptr_t shm_addr
Shared memory region address.
Definition ipc_static_vrings.h:70
metal_phys_addr_t shm_physmap[1]
SHM physmap.
Definition ipc_static_vrings.h:55
uintptr_t status_reg_addr
SHM and addresses.
Definition ipc_static_vrings.h:58