vring: remove
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Fam Zheng <famz@redhat.com> Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
This commit is contained in:
parent
e24a47c5b7
commit
fee089e4e2
6 changed files with 0 additions and 679 deletions
|
|
@ -1,75 +0,0 @@
|
|||
#ifndef VRING_ACCESSORS_H
|
||||
#define VRING_ACCESSORS_H
|
||||
|
||||
#include "standard-headers/linux/virtio_ring.h"
|
||||
#include "hw/virtio/virtio.h"
|
||||
#include "hw/virtio/virtio-access.h"
|
||||
|
||||
static inline uint16_t vring_get_used_idx(VirtIODevice *vdev, Vring *vring)
|
||||
{
|
||||
return virtio_tswap16(vdev, vring->vr.used->idx);
|
||||
}
|
||||
|
||||
static inline void vring_set_used_idx(VirtIODevice *vdev, Vring *vring,
|
||||
uint16_t idx)
|
||||
{
|
||||
vring->vr.used->idx = virtio_tswap16(vdev, idx);
|
||||
}
|
||||
|
||||
static inline uint16_t vring_get_avail_idx(VirtIODevice *vdev, Vring *vring)
|
||||
{
|
||||
return virtio_tswap16(vdev, vring->vr.avail->idx);
|
||||
}
|
||||
|
||||
static inline uint16_t vring_get_avail_ring(VirtIODevice *vdev, Vring *vring,
|
||||
int i)
|
||||
{
|
||||
return virtio_tswap16(vdev, vring->vr.avail->ring[i]);
|
||||
}
|
||||
|
||||
static inline void vring_set_used_ring_id(VirtIODevice *vdev, Vring *vring,
|
||||
int i, uint32_t id)
|
||||
{
|
||||
vring->vr.used->ring[i].id = virtio_tswap32(vdev, id);
|
||||
}
|
||||
|
||||
static inline void vring_set_used_ring_len(VirtIODevice *vdev, Vring *vring,
|
||||
int i, uint32_t len)
|
||||
{
|
||||
vring->vr.used->ring[i].len = virtio_tswap32(vdev, len);
|
||||
}
|
||||
|
||||
static inline uint16_t vring_get_used_flags(VirtIODevice *vdev, Vring *vring)
|
||||
{
|
||||
return virtio_tswap16(vdev, vring->vr.used->flags);
|
||||
}
|
||||
|
||||
static inline uint16_t vring_get_avail_flags(VirtIODevice *vdev, Vring *vring)
|
||||
{
|
||||
return virtio_tswap16(vdev, vring->vr.avail->flags);
|
||||
}
|
||||
|
||||
static inline void vring_set_used_flags(VirtIODevice *vdev, Vring *vring,
|
||||
uint16_t flags)
|
||||
{
|
||||
vring->vr.used->flags |= virtio_tswap16(vdev, flags);
|
||||
}
|
||||
|
||||
static inline void vring_clear_used_flags(VirtIODevice *vdev, Vring *vring,
|
||||
uint16_t flags)
|
||||
{
|
||||
vring->vr.used->flags &= virtio_tswap16(vdev, ~flags);
|
||||
}
|
||||
|
||||
static inline unsigned int vring_get_num(Vring *vring)
|
||||
{
|
||||
return vring->vr.num;
|
||||
}
|
||||
|
||||
/* Are there more descriptors available? */
|
||||
static inline bool vring_more_avail(VirtIODevice *vdev, Vring *vring)
|
||||
{
|
||||
return vring_get_avail_idx(vdev, vring) != vring->last_avail_idx;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
@ -1,51 +0,0 @@
|
|||
/* Copyright 2012 Red Hat, Inc. and/or its affiliates
|
||||
* Copyright IBM, Corp. 2012
|
||||
*
|
||||
* Based on Linux 2.6.39 vhost code:
|
||||
* Copyright (C) 2009 Red Hat, Inc.
|
||||
* Copyright (C) 2006 Rusty Russell IBM Corporation
|
||||
*
|
||||
* Author: Michael S. Tsirkin <mst@redhat.com>
|
||||
* Stefan Hajnoczi <stefanha@redhat.com>
|
||||
*
|
||||
* Inspiration, some code, and most witty comments come from
|
||||
* Documentation/virtual/lguest/lguest.c, by Rusty Russell
|
||||
*
|
||||
* This work is licensed under the terms of the GNU GPL, version 2.
|
||||
*/
|
||||
|
||||
#ifndef VRING_H
|
||||
#define VRING_H
|
||||
|
||||
#include "qemu-common.h"
|
||||
#include "standard-headers/linux/virtio_ring.h"
|
||||
#include "hw/virtio/virtio.h"
|
||||
|
||||
typedef struct {
|
||||
MemoryRegion *mr_desc; /* memory region for the vring desc */
|
||||
MemoryRegion *mr_avail; /* memory region for the vring avail */
|
||||
MemoryRegion *mr_used; /* memory region for the vring used */
|
||||
struct vring vr; /* virtqueue vring mapped to host memory */
|
||||
uint16_t last_avail_idx; /* last processed avail ring index */
|
||||
uint16_t last_used_idx; /* last processed used ring index */
|
||||
uint16_t signalled_used; /* EVENT_IDX state */
|
||||
bool signalled_used_valid;
|
||||
bool broken; /* was there a fatal error? */
|
||||
} Vring;
|
||||
|
||||
/* Fail future vring_pop() and vring_push() calls until reset */
|
||||
static inline void vring_set_broken(Vring *vring)
|
||||
{
|
||||
vring->broken = true;
|
||||
}
|
||||
|
||||
bool vring_setup(Vring *vring, VirtIODevice *vdev, int n);
|
||||
void vring_teardown(Vring *vring, VirtIODevice *vdev, int n);
|
||||
void vring_disable_notification(VirtIODevice *vdev, Vring *vring);
|
||||
void vring_enable_notification(VirtIODevice *vdev, Vring *vring);
|
||||
bool vring_should_notify(VirtIODevice *vdev, Vring *vring);
|
||||
void *vring_pop(VirtIODevice *vdev, Vring *vring, size_t sz);
|
||||
void vring_push(VirtIODevice *vdev, Vring *vring, VirtQueueElement *elem,
|
||||
int len);
|
||||
|
||||
#endif /* VRING_H */
|
||||
Loading…
Add table
Add a link
Reference in a new issue