diff options
author | Michael S. Tsirkin <mst@redhat.com> | 2016-08-15 04:50:55 +0300 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2016-08-15 05:05:51 +0300 |
commit | 6be3ffaa0e15c64f560904b025f5c50bef5886f9 (patch) | |
tree | 73aab67c5d66b71b6e6ca0a9f38dd37e031b0049 /tools/virtio/linux/virtio_config.h | |
parent | 446374d7c7f89603d8151b56824e2cac85ed8e0d (diff) | |
download | lwn-6be3ffaa0e15c64f560904b025f5c50bef5886f9.tar.gz lwn-6be3ffaa0e15c64f560904b025f5c50bef5886f9.zip |
tools/virtio: add dma stubs
Fixes build after recent IOMMU-related changes,
mustly by adding more stubs.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'tools/virtio/linux/virtio_config.h')
-rw-r--r-- | tools/virtio/linux/virtio_config.h | 13 |
1 files changed, 13 insertions, 0 deletions
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) || |