search for: __virtio_pick_type

Displaying 11 results from an estimated 11 matches for "__virtio_pick_type".

2020 Aug 04
1
[PATCH v2 03/24] virtio: allow __virtioXX, __leXX in config space
...ch down while reading it. > + */ It might help with the lunch, but it still gives a slight queasiness. No ideas for a better version, though. > +#define __virtio_pick_value(x, type, then, otherwise) \ > + __builtin_choose_expr(__same_type(x, type), then, otherwise) > + > +#define __virtio_pick_type(x, type, then, otherwise) \ > + __virtio_pick_value(x, type, (then)0, otherwise) > + > +#define __virtio_pick_endian(x, x16, x32, x64, otherwise) \ > + __virtio_pick_type(x, x16, __u16, \ > + __virtio_pick_type(x, x32, __u32, \ > + __virtio_pick_type(x, x64, __u64,...
2020 Aug 05
2
[PATCH v2 03/24] virtio: allow __virtioXX, __leXX in config space
.../* > + * We build this out of a couple of helper macros in a vain attempt to > + * help you keep your lunch down while reading it. > + */ > +#define __virtio_pick_value(x, type, then, otherwise) \ > + __builtin_choose_expr(__same_type(x, type), then, otherwise) > + > +#define __virtio_pick_type(x, type, then, otherwise) \ > + __virtio_pick_value(x, type, (then)0, otherwise) > + > +#define __virtio_pick_endian(x, x16, x32, x64, otherwise) \ > + __virtio_pick_type(x, x16, __u16, \ > + __virtio_pick_type(x, x32, __u32, \ > + __virtio_pick_type(x, x64, __u64,...
2020 Aug 05
2
[PATCH v2 03/24] virtio: allow __virtioXX, __leXX in config space
.../* > + * We build this out of a couple of helper macros in a vain attempt to > + * help you keep your lunch down while reading it. > + */ > +#define __virtio_pick_value(x, type, then, otherwise) \ > + __builtin_choose_expr(__same_type(x, type), then, otherwise) > + > +#define __virtio_pick_type(x, type, then, otherwise) \ > + __virtio_pick_value(x, type, (then)0, otherwise) > + > +#define __virtio_pick_endian(x, x16, x32, x64, otherwise) \ > + __virtio_pick_type(x, x16, __u16, \ > + __virtio_pick_type(x, x32, __u32, \ > + __virtio_pick_type(x, x64, __u64,...
2020 Aug 03
0
[PATCH v2 03/24] virtio: allow __virtioXX, __leXX in config space
...ve_typeof(x) typeof(x) + +#else + +/* + * We build this out of a couple of helper macros in a vain attempt to + * help you keep your lunch down while reading it. + */ +#define __virtio_pick_value(x, type, then, otherwise) \ + __builtin_choose_expr(__same_type(x, type), then, otherwise) + +#define __virtio_pick_type(x, type, then, otherwise) \ + __virtio_pick_value(x, type, (then)0, otherwise) + +#define __virtio_pick_endian(x, x16, x32, x64, otherwise) \ + __virtio_pick_type(x, x16, __u16, \ + __virtio_pick_type(x, x32, __u32, \ + __virtio_pick_type(x, x64, __u64, \ + otherwise))) + +#defin...
2020 Aug 05
0
[PATCH v3 03/38] virtio: allow __virtioXX, __leXX in config space
...ve_typeof(x) typeof(x) + +#else + +/* + * We build this out of a couple of helper macros in a vain attempt to + * help you keep your lunch down while reading it. + */ +#define __virtio_pick_value(x, type, then, otherwise) \ + __builtin_choose_expr(__same_type(x, type), then, otherwise) + +#define __virtio_pick_type(x, type, then, otherwise) \ + __virtio_pick_value(x, type, (then)0, otherwise) + +#define __virtio_pick_endian(x, x16, x32, x64, otherwise) \ + __virtio_pick_type(x, x16, __u16, \ + __virtio_pick_type(x, x32, __u32, \ + __virtio_pick_type(x, x64, __u64, \ + otherwise))) + +#defin...
2020 Aug 05
0
[PATCH v2 03/24] virtio: allow __virtioXX, __leXX in config space
...of a couple of helper macros in a vain attempt to > > + * help you keep your lunch down while reading it. > > + */ > > +#define __virtio_pick_value(x, type, then, otherwise) \ > > + __builtin_choose_expr(__same_type(x, type), then, otherwise) > > + > > +#define __virtio_pick_type(x, type, then, otherwise) \ > > + __virtio_pick_value(x, type, (then)0, otherwise) > > + > > +#define __virtio_pick_endian(x, x16, x32, x64, otherwise) \ > > + __virtio_pick_type(x, x16, __u16, \ > > + __virtio_pick_type(x, x32, __u32, \ > > + __vir...
2020 Aug 05
0
[PATCH v3 24/38] virtio_config: rewrite using _Generic
...ve_typeof(x) typeof(x) - -#else - -/* - * We build this out of a couple of helper macros in a vain attempt to - * help you keep your lunch down while reading it. - */ -#define __virtio_pick_value(x, type, then, otherwise) \ - __builtin_choose_expr(__same_type(x, type), then, otherwise) - -#define __virtio_pick_type(x, type, then, otherwise) \ - __virtio_pick_value(x, type, (then)0, otherwise) - -#define __virtio_pick_endian(x, x16, x32, x64, otherwise) \ - __virtio_pick_type(x, x16, __u16, \ - __virtio_pick_type(x, x32, __u32, \ - __virtio_pick_type(x, x64, __u64, \ - otherwise))) - -#defin...
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).
2020 Aug 04
1
[PATCH v2 17/24] virtio_config: disallow native type fields
.../include/linux/virtio_config.h b/include/linux/virtio_config.h > index 64da491936f7..c68f58f3bf34 100644 > --- a/include/linux/virtio_config.h > +++ b/include/linux/virtio_config.h > @@ -319,9 +319,8 @@ static inline __virtio64 cpu_to_virtio64(struct virtio_device *vdev, u64 val) > __virtio_pick_type(x, __u8, __u8, \ > __virtio_pick_endian(x, __virtio16, __virtio32, __virtio64, \ > __virtio_pick_endian(x, __le16, __le32, __le64, \ > - __virtio_pick_endian(x, __u16, __u32, __u64, \ > - /* No other type allowed */ \ > - (void)0))))) > + /* No other typ...
2020 Aug 03
0
[PATCH v2 17/24] virtio_config: disallow native type fields
...eletions(-) diff --git a/include/linux/virtio_config.h b/include/linux/virtio_config.h index 64da491936f7..c68f58f3bf34 100644 --- a/include/linux/virtio_config.h +++ b/include/linux/virtio_config.h @@ -319,9 +319,8 @@ static inline __virtio64 cpu_to_virtio64(struct virtio_device *vdev, u64 val) __virtio_pick_type(x, __u8, __u8, \ __virtio_pick_endian(x, __virtio16, __virtio32, __virtio64, \ __virtio_pick_endian(x, __le16, __le32, __le64, \ - __virtio_pick_endian(x, __u16, __u32, __u64, \ - /* No other type allowed */ \ - (void)0))))) + /* No other type allowed */ \ + (void)0)...
2020 Aug 05
0
[PATCH v3 17/38] virtio_config: disallow native type fields
...eletions(-) diff --git a/include/linux/virtio_config.h b/include/linux/virtio_config.h index 64da491936f7..c68f58f3bf34 100644 --- a/include/linux/virtio_config.h +++ b/include/linux/virtio_config.h @@ -319,9 +319,8 @@ static inline __virtio64 cpu_to_virtio64(struct virtio_device *vdev, u64 val) __virtio_pick_type(x, __u8, __u8, \ __virtio_pick_endian(x, __virtio16, __virtio32, __virtio64, \ __virtio_pick_endian(x, __le16, __le32, __le64, \ - __virtio_pick_endian(x, __u16, __u32, __u64, \ - /* No other type allowed */ \ - (void)0))))) + /* No other type allowed */ \ + (void)0)...