summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: a5112a5)
raw | patch | inline | side by side (parent: a5112a5)
author | Wendy Liang <jliang@xilinx.com> | |
Tue, 2 Aug 2016 23:56:50 +0000 (16:56 -0700) | ||
committer | Wendy Liang <jliang@xilinx.com> | |
Thu, 13 Oct 2016 05:01:46 +0000 (22:01 -0700) |
Add shared memory I/O region to the virtqueue struct.
Signed-off-by: Wendy Liang <jliang@xilinx.com>
Signed-off-by: Wendy Liang <jliang@xilinx.com>
lib/include/openamp/virtqueue.h | patch | blob | history | |
lib/rpmsg/remote_device.c | patch | blob | history | |
lib/virtio/virtqueue.c | patch | blob | history |
index 2ab53717f1ee571e01b4c5614478518ffa1f755c..48b52f3e14c9c0ef517486a80b80e841c09ae19f 100644 (file)
#include "openamp/virtio_ring.h"
#include "openamp/env.h"
#include "metal/dma.h"
+#include "metal/io.h"
/*Error Codes*/
#define VQ_ERROR_BASE -3000
struct vring vq_ring;
uint16_t vq_free_cnt;
uint16_t vq_queued_cnt;
+ /** Shared memory I/O region */
+ struct metal_io_region *shm_io;
/*
* Head of the free chain in the descriptor table. If
char *name, struct vring_alloc_info *ring,
void (*callback) (struct virtqueue * vq),
void (*notify) (struct virtqueue * vq),
+ struct metal_io_region *shm_io,
struct virtqueue **v_queue);
int virtqueue_add_buffer(struct virtqueue *vq, struct metal_sg *sg,
index 9187d69af0964eb6e59dec8d2ea436bd9477a4ab..acfb449a6e7e4f1f1ebc3885e01c03730d6f4e93 100644 (file)
@@ -412,6 +412,7 @@ int rpmsg_rdev_create_virtqueues(struct virtio_device *dev, int flags, int nvqs,
status =
virtqueue_create(dev, idx, (char *)names[idx], &ring_info,
callbacks[idx], hil_vring_notify,
+ rdev->proc->sh_buff.io,
&vqs[idx]);
if (status != RPMSG_SUCCESS) {
diff --git a/lib/virtio/virtqueue.c b/lib/virtio/virtqueue.c
index fcabeab349fee686e46493957f5bb01ecc8f61ed..8a713b5393c4d4dd2a19daeefdedf62af6e82eca 100644 (file)
--- a/lib/virtio/virtqueue.c
+++ b/lib/virtio/virtqueue.c
* when message is available on VirtIO queue
* @param notify - Pointer to notify function, used to notify
* other side that there is job available for it
+ * @param shm_io - shared memory I/O region of the virtqueue
* @param v_queue - Created VirtIO queue.
*
* @return - Function status
char *name, struct vring_alloc_info *ring,
void (*callback) (struct virtqueue * vq),
void (*notify) (struct virtqueue * vq),
+ struct metal_io_region *shm_io,
struct virtqueue **v_queue)
{
vq->vq_free_cnt = vq->vq_nentries;
vq->callback = callback;
vq->notify = notify;
+ vq->shm_io = shm_io;
//TODO : Whether we want to support indirect addition or not.
vq->vq_ring_size = vring_size(ring->num_descs, ring->align);