diff options
Diffstat (limited to 'virt/kvm/iodev.h')
-rw-r--r-- | virt/kvm/iodev.h | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/virt/kvm/iodev.h b/virt/kvm/iodev.h index 12fd3caffd2b..9ef709cc2cae 100644 --- a/virt/kvm/iodev.h +++ b/virt/kvm/iodev.h | |||
@@ -20,6 +20,7 @@ | |||
20 | #include <asm/errno.h> | 20 | #include <asm/errno.h> |
21 | 21 | ||
22 | struct kvm_io_device; | 22 | struct kvm_io_device; |
23 | struct kvm_vcpu; | ||
23 | 24 | ||
24 | /** | 25 | /** |
25 | * kvm_io_device_ops are called under kvm slots_lock. | 26 | * kvm_io_device_ops are called under kvm slots_lock. |
@@ -27,11 +28,13 @@ struct kvm_io_device; | |||
27 | * or non-zero to have it passed to the next device. | 28 | * or non-zero to have it passed to the next device. |
28 | **/ | 29 | **/ |
29 | struct kvm_io_device_ops { | 30 | struct kvm_io_device_ops { |
30 | int (*read)(struct kvm_io_device *this, | 31 | int (*read)(struct kvm_vcpu *vcpu, |
32 | struct kvm_io_device *this, | ||
31 | gpa_t addr, | 33 | gpa_t addr, |
32 | int len, | 34 | int len, |
33 | void *val); | 35 | void *val); |
34 | int (*write)(struct kvm_io_device *this, | 36 | int (*write)(struct kvm_vcpu *vcpu, |
37 | struct kvm_io_device *this, | ||
35 | gpa_t addr, | 38 | gpa_t addr, |
36 | int len, | 39 | int len, |
37 | const void *val); | 40 | const void *val); |
@@ -49,16 +52,20 @@ static inline void kvm_iodevice_init(struct kvm_io_device *dev, | |||
49 | dev->ops = ops; | 52 | dev->ops = ops; |
50 | } | 53 | } |
51 | 54 | ||
52 | static inline int kvm_iodevice_read(struct kvm_io_device *dev, | 55 | static inline int kvm_iodevice_read(struct kvm_vcpu *vcpu, |
53 | gpa_t addr, int l, void *v) | 56 | struct kvm_io_device *dev, gpa_t addr, |
57 | int l, void *v) | ||
54 | { | 58 | { |
55 | return dev->ops->read ? dev->ops->read(dev, addr, l, v) : -EOPNOTSUPP; | 59 | return dev->ops->read ? dev->ops->read(vcpu, dev, addr, l, v) |
60 | : -EOPNOTSUPP; | ||
56 | } | 61 | } |
57 | 62 | ||
58 | static inline int kvm_iodevice_write(struct kvm_io_device *dev, | 63 | static inline int kvm_iodevice_write(struct kvm_vcpu *vcpu, |
59 | gpa_t addr, int l, const void *v) | 64 | struct kvm_io_device *dev, gpa_t addr, |
65 | int l, const void *v) | ||
60 | { | 66 | { |
61 | return dev->ops->write ? dev->ops->write(dev, addr, l, v) : -EOPNOTSUPP; | 67 | return dev->ops->write ? dev->ops->write(vcpu, dev, addr, l, v) |
68 | : -EOPNOTSUPP; | ||
62 | } | 69 | } |
63 | 70 | ||
64 | static inline void kvm_iodevice_destructor(struct kvm_io_device *dev) | 71 | static inline void kvm_iodevice_destructor(struct kvm_io_device *dev) |