X-Git-Url: http://git.cascardo.eti.br/?a=blobdiff_plain;f=tools%2Fvirtio%2Flinux%2Fvirtio_config.h;h=9ba11815e0a16b93ec0e04735a3486ac9dc6bfe4;hb=6be3ffaa0e15c64f560904b025f5c50bef5886f9;hp=57a6964a1e355b8daa154adff9bd007c93f8374f;hpb=446374d7c7f89603d8151b56824e2cac85ed8e0d;p=cascardo%2Flinux.git diff --git a/tools/virtio/linux/virtio_config.h b/tools/virtio/linux/virtio_config.h index 57a6964a1e35..9ba11815e0a1 100644 --- a/tools/virtio/linux/virtio_config.h +++ b/tools/virtio/linux/virtio_config.h @@ -40,6 +40,19 @@ static inline void __virtio_clear_bit(struct virtio_device *vdev, #define virtio_has_feature(dev, feature) \ (__virtio_test_bit((dev), feature)) +/** + * virtio_has_iommu_quirk - determine whether this device has the iommu quirk + * @vdev: the device + */ +static inline bool virtio_has_iommu_quirk(const struct virtio_device *vdev) +{ + /* + * Note the reverse polarity of the quirk feature (compared to most + * other features), this is for compatibility with legacy systems. + */ + return !virtio_has_feature(vdev, VIRTIO_F_IOMMU_PLATFORM); +} + static inline bool virtio_is_little_endian(struct virtio_device *vdev) { return virtio_has_feature(vdev, VIRTIO_F_VERSION_1) ||