diff options
author | Sasha Levin <levinsasha928@gmail.com> | 2011-05-26 13:30:04 +0300 |
---|---|---|
committer | Will Deacon <will.deacon@arm.com> | 2015-06-01 16:39:44 +0100 |
commit | 3d62dea656058a6bc9248124521c6fc81efc6474 (patch) | |
tree | 842ed3d8fc93578e635e82e5184d406dab389180 /hw | |
parent | de960f08060bcd9cec06bec03395c7297579799f (diff) | |
download | kvmtool-3d62dea656058a6bc9248124521c6fc81efc6474.tar.gz |
kvm tools: Add optional parameter used in ioport callbacks
Allow specifying an optional parameter when registering an
ioport range. The callback functions provided by the registering
module will be called with the same parameter.
This may be used to keep context during callbacks on IO operations.
Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
Diffstat (limited to 'hw')
-rw-r--r-- | hw/rtc.c | 10 | ||||
-rw-r--r-- | hw/serial.c | 6 | ||||
-rw-r--r-- | hw/vesa.c | 6 |
3 files changed, 11 insertions, 11 deletions
@@ -19,7 +19,7 @@ static inline unsigned char bin2bcd(unsigned val) return ((val / 10) << 4) + val % 10; } -static bool cmos_ram_data_in(struct kvm *kvm, u16 port, void *data, int size, u32 count) +static bool cmos_ram_data_in(struct ioport *ioport, struct kvm *kvm, u16 port, void *data, int size, u32 count) { struct tm *tm; time_t ti; @@ -52,7 +52,7 @@ static bool cmos_ram_data_in(struct kvm *kvm, u16 port, void *data, int size, u3 return true; } -static bool cmos_ram_data_out(struct kvm *kvm, u16 port, void *data, int size, u32 count) +static bool cmos_ram_data_out(struct ioport *ioport, struct kvm *kvm, u16 port, void *data, int size, u32 count) { return true; } @@ -62,7 +62,7 @@ static struct ioport_operations cmos_ram_data_ioport_ops = { .io_in = cmos_ram_data_in, }; -static bool cmos_ram_index_out(struct kvm *kvm, u16 port, void *data, int size, u32 count) +static bool cmos_ram_index_out(struct ioport *ioport, struct kvm *kvm, u16 port, void *data, int size, u32 count) { u8 value; @@ -82,6 +82,6 @@ static struct ioport_operations cmos_ram_index_ioport_ops = { void rtc__init(void) { /* PORT 0070-007F - CMOS RAM/RTC (REAL TIME CLOCK) */ - ioport__register(0x0070, &cmos_ram_index_ioport_ops, 1); - ioport__register(0x0071, &cmos_ram_data_ioport_ops, 1); + ioport__register(0x0070, &cmos_ram_index_ioport_ops, 1, NULL); + ioport__register(0x0071, &cmos_ram_data_ioport_ops, 1, NULL); } diff --git a/hw/serial.c b/hw/serial.c index beebbba5..1199264e 100644 --- a/hw/serial.c +++ b/hw/serial.c @@ -164,7 +164,7 @@ static struct serial8250_device *find_device(u16 port) return NULL; } -static bool serial8250_out(struct kvm *kvm, u16 port, void *data, int size, u32 count) +static bool serial8250_out(struct ioport *ioport, struct kvm *kvm, u16 port, void *data, int size, u32 count) { struct serial8250_device *dev; u16 offset; @@ -252,7 +252,7 @@ out_unlock: return ret; } -static bool serial8250_in(struct kvm *kvm, u16 port, void *data, int size, u32 count) +static bool serial8250_in(struct ioport *ioport, struct kvm *kvm, u16 port, void *data, int size, u32 count) { struct serial8250_device *dev; u16 offset; @@ -339,7 +339,7 @@ static struct ioport_operations serial8250_ops = { static void serial8250__device_init(struct kvm *kvm, struct serial8250_device *dev) { - ioport__register(dev->iobase, &serial8250_ops, 8); + ioport__register(dev->iobase, &serial8250_ops, 8, NULL); kvm__irq_line(kvm, dev->irq, 0); } @@ -26,12 +26,12 @@ static char videomem[VESA_MEM_SIZE]; -static bool vesa_pci_io_in(struct kvm *kvm, u16 port, void *data, int size, u32 count) +static bool vesa_pci_io_in(struct ioport *ioport, struct kvm *kvm, u16 port, void *data, int size, u32 count) { return true; } -static bool vesa_pci_io_out(struct kvm *kvm, u16 port, void *data, int size, u32 count) +static bool vesa_pci_io_out(struct ioport *ioport, struct kvm *kvm, u16 port, void *data, int size, u32 count) { return true; } @@ -75,7 +75,7 @@ void vesa__init(struct kvm *kvm) pci__register(&vesa_pci_device, dev); - ioport__register(IOPORT_VESA, &vesa_io_ops, IOPORT_VESA_SIZE); + ioport__register(IOPORT_VESA, &vesa_io_ops, IOPORT_VESA_SIZE, NULL); kvm__register_mmio(VESA_MEM_ADDR, VESA_MEM_SIZE, &vesa_mmio_callback); |