On Fri, Sep 22, 2017 at 12:40:02PM -0300, Philippe Mathieu-Daudé wrote:
> - include vmmouse
> - add entries in MAINTAINERS (pckbd.c, i8042.h)
>
> Signed-off-by: Philippe Mathieu-Daudé
ppc portions
Acked-by: David Gibson
> ---
> include/hw/i386/pc.h | 11 ---
> include/hw/input/i8042.h | 30 ++
> hw/alpha/dp264.c | 3 ++-
> hw/i386/pc.c | 5 +++--
> hw/input/pckbd.c | 2 +-
> hw/input/vmmouse.c | 3 +--
> hw/mips/mips_fulong2e.c | 3 ++-
> hw/mips/mips_jazz.c | 1 +
> hw/mips/mips_malta.c | 3 ++-
> hw/mips/mips_r4k.c | 3 ++-
> hw/misc/vmport.c | 1 +
> hw/ppc/prep.c| 5 +++--
> hw/sparc64/sun4u.c | 3 ++-
> hw/unicore32/puv3.c | 1 +
> MAINTAINERS | 4 +++-
> 15 files changed, 54 insertions(+), 24 deletions(-)
> create mode 100644 include/hw/input/i8042.h
>
> diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h
> index 25ba378bd8..6a2e947332 100644
> --- a/include/hw/i386/pc.h
> +++ b/include/hw/i386/pc.h
> @@ -193,17 +193,6 @@ static inline void vmport_init(ISABus *bus)
> }
>
> void vmport_register(unsigned char command, VMPortReadFunc *func, void
> *opaque);
> -void vmmouse_get_data(uint32_t *data);
> -void vmmouse_set_data(const uint32_t *data);
> -
> -/* pckbd.c */
> -#define I8042_A20_LINE "a20"
> -
> -void i8042_mm_init(qemu_irq kbd_irq, qemu_irq mouse_irq,
> - MemoryRegion *region, ram_addr_t size,
> - hwaddr mask);
> -void i8042_isa_mouse_fake_event(void *opaque);
> -void i8042_setup_a20_line(ISADevice *dev, qemu_irq a20_out);
>
> /* pc.c */
> extern int fd_bootchk;
> diff --git a/include/hw/input/i8042.h b/include/hw/input/i8042.h
> new file mode 100644
> index 00..836417304b
> --- /dev/null
> +++ b/include/hw/input/i8042.h
> @@ -0,0 +1,30 @@
> +/*
> + * QEMU PS/2 Controller
> + *
> + * Copyright (c) 2003 Fabrice Bellard
> + *
> + * This work is licensed under the terms of the GNU GPL, version 2 or later.
> + * See the COPYING file in the top-level directory.
> + */
> +#ifndef HW_INPUT_I8042_H
> +#define HW_INPUT_I8042_H
> +
> +#include "hw/hw.h"
> +#include "hw/isa/isa.h"
> +
> +#define TYPE_I8042 "i8042"
> +
> +#define I8042_A20_LINE "a20"
> +
> +void i8042_mm_init(qemu_irq kbd_irq, qemu_irq mouse_irq,
> + MemoryRegion *region, ram_addr_t size,
> + hwaddr mask);
> +void i8042_isa_mouse_fake_event(void *opaque);
> +void i8042_setup_a20_line(ISADevice *dev, qemu_irq a20_out);
> +
> +#define TYPE_VMMOUSE "vmmouse"
> +
> +void vmmouse_get_data(uint32_t *data);
> +void vmmouse_set_data(const uint32_t *data);
> +
> +#endif /* HW_INPUT_I8042_H */
> diff --git a/hw/alpha/dp264.c b/hw/alpha/dp264.c
> index 1bd5243648..2253990654 100644
> --- a/hw/alpha/dp264.c
> +++ b/hw/alpha/dp264.c
> @@ -19,6 +19,7 @@
> #include "hw/timer/mc146818rtc.h"
> #include "hw/ide.h"
> #include "hw/timer/i8254.h"
> +#include "hw/input/i8042.h"
> #include "hw/char/serial.h"
> #include "qemu/cutils.h"
>
> @@ -82,7 +83,7 @@ static void clipper_init(MachineState *machine)
> rtc_init(isa_bus, 1900, rtc_irq);
>
> i8254_pit_init(isa_bus, 0x40, 0, NULL);
> -isa_create_simple(isa_bus, "i8042");
> +isa_create_simple(isa_bus, TYPE_I8042);
>
> /* VGA setup. Don't bother loading the bios. */
> pci_vga_init(pci_bus);
> diff --git a/hw/i386/pc.c b/hw/i386/pc.c
> index 5cb0ae67cd..3aa10c780b 100644
> --- a/hw/i386/pc.c
> +++ b/hw/i386/pc.c
> @@ -40,6 +40,7 @@
> #include "multiboot.h"
> #include "hw/timer/mc146818rtc.h"
> #include "hw/timer/i8254.h"
> +#include "hw/input/i8042.h"
> #include "hw/audio/pcspk.h"
> #include "hw/pci/msi.h"
> #include "hw/sysbus.h"
> @@ -1564,11 +1565,11 @@ void pc_basic_device_init(ISABus *isa_bus, qemu_irq
> *gsi,
> parallel_hds_isa_init(isa_bus, MAX_PARALLEL_PORTS);
>
> a20_line = qemu_allocate_irqs(handle_a20_line_change, first_cpu, 2);
> -i8042 = isa_create_simple(isa_bus, "i8042");
> +i8042 = isa_create_simple(isa_bus, TYPE_I8042);
> i8042_setup_a20_line(i8042, a20_line[0]);
> if (!no_vmport) {
> vmport_init(isa_bus);
> -vmmouse = isa_try_create(isa_bus, "vmmouse");
> +vmmouse = isa_try_create(isa_bus, TYPE_VMMOUSE);
> } else {
> vmmouse = NULL;
> }
> diff --git a/hw/input/pckbd.c b/hw/input/pckbd.c
> index c479f827b6..f17f18e51b 100644
> --- a/hw/input/pckbd.c
> +++ b/hw/input/pckbd.c
> @@ -26,6 +26,7 @@
> #include "hw/isa/isa.h"
> #include "hw/i386/pc.h"
> #include "hw/input/ps2.h"
> +#include "hw/input/i8042.h"
> #include "sysemu/sysemu.h"
>
> /* debug PC keyboard */
> @@ -480,7 +481,6 @@ void i8042_mm_init(qemu_irq kbd_irq, qemu_irq mouse_irq,
> qemu_register_reset(kbd_reset, s);
> }
>
> -#define TYPE_I8042 "i8042"
> #define I8042(obj) OBJECT_CHECK(ISAKBDState, (obj), TYPE_I8042)
>
> typedef struct ISAKBDState {
> diff --g