summaryrefslogtreecommitdiffstats
path: root/linux-headers/linux/virtio_ring.h
diff options
context:
space:
mode:
authorBlue Swirl2012-02-04 10:37:55 +0100
committerBlue Swirl2012-02-04 10:37:55 +0100
commitf0c4d3ebc31969457850a710c25e663880072ed7 (patch)
tree70ef445017f842cbdb3c439d1b8a8c201e3f1fcc /linux-headers/linux/virtio_ring.h
parentFix build breakage from last commit. (diff)
parentPPC: E500: Populate L1CFG0 SPR (diff)
downloadqemu-f0c4d3ebc31969457850a710c25e663880072ed7.tar.gz
qemu-f0c4d3ebc31969457850a710c25e663880072ed7.tar.xz
qemu-f0c4d3ebc31969457850a710c25e663880072ed7.zip
Merge branch 'for-upstream' of git://repo.or.cz/qemu/agraf
* 'for-upstream' of git://repo.or.cz/qemu/agraf: (21 commits) PPC: E500: Populate L1CFG0 SPR PPC: e500mc: Enable processor control PPC: E500: Implement msgsnd PPC: E500: Implement msgclr PPC: Enable doorbell excp handlers PPC: Add CPU feature for processor control PPC: E500: Add doorbell defines PPC: E500: Add some more excp vectors KVM: Fix compilation on non-x86 PPC: booke206: move avail check to tlbwe PPC: booke206: Check for TLB overrun PPC: booke206: Implement tlbilx PPC: booke206: Check for min/max TLB entry size PPC: booke: add tlbnps handling PPC: booke206: allow NULL raddr in ppcmas_tlb_check PPC: rename msync to msync_4xx PPC: e500: msync is 440 only, e500 has real sync PPC: e500mc: add missing IVORs to bitmap PPC: Add IVOR 38-42 PPC: KVM: Update HIOR code to new interface ...
Diffstat (limited to 'linux-headers/linux/virtio_ring.h')
-rw-r--r--linux-headers/linux/virtio_ring.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/linux-headers/linux/virtio_ring.h b/linux-headers/linux/virtio_ring.h
index 78289eedf2..1b333e2536 100644
--- a/linux-headers/linux/virtio_ring.h
+++ b/linux-headers/linux/virtio_ring.h
@@ -135,13 +135,13 @@ static __inline__ void vring_init(struct vring *vr, unsigned int num, void *p,
vr->num = num;
vr->desc = p;
vr->avail = p + num*sizeof(struct vring_desc);
- vr->used = (void *)(((unsigned long)&vr->avail->ring[num] + align-1)
- & ~(align - 1));
+ vr->used = (void *)(((unsigned long)&vr->avail->ring[num] + sizeof(__u16)
+ + align-1) & ~(align - 1));
}
static __inline__ unsigned vring_size(unsigned int num, unsigned long align)
{
- return ((sizeof(struct vring_desc) * num + sizeof(__u16) * (2 + num)
+ return ((sizeof(struct vring_desc) * num + sizeof(__u16) * (3 + num)
+ align - 1) & ~(align - 1))
+ sizeof(__u16) * 3 + sizeof(struct vring_used_elem) * num;
}