Displaying 4 results from an estimated 4 matches for "virtio_cwrite_v".
Did you mean:
virtio_cwrite
2020 Aug 05
0
[PATCH v3 26/38] virtio_config: LE config space accessors
...diff --git a/include/linux/virtio_config.h b/include/linux/virtio_config.h
index 441fd6dd42ab..5b5196fec899 100644
--- a/include/linux/virtio_config.h
+++ b/include/linux/virtio_config.h
@@ -375,6 +375,71 @@ static inline __virtio64 cpu_to_virtio64(struct virtio_device *vdev, u64 val)
sizeof(virtio_cwrite_v)); \
} while(0)
+/*
+ * Nothing virtio-specific about these, but let's worry about generalizing
+ * these later.
+ */
+#define virtio_le_to_cpu(x) \
+ _Generic((x), \
+ __u8: (x), \
+ __le16: le16_to_cpu(x), \
+ __le32: le32_to_cpu(x), \
+ __le64: le64_to_cpu(x) \
+ )
+
+#define vi...
2020 Aug 05
0
[PATCH v3 24/38] virtio_config: rewrite using _Generic
...accessors. */
#define virtio_cwrite(vdev, structname, member, ptr) \
do { \
- might_sleep(); \
- /* Must match the member's type, and be integer */ \
- if (!__virtio_typecheck(structname, member, *(ptr))) \
- BUG_ON((*ptr) == 1); \
+ typeof(((structname*)0)->member) virtio_cwrite_v = \
+ cpu_to_virtio(vdev, *(ptr), ((structname*)0)->member); \
\
- switch (sizeof(*ptr)) { \
- case 1: \
- virtio_cwrite8(vdev, \
- offsetof(structname, member), \
- *(ptr)); \
- break; \
- case 2: \
- virtio_cwrite16(vdev, \...
2020 Aug 05
1
[vhost:vhost 32/52] include/linux/typecheck.h:12:18: warning: comparison of distinct pointer types lacks a cast
tree: https://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost.git vhost
head: 4c05433bc6fb4ae172270f0279be8ba89a3da64f
commit: b025584098e621d88894d28e80af686958e273af [32/52] virtio_input: convert to LE accessors
config: parisc-randconfig-r003-20200805 (attached as .config)
compiler: hppa-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
wget
2020 Aug 03
51
[PATCH v2 00/24] virtio: config space endian-ness cleanup
Config space endian-ness is currently a mess: fields are
not tagged with the correct endian-ness so it's easy
to make mistakes like instanciating config space in
native endian-ness.
The following patches adding sparse tagging are currently in my tree.
Lightly tested.
As a follow-up, I plan to add new APIs that handle modern config space
in a more efficient way (bypassing the version check).