search for: __cpu_to_virtio

Displaying 14 results from an estimated 14 matches for "__cpu_to_virtio".

Did you mean: __cpu_to_virtio16
2014 Oct 22
0
[PATCH RFC v2 06/16] virtio: make endian-ness depend on virtio 1.0
...ruct virtio_device *vdev, __virtio##bits val) \ { \ - return __virtio##bits##_to_cpu(false, val); \ + return __virtio##bits##_to_cpu(virtio_has_feature(vdev, VIRTIO_F_VERSION_1), val); \ } \ static inline __virtio##bits cpu_to_virtio##bits(struct virtio_device *vdev, u##bits val) \ { \ - return __cpu_to_virtio##bits(false, val); \ + return __cpu_to_virtio##bits(virtio_has_feature(vdev, VIRTIO_F_VERSION_1), val); \ } DEFINE_VIRTIO_XX_TO_CPU(16) -- MST
2014 Oct 22
1
[PATCH RFC v3 06/16] virtio: make endian-ness depend on virtio 1.0
...ruct virtio_device *vdev, __virtio##bits val) \ { \ - return __virtio##bits##_to_cpu(false, val); \ + return __virtio##bits##_to_cpu(virtio_has_feature(vdev, VIRTIO_F_VERSION_1), val); \ } \ static inline __virtio##bits cpu_to_virtio##bits(struct virtio_device *vdev, u##bits val) \ { \ - return __cpu_to_virtio##bits(false, val); \ + return __cpu_to_virtio##bits(virtio_has_feature(vdev, VIRTIO_F_VERSION_1), val); \ } DEFINE_VIRTIO_XX_TO_CPU(16) -- MST
2014 Oct 23
0
[PATCH RFC v4 06/17] virtio: make endian-ness depend on virtio 1.0
...ruct virtio_device *vdev, __virtio##bits val) \ { \ - return __virtio##bits##_to_cpu(false, val); \ + return __virtio##bits##_to_cpu(virtio_has_feature(vdev, VIRTIO_F_VERSION_1), val); \ } \ static inline __virtio##bits cpu_to_virtio##bits(struct virtio_device *vdev, u##bits val) \ { \ - return __cpu_to_virtio##bits(false, val); \ + return __cpu_to_virtio##bits(virtio_has_feature(vdev, VIRTIO_F_VERSION_1), val); \ } static inline u16 virtio16_to_cpu(struct virtio_device *vdev, __virtio16 val) -- MST
2014 Oct 22
0
[PATCH RFC v2 06/16] virtio: make endian-ness depend on virtio 1.0
...ruct virtio_device *vdev, __virtio##bits val) \ { \ - return __virtio##bits##_to_cpu(false, val); \ + return __virtio##bits##_to_cpu(virtio_has_feature(vdev, VIRTIO_F_VERSION_1), val); \ } \ static inline __virtio##bits cpu_to_virtio##bits(struct virtio_device *vdev, u##bits val) \ { \ - return __cpu_to_virtio##bits(false, val); \ + return __cpu_to_virtio##bits(virtio_has_feature(vdev, VIRTIO_F_VERSION_1), val); \ } DEFINE_VIRTIO_XX_TO_CPU(16) -- MST
2014 Oct 22
1
[PATCH RFC v3 06/16] virtio: make endian-ness depend on virtio 1.0
...ruct virtio_device *vdev, __virtio##bits val) \ { \ - return __virtio##bits##_to_cpu(false, val); \ + return __virtio##bits##_to_cpu(virtio_has_feature(vdev, VIRTIO_F_VERSION_1), val); \ } \ static inline __virtio##bits cpu_to_virtio##bits(struct virtio_device *vdev, u##bits val) \ { \ - return __cpu_to_virtio##bits(false, val); \ + return __cpu_to_virtio##bits(virtio_has_feature(vdev, VIRTIO_F_VERSION_1), val); \ } DEFINE_VIRTIO_XX_TO_CPU(16) -- MST
2014 Oct 23
0
[PATCH RFC v4 06/17] virtio: make endian-ness depend on virtio 1.0
...ruct virtio_device *vdev, __virtio##bits val) \ { \ - return __virtio##bits##_to_cpu(false, val); \ + return __virtio##bits##_to_cpu(virtio_has_feature(vdev, VIRTIO_F_VERSION_1), val); \ } \ static inline __virtio##bits cpu_to_virtio##bits(struct virtio_device *vdev, u##bits val) \ { \ - return __cpu_to_virtio##bits(false, val); \ + return __cpu_to_virtio##bits(virtio_has_feature(vdev, VIRTIO_F_VERSION_1), val); \ } static inline u16 virtio16_to_cpu(struct virtio_device *vdev, __virtio16 val) -- MST
2014 Oct 22
2
[PATCH RFC v3 01/16] virtio: memory access APIs
...*/ + +#define __DEFINE_VIRTIO_XX_TO_CPU(bits) \ +static inline u##bits __virtio##bits##_to_cpu(bool little_endian, __virtio##bits val) \ +{ \ + if (little_endian) \ + return le##bits##_to_cpu((__force __le##bits)val); \ + else \ + return (__force u##bits)val; \ +} \ +static inline __virtio##bits __cpu_to_virtio##bits(bool little_endian, u##bits val) \ +{ \ + if (little_endian) \ + return (__force __virtio##bits)cpu_to_le##bits(val); \ + else \ + return val; \ +} + +__DEFINE_VIRTIO_XX_TO_CPU(16) +__DEFINE_VIRTIO_XX_TO_CPU(32) +__DEFINE_VIRTIO_XX_TO_CPU(64) + +#endif /* _LINUX_VIRTIO_BYTEORDER */ diff --g...
2014 Oct 22
2
[PATCH RFC v3 01/16] virtio: memory access APIs
...*/ + +#define __DEFINE_VIRTIO_XX_TO_CPU(bits) \ +static inline u##bits __virtio##bits##_to_cpu(bool little_endian, __virtio##bits val) \ +{ \ + if (little_endian) \ + return le##bits##_to_cpu((__force __le##bits)val); \ + else \ + return (__force u##bits)val; \ +} \ +static inline __virtio##bits __cpu_to_virtio##bits(bool little_endian, u##bits val) \ +{ \ + if (little_endian) \ + return (__force __virtio##bits)cpu_to_le##bits(val); \ + else \ + return val; \ +} + +__DEFINE_VIRTIO_XX_TO_CPU(16) +__DEFINE_VIRTIO_XX_TO_CPU(32) +__DEFINE_VIRTIO_XX_TO_CPU(64) + +#endif /* _LINUX_VIRTIO_BYTEORDER */ diff --g...
2014 Oct 22
2
[PATCH RFC v2 01/16] virtio: memory access APIs
...#define DEFINE_VIRTIO_XX_TO_CPU(bits) \ +static inline u##bits virtio##bits##_to_cpu(struct virtio_device *vdev, __virtio##bits val) \ +{ \ + return __virtio##bits##_to_cpu(false, val); \ +} \ +static inline __virtio##bits cpu_to_virtio##bits(struct virtio_device *vdev, u##bits val) \ +{ \ + return __cpu_to_virtio##bits(false, val); \ +} + +DEFINE_VIRTIO_XX_TO_CPU(16) +DEFINE_VIRTIO_XX_TO_CPU(32) +DEFINE_VIRTIO_XX_TO_CPU(64) + /* Config space accessors. */ #define virtio_cread(vdev, structname, member, ptr) \ do { \ diff --git a/include/uapi/linux/virtio_ring.h b/include/uapi/linux/virtio_ring.h...
2014 Oct 22
2
[PATCH RFC v2 01/16] virtio: memory access APIs
...#define DEFINE_VIRTIO_XX_TO_CPU(bits) \ +static inline u##bits virtio##bits##_to_cpu(struct virtio_device *vdev, __virtio##bits val) \ +{ \ + return __virtio##bits##_to_cpu(false, val); \ +} \ +static inline __virtio##bits cpu_to_virtio##bits(struct virtio_device *vdev, u##bits val) \ +{ \ + return __cpu_to_virtio##bits(false, val); \ +} + +DEFINE_VIRTIO_XX_TO_CPU(16) +DEFINE_VIRTIO_XX_TO_CPU(32) +DEFINE_VIRTIO_XX_TO_CPU(64) + /* Config space accessors. */ #define virtio_cread(vdev, structname, member, ptr) \ do { \ diff --git a/include/uapi/linux/virtio_ring.h b/include/uapi/linux/virtio_ring.h...
2014 Oct 23
0
[PATCH RFC v3 01/16] virtio: memory access APIs
...(bits) \ > +static inline u##bits __virtio##bits##_to_cpu(bool little_endian, __virtio##bits val) \ > +{ \ > + if (little_endian) \ > + return le##bits##_to_cpu((__force __le##bits)val); \ > + else \ > + return (__force u##bits)val; \ > +} \ > +static inline __virtio##bits __cpu_to_virtio##bits(bool little_endian, u##bits val) \ > +{ \ > + if (little_endian) \ > + return (__force __virtio##bits)cpu_to_le##bits(val); \ > + else \ > + return val; \ > +} > + > +__DEFINE_VIRTIO_XX_TO_CPU(16) > +__DEFINE_VIRTIO_XX_TO_CPU(32) > +__DEFINE_VIRTIO_XX_TO_CPU(64...
2014 Oct 22
0
[PATCH RFC v2 01/16] virtio: memory access APIs
...s) \ > +static inline u##bits virtio##bits##_to_cpu(struct virtio_device *vdev, __virtio##bits val) \ > +{ \ > + return __virtio##bits##_to_cpu(false, val); \ > +} \ > +static inline __virtio##bits cpu_to_virtio##bits(struct virtio_device *vdev, u##bits val) \ > +{ \ > + return __cpu_to_virtio##bits(false, val); \ > +} > + > +DEFINE_VIRTIO_XX_TO_CPU(16) > +DEFINE_VIRTIO_XX_TO_CPU(32) > +DEFINE_VIRTIO_XX_TO_CPU(64) > + > /* Config space accessors. */ > #define virtio_cread(vdev, structname, member, ptr) \ > do { \ > diff --git a/include/uapi/linu...
2014 Oct 23
0
[PATCH RFC v4 01/17] virtio: memory access APIs
...andling virtio in modern little endian and in + * compatibility native endian format. + */ + +static inline u16 __virtio16_to_cpu(bool little_endian, __virtio16 val) +{ + if (little_endian) + return le16_to_cpu((__force __le16)val); + else + return (__force u16)val; +} + +static inline __virtio16 __cpu_to_virtio16(bool little_endian, u16 val) +{ + if (little_endian) + return (__force __virtio16)cpu_to_le16(val); + else + return (__force __virtio16)val; +} + +static inline u32 __virtio32_to_cpu(bool little_endian, __virtio32 val) +{ + if (little_endian) + return le32_to_cpu((__force __le32)val); + else +...
2014 Oct 23
0
[PATCH RFC v4 01/17] virtio: memory access APIs
...andling virtio in modern little endian and in + * compatibility native endian format. + */ + +static inline u16 __virtio16_to_cpu(bool little_endian, __virtio16 val) +{ + if (little_endian) + return le16_to_cpu((__force __le16)val); + else + return (__force u16)val; +} + +static inline __virtio16 __cpu_to_virtio16(bool little_endian, u16 val) +{ + if (little_endian) + return (__force __virtio16)cpu_to_le16(val); + else + return (__force __virtio16)val; +} + +static inline u32 __virtio32_to_cpu(bool little_endian, __virtio32 val) +{ + if (little_endian) + return le32_to_cpu((__force __le32)val); + else +...