Displaying 20 results from an estimated 66 matches for "__virtio".
2014 Oct 22
2
[PATCH RFC v3 01/16] virtio: memory access APIs
...RDER_H
+#define _LINUX_VIRTIO_BYTEORDER_H
+#include <linux/types.h>
+#include <uapi/linux/virtio_types.h>
+
+/* Memory accessors for handling virtio in modern little endian and in
+ * compatibility big endian format. */
+
+#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_endia...
2014 Oct 22
2
[PATCH RFC v3 01/16] virtio: memory access APIs
...RDER_H
+#define _LINUX_VIRTIO_BYTEORDER_H
+#include <linux/types.h>
+#include <uapi/linux/virtio_types.h>
+
+/* Memory accessors for handling virtio in modern little endian and in
+ * compatibility big endian format. */
+
+#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_endia...
2014 Oct 23
0
[PATCH RFC v3 01/16] virtio: memory access APIs
...<linux/types.h>
> +#include <uapi/linux/virtio_types.h>
> +
> +/* Memory accessors for handling virtio in modern little endian and in
> + * compatibility big endian format. */
s/big/native/
> +
> +#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##...
2014 Oct 22
2
[PATCH RFC v2 01/16] virtio: memory access APIs
...teorder.h>
#include <uapi/linux/virtio_config.h>
/**
@@ -152,6 +153,21 @@ int virtqueue_set_affinity(struct virtqueue *vq, int cpu)
return 0;
}
+/* Memory accessors */
+#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_...
2014 Oct 22
2
[PATCH RFC v2 01/16] virtio: memory access APIs
...teorder.h>
#include <uapi/linux/virtio_config.h>
/**
@@ -152,6 +153,21 @@ int virtqueue_set_affinity(struct virtqueue *vq, int cpu)
return 0;
}
+/* Memory accessors */
+#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_...
2014 Oct 22
0
[PATCH RFC v2 06/16] virtio: make endian-ness depend on virtio 1.0
...g.h
index 7d46280..be0f6dd 100644
--- a/include/linux/virtio_config.h
+++ b/include/linux/virtio_config.h
@@ -157,11 +157,11 @@ int virtqueue_set_affinity(struct virtqueue *vq, int cpu)
#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); \
+ 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);...
2014 Oct 22
1
[PATCH RFC v3 06/16] virtio: make endian-ness depend on virtio 1.0
...g.h
index 7d46280..be0f6dd 100644
--- a/include/linux/virtio_config.h
+++ b/include/linux/virtio_config.h
@@ -157,11 +157,11 @@ int virtqueue_set_affinity(struct virtqueue *vq, int cpu)
#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); \
+ 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);...
2014 Oct 23
0
[PATCH RFC v4 06/17] virtio: make endian-ness depend on virtio 1.0
...g.h
index 4bc2ebe..952b6d7 100644
--- a/include/linux/virtio_config.h
+++ b/include/linux/virtio_config.h
@@ -157,11 +157,11 @@ int virtqueue_set_affinity(struct virtqueue *vq, int cpu)
#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); \
+ 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);...
2014 Oct 22
0
[PATCH RFC v2 06/16] virtio: make endian-ness depend on virtio 1.0
...g.h
index 7d46280..be0f6dd 100644
--- a/include/linux/virtio_config.h
+++ b/include/linux/virtio_config.h
@@ -157,11 +157,11 @@ int virtqueue_set_affinity(struct virtqueue *vq, int cpu)
#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); \
+ 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);...
2014 Oct 22
1
[PATCH RFC v3 06/16] virtio: make endian-ness depend on virtio 1.0
...g.h
index 7d46280..be0f6dd 100644
--- a/include/linux/virtio_config.h
+++ b/include/linux/virtio_config.h
@@ -157,11 +157,11 @@ int virtqueue_set_affinity(struct virtqueue *vq, int cpu)
#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); \
+ 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);...
2014 Oct 23
0
[PATCH RFC v4 06/17] virtio: make endian-ness depend on virtio 1.0
...g.h
index 4bc2ebe..952b6d7 100644
--- a/include/linux/virtio_config.h
+++ b/include/linux/virtio_config.h
@@ -157,11 +157,11 @@ int virtqueue_set_affinity(struct virtqueue *vq, int cpu)
#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); \
+ 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);...
2019 Jul 10
2
[PATCH v2] virtio_pmem: fix sparse warning
This patch fixes below sparse warning related to __virtio
type in virtio pmem driver. This is reported by Intel test
bot on linux-next tree.
nd_virtio.c:56:28: warning: incorrect type in assignment
(different base types)
nd_virtio.c:56:28: expected unsigned int [unsigned] [usertype] type
nd_virtio.c:56:28: got restricted __virtio32
nd_virtio.c...
2019 Jul 10
2
[PATCH v2] virtio_pmem: fix sparse warning
This patch fixes below sparse warning related to __virtio
type in virtio pmem driver. This is reported by Intel test
bot on linux-next tree.
nd_virtio.c:56:28: warning: incorrect type in assignment
(different base types)
nd_virtio.c:56:28: expected unsigned int [unsigned] [usertype] type
nd_virtio.c:56:28: got restricted __virtio32
nd_virtio.c...
2014 Oct 22
0
[PATCH RFC v2 01/16] virtio: memory access APIs
..._config.h>
>
> /**
> @@ -152,6 +153,21 @@ int virtqueue_set_affinity(struct virtqueue *vq, int cpu)
> return 0;
> }
>
> +/* Memory accessors */
> +#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)
>...
2014 Oct 21
2
[PATCH RFC] virtio 1.0 vring endian-ness
...virtio_ring.h
index 67e06fe..32211aa 100644
--- a/include/linux/virtio_ring.h
+++ b/include/linux/virtio_ring.h
@@ -62,6 +62,26 @@ static inline void virtio_wmb(bool weak_barriers)
}
#endif
+#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_...
2014 Oct 21
2
[PATCH RFC] virtio 1.0 vring endian-ness
...virtio_ring.h
index 67e06fe..32211aa 100644
--- a/include/linux/virtio_ring.h
+++ b/include/linux/virtio_ring.h
@@ -62,6 +62,26 @@ static inline void virtio_wmb(bool weak_barriers)
}
#endif
+#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_...
2019 Jul 10
2
[PATCH] virtio_pmem: fix sparse warning
This patch fixes below sparse warning related to __virtio
type in virtio pmem driver. This is reported by Intel test
bot on linux-next tree.
nd_virtio.c:56:28: warning: incorrect type in assignment (different base types)
nd_virtio.c:56:28: expected unsigned int [unsigned] [usertype] type
nd_virtio.c:56:28: got restricted __virtio32
nd_virtio.c:93:...
2019 Jul 10
2
[PATCH] virtio_pmem: fix sparse warning
This patch fixes below sparse warning related to __virtio
type in virtio pmem driver. This is reported by Intel test
bot on linux-next tree.
nd_virtio.c:56:28: warning: incorrect type in assignment (different base types)
nd_virtio.c:56:28: expected unsigned int [unsigned] [usertype] type
nd_virtio.c:56:28: got restricted __virtio32
nd_virtio.c:93:...
2014 Oct 22
0
[PATCH RFC] virtio 1.0 vring endian-ness
...0644
> --- a/include/linux/virtio_ring.h
> +++ b/include/linux/virtio_ring.h
> @@ -62,6 +62,26 @@ static inline void virtio_wmb(bool weak_barriers)
> }
> #endif
>
> +#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...
2014 Oct 23
0
[PATCH RFC v4 01/17] virtio: memory access APIs
...+1,59 @@
+#ifndef _LINUX_VIRTIO_BYTEORDER_H
+#define _LINUX_VIRTIO_BYTEORDER_H
+#include <linux/types.h>
+#include <uapi/linux/virtio_types.h>
+
+/*
+ * Memory accessors for handling 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);
+...