Date: Mon, 19 Feb 2018 19:31:18 +0000 (UTC) From: Bryan Venteicher <bryanv@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329602 - head/sys/dev/virtio Message-ID: <201802191931.w1JJVIcL092997@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: bryanv Date: Mon Feb 19 19:31:18 2018 New Revision: 329602 URL: https://svnweb.freebsd.org/changeset/base/329602 Log: Add more virtqueue getter methods MFC after: 2 weeks Modified: head/sys/dev/virtio/virtqueue.c head/sys/dev/virtio/virtqueue.h Modified: head/sys/dev/virtio/virtqueue.c ============================================================================== --- head/sys/dev/virtio/virtqueue.c Mon Feb 19 19:28:24 2018 (r329601) +++ head/sys/dev/virtio/virtqueue.c Mon Feb 19 19:31:18 2018 (r329602) @@ -369,6 +369,33 @@ virtqueue_paddr(struct virtqueue *vq) return (vtophys(vq->vq_ring_mem)); } +vm_paddr_t +virtqueue_desc_paddr(struct virtqueue *vq) +{ + + return (vtophys(vq->vq_ring.desc)); +} + +vm_paddr_t +virtqueue_avail_paddr(struct virtqueue *vq) +{ + + return (vtophys(vq->vq_ring.avail)); +} + +vm_paddr_t +virtqueue_used_paddr(struct virtqueue *vq) +{ + + return (vtophys(vq->vq_ring.used)); +} + +uint16_t +virtqueue_index(struct virtqueue *vq) +{ + return (vq->vq_queue_index); +} + int virtqueue_size(struct virtqueue *vq) { Modified: head/sys/dev/virtio/virtqueue.h ============================================================================== --- head/sys/dev/virtio/virtqueue.h Mon Feb 19 19:28:24 2018 (r329601) +++ head/sys/dev/virtio/virtqueue.h Mon Feb 19 19:31:18 2018 (r329602) @@ -84,7 +84,11 @@ void virtqueue_disable_intr(struct virtqueue *vq); /* Get physical address of the virtqueue ring. */ vm_paddr_t virtqueue_paddr(struct virtqueue *vq); +vm_paddr_t virtqueue_desc_paddr(struct virtqueue *vq); +vm_paddr_t virtqueue_avail_paddr(struct virtqueue *vq); +vm_paddr_t virtqueue_used_paddr(struct virtqueue *vq); +uint16_t virtqueue_index(struct virtqueue *vq); int virtqueue_full(struct virtqueue *vq); int virtqueue_empty(struct virtqueue *vq); int virtqueue_size(struct virtqueue *vq);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201802191931.w1JJVIcL092997>