Commit c9f6a037 authored by Xiao Guangrong's avatar Xiao Guangrong Committed by Will Deacon
Browse files

kvm tools: remove count in io emulation callbacks



'count' parameter in io emulation callbacks is useless, just remove it

Signed-off-by: default avatarXiao Guangrong <xiaoguangrong@cn.fujitsu.com>
Signed-off-by: default avatarPekka Enberg <penberg@kernel.org>
parent ba124f00
......@@ -294,7 +294,7 @@ static void kbd_reset(void)
/*
* Called when the OS has written to one of the keyboard's ports (0x60 or 0x64)
*/
static bool kbd_in(struct ioport *ioport, struct kvm *kvm, u16 port, void *data, int size, u32 count)
static bool kbd_in(struct ioport *ioport, struct kvm *kvm, u16 port, void *data, int size)
{
switch (port) {
case I8042_COMMAND_REG: {
......@@ -314,7 +314,7 @@ static bool kbd_in(struct ioport *ioport, struct kvm *kvm, u16 port, void *data,
return true;
}
static bool kbd_out(struct ioport *ioport, struct kvm *kvm, u16 port, void *data, int size, u32 count)
static bool kbd_out(struct ioport *ioport, struct kvm *kvm, u16 port, void *data, int size)
{
switch (port) {
case I8042_COMMAND_REG: {
......
......@@ -19,7 +19,7 @@ static inline unsigned char bin2bcd(unsigned val)
return ((val / 10) << 4) + val % 10;
}
static bool cmos_ram_data_in(struct ioport *ioport, 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)
{
struct tm *tm;
time_t ti;
......@@ -52,7 +52,7 @@ static bool cmos_ram_data_in(struct ioport *ioport, struct kvm *kvm, u16 port, v
return true;
}
static bool cmos_ram_data_out(struct ioport *ioport, 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)
{
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 ioport *ioport, 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)
{
u8 value;
......
......@@ -167,7 +167,7 @@ static struct serial8250_device *find_device(u16 port)
return NULL;
}
static bool serial8250_out(struct ioport *ioport, 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)
{
struct serial8250_device *dev;
u16 offset;
......@@ -217,7 +217,7 @@ static bool serial8250_out(struct ioport *ioport, struct kvm *kvm, u16 port, voi
char *addr = data;
if (!(dev->mcr & UART_MCR_LOOP))
term_putc(CONSOLE_8250, addr, size * count);
term_putc(CONSOLE_8250, addr, size);
dev->iir = UART_IIR_NO_INT;
break;
......@@ -255,7 +255,7 @@ out_unlock:
return ret;
}
static bool serial8250_in(struct ioport *ioport, 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)
{
struct serial8250_device *dev;
u16 offset;
......
......@@ -15,12 +15,12 @@
#include <inttypes.h>
#include <unistd.h>
static bool vesa_pci_io_in(struct ioport *ioport, 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)
{
return true;
}
static bool vesa_pci_io_out(struct ioport *ioport, 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)
{
return true;
}
......
......@@ -23,8 +23,8 @@ struct ioport {
};
struct ioport_operations {
bool (*io_in)(struct ioport *ioport, struct kvm *kvm, u16 port, void *data, int size, u32 count);
bool (*io_out)(struct ioport *ioport, struct kvm *kvm, u16 port, void *data, int size, u32 count);
bool (*io_in)(struct ioport *ioport, struct kvm *kvm, u16 port, void *data, int size);
bool (*io_out)(struct ioport *ioport, struct kvm *kvm, u16 port, void *data, int size);
};
void ioport__setup_legacy(void);
......
......@@ -52,7 +52,7 @@ static int ioport_insert(struct rb_root *root, struct ioport *data)
return rb_int_insert(root, &data->node);
}
static bool debug_io_out(struct ioport *ioport, struct kvm *kvm, u16 port, void *data, int size, u32 count)
static bool debug_io_out(struct ioport *ioport, struct kvm *kvm, u16 port, void *data, int size)
{
exit(EXIT_SUCCESS);
}
......@@ -61,12 +61,12 @@ static struct ioport_operations debug_ops = {
.io_out = debug_io_out,
};
static bool dummy_io_in(struct ioport *ioport, struct kvm *kvm, u16 port, void *data, int size, u32 count)
static bool dummy_io_in(struct ioport *ioport, struct kvm *kvm, u16 port, void *data, int size)
{
return true;
}
static bool dummy_io_out(struct ioport *ioport, struct kvm *kvm, u16 port, void *data, int size, u32 count)
static bool dummy_io_out(struct ioport *ioport, struct kvm *kvm, u16 port, void *data, int size)
{
return true;
}
......@@ -141,10 +141,10 @@ bool kvm__emulate_io(struct kvm *kvm, u16 port, void *data, int direction, int s
while (count--) {
if (direction == KVM_EXIT_IO_IN) {
if (ops->io_in)
ret = ops->io_in(entry, kvm, port, ptr, size, count);
ret = ops->io_in(entry, kvm, port, ptr, size);
} else {
if (ops->io_out)
ret = ops->io_out(entry, kvm, port, ptr, size, count);
ret = ops->io_out(entry, kvm, port, ptr, size);
}
ptr += size;
......
......@@ -35,7 +35,7 @@ static void *pci_config_address_ptr(u16 port)
return base + offset;
}
static bool pci_config_address_out(struct ioport *ioport, struct kvm *kvm, u16 port, void *data, int size, u32 count)
static bool pci_config_address_out(struct ioport *ioport, struct kvm *kvm, u16 port, void *data, int size)
{
void *p = pci_config_address_ptr(port);
......@@ -44,7 +44,7 @@ static bool pci_config_address_out(struct ioport *ioport, struct kvm *kvm, u16 p
return true;
}
static bool pci_config_address_in(struct ioport *ioport, struct kvm *kvm, u16 port, void *data, int size, u32 count)
static bool pci_config_address_in(struct ioport *ioport, struct kvm *kvm, u16 port, void *data, int size)
{
void *p = pci_config_address_ptr(port);
......@@ -76,7 +76,7 @@ static bool pci_device_exists(u8 bus_number, u8 device_number, u8 function_numbe
return dev != NULL;
}
static bool pci_config_data_out(struct ioport *ioport, struct kvm *kvm, u16 port, void *data, int size, u32 count)
static bool pci_config_data_out(struct ioport *ioport, struct kvm *kvm, u16 port, void *data, int size)
{
unsigned long start;
u8 dev_num;
......@@ -122,7 +122,7 @@ static bool pci_config_data_out(struct ioport *ioport, struct kvm *kvm, u16 port
return true;
}
static bool pci_config_data_in(struct ioport *ioport, struct kvm *kvm, u16 port, void *data, int size, u32 count)
static bool pci_config_data_in(struct ioport *ioport, struct kvm *kvm, u16 port, void *data, int size)
{
unsigned long start;
u8 dev_num;
......
......@@ -29,11 +29,11 @@ static const char *rel_to_abs(struct p9_dev *p9dev,
static bool virtio_p9_dev_in(struct p9_dev *p9dev, void *data,
unsigned long offset,
int size, u32 count)
int size)
{
u8 *config_space = (u8 *) p9dev->config;
if (size != 1 || count != 1)
if (size != 1)
return false;
ioport__write8(data, config_space[offset - VIRTIO_MSI_CONFIG_VECTOR]);
......@@ -42,7 +42,7 @@ static bool virtio_p9_dev_in(struct p9_dev *p9dev, void *data,
}
static bool virtio_p9_pci_io_in(struct ioport *ioport, struct kvm *kvm,
u16 port, void *data, int size, u32 count)
u16 port, void *data, int size)
{
bool ret = true;
unsigned long offset;
......@@ -76,7 +76,7 @@ static bool virtio_p9_pci_io_in(struct ioport *ioport, struct kvm *kvm,
p9dev->isr = VIRTIO_IRQ_LOW;
break;
default:
ret = virtio_p9_dev_in(p9dev, data, offset, size, count);
ret = virtio_p9_dev_in(p9dev, data, offset, size);
break;
};
......@@ -762,7 +762,7 @@ static void ioevent_callback(struct kvm *kvm, void *param)
}
static bool virtio_p9_pci_io_out(struct ioport *ioport, struct kvm *kvm,
u16 port, void *data, int size, u32 count)
u16 port, void *data, int size)
{
unsigned long offset;
bool ret = true;
......
......@@ -54,11 +54,11 @@ struct bln_dev {
static struct bln_dev bdev;
extern struct kvm *kvm;
static bool virtio_bln_dev_in(void *data, unsigned long offset, int size, u32 count)
static bool virtio_bln_dev_in(void *data, unsigned long offset, int size)
{
u8 *config_space = (u8 *) &bdev.config;
if (size != 1 || count != 1)
if (size != 1)
return false;
ioport__write8(data, config_space[offset - VIRTIO_MSI_CONFIG_VECTOR]);
......@@ -66,11 +66,11 @@ static bool virtio_bln_dev_in(void *data, unsigned long offset, int size, u32 co
return true;
}
static bool virtio_bln_dev_out(void *data, unsigned long offset, int size, u32 count)
static bool virtio_bln_dev_out(void *data, unsigned long offset, int size)
{
u8 *config_space = (u8 *) &bdev.config;
if (size != 1 || count != 1)
if (size != 1)
return false;
config_space[offset - VIRTIO_MSI_CONFIG_VECTOR] = *(u8 *)data;
......@@ -78,7 +78,7 @@ static bool virtio_bln_dev_out(void *data, unsigned long offset, int size, u32 c
return true;
}
static bool virtio_bln_pci_io_in(struct ioport *ioport, struct kvm *kvm, u16 port, void *data, int size, u32 count)
static bool virtio_bln_pci_io_in(struct ioport *ioport, struct kvm *kvm, u16 port, void *data, int size)
{
unsigned long offset;
bool ret = true;
......@@ -109,7 +109,7 @@ static bool virtio_bln_pci_io_in(struct ioport *ioport, struct kvm *kvm, u16 por
bdev.isr = VIRTIO_IRQ_LOW;
break;
default:
ret = virtio_bln_dev_in(data, offset, size, count);
ret = virtio_bln_dev_in(data, offset, size);
break;
};
......@@ -195,7 +195,7 @@ static void ioevent_callback(struct kvm *kvm, void *param)
thread_pool__do_job(param);
}
static bool virtio_bln_pci_io_out(struct ioport *ioport, struct kvm *kvm, u16 port, void *data, int size, u32 count)
static bool virtio_bln_pci_io_out(struct ioport *ioport, struct kvm *kvm, u16 port, void *data, int size)
{
unsigned long offset;
bool ret = true;
......@@ -249,7 +249,7 @@ static bool virtio_bln_pci_io_out(struct ioport *ioport, struct kvm *kvm, u16 po
bdev.config_vector = VIRTIO_MSI_NO_VECTOR;
break;
default:
ret = virtio_bln_dev_out(data, offset, size, count);
ret = virtio_bln_dev_out(data, offset, size);
break;
};
......
......@@ -60,11 +60,11 @@ struct blk_dev {
static LIST_HEAD(bdevs);
static bool virtio_blk_dev_in(struct blk_dev *bdev, void *data, unsigned long offset, int size, u32 count)
static bool virtio_blk_dev_in(struct blk_dev *bdev, void *data, unsigned long offset, int size)
{
u8 *config_space = (u8 *) &bdev->blk_config;
if (size != 1 || count != 1)
if (size != 1)
return false;
ioport__write8(data, config_space[offset - VIRTIO_MSI_CONFIG_VECTOR]);
......@@ -72,7 +72,7 @@ static bool virtio_blk_dev_in(struct blk_dev *bdev, void *data, unsigned long of
return true;
}
static bool virtio_blk_pci_io_in(struct ioport *ioport, struct kvm *kvm, u16 port, void *data, int size, u32 count)
static bool virtio_blk_pci_io_in(struct ioport *ioport, struct kvm *kvm, u16 port, void *data, int size)
{
struct blk_dev *bdev;
u16 offset;
......@@ -112,7 +112,7 @@ static bool virtio_blk_pci_io_in(struct ioport *ioport, struct kvm *kvm, u16 por
ioport__write16(data, bdev->config_vector);
break;
default:
ret = virtio_blk_dev_in(bdev, data, offset, size, count);
ret = virtio_blk_dev_in(bdev, data, offset, size);
break;
};
......@@ -189,7 +189,7 @@ static void virtio_blk_do_io(struct kvm *kvm, struct virt_queue *vq, struct blk_
}
}
static bool virtio_blk_pci_io_out(struct ioport *ioport, struct kvm *kvm, u16 port, void *data, int size, u32 count)
static bool virtio_blk_pci_io_out(struct ioport *ioport, struct kvm *kvm, u16 port, void *data, int size)
{
struct blk_dev *bdev;
u16 offset;
......
......@@ -96,11 +96,11 @@ void virtio_console__inject_interrupt(struct kvm *kvm)
thread_pool__do_job(&cdev.jobs[VIRTIO_CONSOLE_RX_QUEUE]);
}
static bool virtio_console_pci_io_device_specific_in(void *data, unsigned long offset, int size, u32 count)
static bool virtio_console_pci_io_device_specific_in(void *data, unsigned long offset, int size)
{
u8 *config_space = (u8 *) &cdev.console_config;
if (size != 1 || count != 1)
if (size != 1)
return false;
if ((offset - VIRTIO_MSI_CONFIG_VECTOR) > sizeof(struct virtio_console_config))
......@@ -111,7 +111,7 @@ static bool virtio_console_pci_io_device_specific_in(void *data, unsigned long o
return true;
}
static bool virtio_console_pci_io_in(struct ioport *ioport, struct kvm *kvm, u16 port, void *data, int size, u32 count)
static bool virtio_console_pci_io_in(struct ioport *ioport, struct kvm *kvm, u16 port, void *data, int size)
{
unsigned long offset = port - cdev.base_addr;
bool ret = true;
......@@ -147,7 +147,7 @@ static bool virtio_console_pci_io_in(struct ioport *ioport, struct kvm *kvm, u16
ioport__write16(data, cdev.config_vector);
break;
default:
ret = virtio_console_pci_io_device_specific_in(data, offset, size, count);
ret = virtio_console_pci_io_device_specific_in(data, offset, size);
};
mutex_unlock(&cdev.mutex);
......@@ -179,7 +179,7 @@ static void virtio_console_handle_callback(struct kvm *kvm, void *param)
}
static bool virtio_console_pci_io_out(struct ioport *ioport, struct kvm *kvm, u16 port, void *data, int size, u32 count)
static bool virtio_console_pci_io_out(struct ioport *ioport, struct kvm *kvm, u16 port, void *data, int size)
{
unsigned long offset = port - cdev.base_addr;
bool ret = true;
......
......@@ -174,11 +174,11 @@ static void *virtio_net_tx_thread(void *p)
}
static bool virtio_net_pci_io_device_specific_in(void *data, unsigned long offset, int size, u32 count)
static bool virtio_net_pci_io_device_specific_in(void *data, unsigned long offset, int size)
{
u8 *config_space = (u8 *)&ndev.config;
if (size != 1 || count != 1)
if (size != 1)
return false;
if ((offset - VIRTIO_MSI_CONFIG_VECTOR) > sizeof(struct virtio_net_config))
......@@ -189,7 +189,7 @@ static bool virtio_net_pci_io_device_specific_in(void *data, unsigned long offse
return true;
}
static bool virtio_net_pci_io_in(struct ioport *ioport, struct kvm *kvm, u16 port, void *data, int size, u32 count)
static bool virtio_net_pci_io_in(struct ioport *ioport, struct kvm *kvm, u16 port, void *data, int size)
{
unsigned long offset = port - ndev.base_addr;
bool ret = true;
......@@ -222,7 +222,7 @@ static bool virtio_net_pci_io_in(struct ioport *ioport, struct kvm *kvm, u16 por
ndev.isr = VIRTIO_IRQ_LOW;
break;
default:
ret = virtio_net_pci_io_device_specific_in(data, offset, size, count);
ret = virtio_net_pci_io_device_specific_in(data, offset, size);
};
mutex_unlock(&ndev.mutex);
......@@ -248,7 +248,7 @@ static void virtio_net_handle_callback(struct kvm *kvm, u16 queue_index)
}
}
static bool virtio_net_pci_io_out(struct ioport *ioport, struct kvm *kvm, u16 port, void *data, int size, u32 count)
static bool virtio_net_pci_io_out(struct ioport *ioport, struct kvm *kvm, u16 port, void *data, int size)
{
unsigned long offset = port - ndev.base_addr;
bool ret = true;
......
......@@ -50,7 +50,7 @@ struct rng_dev {
static LIST_HEAD(rdevs);
static bool virtio_rng_pci_io_in(struct ioport *ioport, struct kvm *kvm, u16 port, void *data, int size, u32 count)
static bool virtio_rng_pci_io_in(struct ioport *ioport, struct kvm *kvm, u16 port, void *data, int size)
{
unsigned long offset;
bool ret = true;
......@@ -120,7 +120,7 @@ static void virtio_rng_do_io(struct kvm *kvm, void *param)
kvm__irq_line(kvm, rdev->pci_hdr.irq_line, VIRTIO_IRQ_HIGH);
}
static bool virtio_rng_pci_io_out(struct ioport *ioport, struct kvm *kvm, u16 port, void *data, int size, u32 count)
static bool virtio_rng_pci_io_out(struct ioport *ioport, struct kvm *kvm, u16 port, void *data, int size)
{
unsigned long offset;
bool ret = true;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment