search for: virtio_to_cpu_u64

Displaying 8 results from an estimated 8 matches for "virtio_to_cpu_u64".

Did you mean: virtio_to_cpu_u16
2014 Oct 07
0
[PATCH RFC 05/11] virtio_config: endian conversion for v1.0.
...val) { + val = cpu_to_virtio_u32(vdev, val); vdev->config->set(vdev, offset, &val, sizeof(val)); } @@ -250,12 +252,13 @@ static inline u64 virtio_cread64(struct virtio_device *vdev, { u64 ret; vdev->config->get(vdev, offset, &ret, sizeof(ret)); - return ret; + return virtio_to_cpu_u64(vdev, ret); } static inline void virtio_cwrite64(struct virtio_device *vdev, unsigned int offset, u64 val) { + val = cpu_to_virtio_u64(vdev, val); vdev->config->set(vdev, offset, &val, sizeof(val)); } -- 1.7.9.5
2014 Oct 07
0
[PATCH RFC 03/11] virtio: endianess conversion helpers
...inline u16 virtio_to_cpu_u16(const struct virtio_device *vdev, u16 v) +{ + return virtio_device_legacy(vdev) ? v : le16_to_cpu(v); +} + +static inline u32 virtio_to_cpu_u32(const struct virtio_device *vdev, u32 v) +{ + return virtio_device_legacy(vdev) ? v : le32_to_cpu(v); +} + +static inline u64 virtio_to_cpu_u64(const struct virtio_device *vdev, u64 v) +{ + return virtio_device_legacy(vdev) ? v : le64_to_cpu(v); +} + +static inline u16 cpu_to_virtio_u16(const struct virtio_device *vdev, u16 v) +{ + return virtio_device_legacy(vdev) ? v : cpu_to_le16(v); +} + +static inline u32 cpu_to_virtio_u32(const struc...
2014 Oct 07
0
[PATCH RFC 03/11] virtio: endianess conversion helpers
...inline u16 virtio_to_cpu_u16(const struct virtio_device *vdev, u16 v) +{ + return virtio_device_legacy(vdev) ? v : le16_to_cpu(v); +} + +static inline u32 virtio_to_cpu_u32(const struct virtio_device *vdev, u32 v) +{ + return virtio_device_legacy(vdev) ? v : le32_to_cpu(v); +} + +static inline u64 virtio_to_cpu_u64(const struct virtio_device *vdev, u64 v) +{ + return virtio_device_legacy(vdev) ? v : le64_to_cpu(v); +} + +static inline u16 cpu_to_virtio_u16(const struct virtio_device *vdev, u16 v) +{ + return virtio_device_legacy(vdev) ? v : cpu_to_le16(v); +} + +static inline u32 cpu_to_virtio_u32(const struc...
2014 Oct 07
14
[PATCH RFC 00/11] linux: towards virtio-1 guest support
This patchset tries to go towards implementing both virtio-1 compliant and transitional virtio drivers in Linux. Branch available at git://git.kernel.org/pub/scm/linux/kernel/git/kvms390/linux virtio-1 This is based on some old patches by Rusty to handle extended feature bits and endianness conversions. Thomas implemented the new virtio-ccw transport revision command, and I hacked up some
2014 Oct 07
14
[PATCH RFC 00/11] linux: towards virtio-1 guest support
This patchset tries to go towards implementing both virtio-1 compliant and transitional virtio drivers in Linux. Branch available at git://git.kernel.org/pub/scm/linux/kernel/git/kvms390/linux virtio-1 This is based on some old patches by Rusty to handle extended feature bits and endianness conversions. Thomas implemented the new virtio-ccw transport revision command, and I hacked up some
2014 Oct 22
0
[PATCH RFC 04/11] virtio_ring: implement endian reversal based on VERSION_1 feature.
...> /* Free the indirect table */ > - if (vq->vring.desc[i].flags & VRING_DESC_F_INDIRECT) > - kfree(phys_to_virt(vq->vring.desc[i].addr)); > + if (vq->vring.desc[i].flags & > + cpu_to_virtio16(vq->vq.vdev, VRING_DESC_F_INDIRECT)) { > + kfree(phys_to_virt(virtio_to_cpu_u64(vq->vq.vdev, > + vq->vring.desc[i].addr))); > + } > + > + while (vq->vring.desc[i].flags & > + cpu_to_virtio16(vq->vq.vdev, VRING_DESC_F_NEXT)) { > + u16 next; > > - while (vq->vring.desc[i].flags & VRING_DESC_F_NEXT) { > - i =...
2014 Oct 07
1
[PATCH RFC 04/11] virtio_ring: implement endian reversal based on VERSION_1 feature.
...ned int head) i = head; /* Free the indirect table */ - if (vq->vring.desc[i].flags & VRING_DESC_F_INDIRECT) - kfree(phys_to_virt(vq->vring.desc[i].addr)); + if (vq->vring.desc[i].flags & + cpu_to_virtio_u16(vq->vq.vdev, VRING_DESC_F_INDIRECT)) { + kfree(phys_to_virt(virtio_to_cpu_u64(vq->vq.vdev, + vq->vring.desc[i].addr))); + } + + while (vq->vring.desc[i].flags & + cpu_to_virtio_u16(vq->vq.vdev, VRING_DESC_F_NEXT)) { + u16 next; - while (vq->vring.desc[i].flags & VRING_DESC_F_NEXT) { - i = vq->vring.desc[i].next; + /* Convert en...
2014 Oct 07
1
[PATCH RFC 04/11] virtio_ring: implement endian reversal based on VERSION_1 feature.
...ned int head) i = head; /* Free the indirect table */ - if (vq->vring.desc[i].flags & VRING_DESC_F_INDIRECT) - kfree(phys_to_virt(vq->vring.desc[i].addr)); + if (vq->vring.desc[i].flags & + cpu_to_virtio_u16(vq->vq.vdev, VRING_DESC_F_INDIRECT)) { + kfree(phys_to_virt(virtio_to_cpu_u64(vq->vq.vdev, + vq->vring.desc[i].addr))); + } + + while (vq->vring.desc[i].flags & + cpu_to_virtio_u16(vq->vq.vdev, VRING_DESC_F_NEXT)) { + u16 next; - while (vq->vring.desc[i].flags & VRING_DESC_F_NEXT) { - i = vq->vring.desc[i].next; + /* Convert en...