summaryrefslogtreecommitdiffstats
path: root/include/linux/virtio_config.h
diff options
context:
space:
mode:
authorMichael S. Tsirkin <mst@redhat.com>2014-10-07 16:39:43 +0200
committerMichael S. Tsirkin <mst@redhat.com>2014-12-09 12:05:24 +0200
commitd025477368792b272802146a86e41f81a54d8a19 (patch)
tree7e296d48d57796d6b797f4da6dac74d1644092fe /include/linux/virtio_config.h
parent0ffaeadfc451a11b5da35578b2f9b977f9f46489 (diff)
downloadblackbird-op-linux-d025477368792b272802146a86e41f81a54d8a19.tar.gz
blackbird-op-linux-d025477368792b272802146a86e41f81a54d8a19.zip
virtio: add support for 64 bit features.
Change u32 to u64, and use BIT_ULL and 1ULL everywhere. Note: transports are unchanged, and only set low 32 bit. This guarantees that no transport sets e.g. VERSION_1 by mistake without proper support. Based on patch by Rusty. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: David Hildenbrand <dahi@linux.vnet.ibm.com> Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Diffstat (limited to 'include/linux/virtio_config.h')
-rw-r--r--include/linux/virtio_config.h20
1 files changed, 10 insertions, 10 deletions
diff --git a/include/linux/virtio_config.h b/include/linux/virtio_config.h
index ffc2ae04879c..f51788439574 100644
--- a/include/linux/virtio_config.h
+++ b/include/linux/virtio_config.h
@@ -66,7 +66,7 @@ struct virtio_config_ops {
vq_callback_t *callbacks[],
const char *names[]);
void (*del_vqs)(struct virtio_device *);
- u32 (*get_features)(struct virtio_device *vdev);
+ u64 (*get_features)(struct virtio_device *vdev);
void (*finalize_features)(struct virtio_device *vdev);
const char *(*bus_name)(struct virtio_device *vdev);
int (*set_vq_affinity)(struct virtqueue *vq, int cpu);
@@ -88,11 +88,11 @@ static inline bool __virtio_test_bit(const struct virtio_device *vdev,
{
/* Did you forget to fix assumptions on max features? */
if (__builtin_constant_p(fbit))
- BUILD_BUG_ON(fbit >= 32);
+ BUILD_BUG_ON(fbit >= 64);
else
- BUG_ON(fbit >= 32);
+ BUG_ON(fbit >= 64);
- return vdev->features & BIT(fbit);
+ return vdev->features & BIT_ULL(fbit);
}
/**
@@ -105,11 +105,11 @@ static inline void __virtio_set_bit(struct virtio_device *vdev,
{
/* Did you forget to fix assumptions on max features? */
if (__builtin_constant_p(fbit))
- BUILD_BUG_ON(fbit >= 32);
+ BUILD_BUG_ON(fbit >= 64);
else
- BUG_ON(fbit >= 32);
+ BUG_ON(fbit >= 64);
- vdev->features |= BIT(fbit);
+ vdev->features |= BIT_ULL(fbit);
}
/**
@@ -122,11 +122,11 @@ static inline void __virtio_clear_bit(struct virtio_device *vdev,
{
/* Did you forget to fix assumptions on max features? */
if (__builtin_constant_p(fbit))
- BUILD_BUG_ON(fbit >= 32);
+ BUILD_BUG_ON(fbit >= 64);
else
- BUG_ON(fbit >= 32);
+ BUG_ON(fbit >= 64);
- vdev->features &= ~BIT(fbit);
+ vdev->features &= ~BIT_ULL(fbit);
}
/**
OpenPOWER on IntegriCloud