From nobody Tue Feb 10 19:23:08 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1506096065567960.3919055795203; Fri, 22 Sep 2017 09:01:05 -0700 (PDT) Received: from localhost ([::1]:59691 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dvQNq-0004sW-Bk for importer@patchew.org; Fri, 22 Sep 2017 12:00:54 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42027) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dvQ5M-0005OB-ME for qemu-devel@nongnu.org; Fri, 22 Sep 2017 11:41:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dvQ5K-0003eE-VF for qemu-devel@nongnu.org; Fri, 22 Sep 2017 11:41:48 -0400 Received: from mail-qt0-x242.google.com ([2607:f8b0:400d:c0d::242]:33086) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dvQ5K-0003e7-Q3; Fri, 22 Sep 2017 11:41:46 -0400 Received: by mail-qt0-x242.google.com with SMTP id b1so895065qtc.0; Fri, 22 Sep 2017 08:41:46 -0700 (PDT) Received: from yoga.lan ([181.93.89.178]) by smtp.gmail.com with ESMTPSA id z75sm71742qkb.71.2017.09.22.08.41.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 22 Sep 2017 08:41:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=jxT+oasyePyXxB2t60wzMd3kGn+VqY7gCnr0ggxsMVE=; b=hijs6x86YOoJXbjfJzuM6qpe8RNxrqDc8SKg+qPEqiVYJj3/4YKGEEfHenObLNIa9c bSI1Wb9SCjAv6aKUl36Jlm9tq4c7BnFrqIkUT+Ok/+A5lKdgVtkDvfPApMPHPM2dnfRW zJKwFOxj0+gUNbIkRQ5cg/RtDvZ7yXkY5jLLJUXY2W1KQjuSwAMiZTK5yWHzNWRBQQAW JD+ljPAZMS/EJYCrn9jYxzaWoKMjGrT7wTVjJ+mKqy664wkWXcgbXXegAmhdkGLF0mgd u4HsCUv5WiN30dH0RGNbkmoaicjfIkKwgiwCrdKA1xb3QIrd9cCDLbWxC2ukeE92afoC OToA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=jxT+oasyePyXxB2t60wzMd3kGn+VqY7gCnr0ggxsMVE=; b=PKuX5radR90Tplz5NanKdF5KvJXzRNDn84e88hjNdZYgh7r/QE8+YZteu4tvk2ag83 PQ9lC5iiTITEHM0MXZXJFGl9OIosFpjiubApSBtulj2p3OOS2wo3V6OjiybzQAxFnugo OZf1iktoGjHlxCgxzp/p/S0pbOR+j1XWUYhsZyyUwmVt2qD9arB1LToQ2HEgrIRPIpkB l6x1qjDIoyamUP9oEUvBYbIZ+Jj2iO0xCeDzzcVIEl7SHwcMKly6o+/WGcReMe+QIhq7 zrtsS19Hd3r++hvHLZrax4sWqGgqbBfctTWtibb7/+uWdck4Me2HGZAjsW3XY14OW1RX rIvA== X-Gm-Message-State: AHPjjUijgpLnSm3PKXMT49tvsX16j+mE240ms8d2sljuYOioJbg4m6L7 TePKUOrI2tCUimh/6znntY9chG0vPJ0= X-Google-Smtp-Source: AOwi7QB1H9OIyBazoVA0DUp/GNX+MGwgWofJkwAi1ejFk1JH+STgTEJcVCA+DKcTu0XuALCwy6FuFA== X-Received: by 10.237.34.56 with SMTP id n53mr9019348qtc.140.1506094906090; Fri, 22 Sep 2017 08:41:46 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Peter Maydell , Thomas Huth , Paolo Bonzini , "Michael S. Tsirkin" , Aurelien Jarno , Yongbok Kim , Richard Henderson , =?UTF-8?q?Herv=C3=A9=20Poussineau?= , David Gibson , Alexander Graf , Guan Xuetao , Mark Cave-Ayland , Artyom Tarasenko Date: Fri, 22 Sep 2017 12:40:02 -0300 Message-Id: <20170922154014.29350-23-f4bug@amsat.org> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20170922154014.29350-1-f4bug@amsat.org> References: <20170922154014.29350-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c0d::242 Subject: [Qemu-devel] [PATCH 22/34] hw/input/i8042: extract API from hw/i386/pc.h X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-ppc@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 - include vmmouse - add entries in MAINTAINERS (pckbd.c, i8042.h) Signed-off-by: Philippe Mathieu-Daud=C3=A9 Acked-by: David Gibson Reviewed-by: Herv=C3=A9 Poussineau --- 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) } =20 void vmport_register(unsigned char command, VMPortReadFunc *func, void *op= aque); -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); =20 /* 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 0000000000..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 late= r. + * 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" =20 @@ -82,7 +83,7 @@ static void clipper_init(MachineState *machine) rtc_init(isa_bus, 1900, rtc_irq); =20 i8254_pit_init(isa_bus, 0x40, 0, NULL); - isa_create_simple(isa_bus, "i8042"); + isa_create_simple(isa_bus, TYPE_I8042); =20 /* 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); =20 a20_line =3D qemu_allocate_irqs(handle_a20_line_change, first_cpu, 2); - i8042 =3D isa_create_simple(isa_bus, "i8042"); + i8042 =3D isa_create_simple(isa_bus, TYPE_I8042); i8042_setup_a20_line(i8042, a20_line[0]); if (!no_vmport) { vmport_init(isa_bus); - vmmouse =3D isa_try_create(isa_bus, "vmmouse"); + vmmouse =3D isa_try_create(isa_bus, TYPE_VMMOUSE); } else { vmmouse =3D 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" =20 /* 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); } =20 -#define TYPE_I8042 "i8042" #define I8042(obj) OBJECT_CHECK(ISAKBDState, (obj), TYPE_I8042) =20 typedef struct ISAKBDState { diff --git a/hw/input/vmmouse.c b/hw/input/vmmouse.c index b6d22086f4..c48c07c564 100644 --- a/hw/input/vmmouse.c +++ b/hw/input/vmmouse.c @@ -24,7 +24,7 @@ #include "qemu/osdep.h" #include "hw/hw.h" #include "ui/console.h" -#include "hw/input/ps2.h" +#include "hw/input/i8042.h" #include "hw/i386/pc.h" #include "hw/qdev.h" =20 @@ -52,7 +52,6 @@ #define DPRINTF(fmt, ...) do { } while (0) #endif =20 -#define TYPE_VMMOUSE "vmmouse" #define VMMOUSE(obj) OBJECT_CHECK(VMMouseState, (obj), TYPE_VMMOUSE) =20 typedef struct VMMouseState diff --git a/hw/mips/mips_fulong2e.c b/hw/mips/mips_fulong2e.c index 22e6c05fb5..a35745a407 100644 --- a/hw/mips/mips_fulong2e.c +++ b/hw/mips/mips_fulong2e.c @@ -42,6 +42,7 @@ #include "hw/isa/vt82c686.h" #include "hw/timer/mc146818rtc.h" #include "hw/timer/i8254.h" +#include "hw/input/i8042.h" #include "sysemu/blockdev.h" #include "exec/address-spaces.h" #include "sysemu/qtest.h" @@ -367,7 +368,7 @@ static void mips_fulong2e_init(MachineState *machine) DMA_init(isa_bus, 0); =20 /* Super I/O */ - isa_create_simple(isa_bus, "i8042"); + isa_create_simple(isa_bus, TYPE_I8042); =20 rtc_init(isa_bus, 2000, NULL); =20 diff --git a/hw/mips/mips_jazz.c b/hw/mips/mips_jazz.c index 25f0294236..1bbef7eeb5 100644 --- a/hw/mips/mips_jazz.c +++ b/hw/mips/mips_jazz.c @@ -41,6 +41,7 @@ #include "hw/timer/i8254.h" #include "hw/display/vga.h" #include "hw/audio/pcspk.h" +#include "hw/input/i8042.h" #include "sysemu/block-backend.h" #include "hw/sysbus.h" #include "exec/address-spaces.h" diff --git a/hw/mips/mips_malta.c b/hw/mips/mips_malta.c index de547d732f..45c7f589aa 100644 --- a/hw/mips/mips_malta.c +++ b/hw/mips/mips_malta.c @@ -45,6 +45,7 @@ #include "hw/loader.h" #include "elf.h" #include "hw/timer/mc146818rtc.h" +#include "hw/input/i8042.h" #include "hw/timer/i8254.h" #include "sysemu/blockdev.h" #include "exec/address-spaces.h" @@ -1221,7 +1222,7 @@ void mips_malta_init(MachineState *machine) DMA_init(isa_bus, 0); =20 /* Super I/O */ - isa_create_simple(isa_bus, "i8042"); + isa_create_simple(isa_bus, TYPE_I8042); =20 rtc_init(isa_bus, 2000, NULL); serial_hds_isa_init(isa_bus, 0, 2); diff --git a/hw/mips/mips_r4k.c b/hw/mips/mips_r4k.c index 48fad52540..946097a31f 100644 --- a/hw/mips/mips_r4k.c +++ b/hw/mips/mips_r4k.c @@ -27,6 +27,7 @@ #include "hw/loader.h" #include "elf.h" #include "hw/timer/mc146818rtc.h" +#include "hw/input/i8042.h" #include "hw/timer/i8254.h" #include "sysemu/block-backend.h" #include "exec/address-spaces.h" @@ -295,7 +296,7 @@ void mips_r4k_init(MachineState *machine) hd[MAX_IDE_DEVS * i], hd[MAX_IDE_DEVS * i + 1]); =20 - isa_create_simple(isa_bus, "i8042"); + isa_create_simple(isa_bus, TYPE_I8042); } =20 static void mips_machine_init(MachineClass *mc) diff --git a/hw/misc/vmport.c b/hw/misc/vmport.c index 165500223f..bc078eb20a 100644 --- a/hw/misc/vmport.c +++ b/hw/misc/vmport.c @@ -25,6 +25,7 @@ #include "hw/hw.h" #include "hw/isa/isa.h" #include "hw/i386/pc.h" +#include "hw/input/i8042.h" #include "sysemu/hw_accel.h" #include "hw/qdev.h" =20 diff --git a/hw/ppc/prep.c b/hw/ppc/prep.c index 94138a4e8c..16f4537093 100644 --- a/hw/ppc/prep.c +++ b/hw/ppc/prep.c @@ -41,6 +41,7 @@ #include "hw/ide.h" #include "hw/loader.h" #include "hw/timer/mc146818rtc.h" +#include "hw/input/i8042.h" #include "hw/isa/pc87312.h" #include "sysemu/block-backend.h" #include "sysemu/arch_init.h" @@ -643,7 +644,7 @@ static void ppc_prep_init(MachineState *machine) hd[2 * i], hd[2 * i + 1]); } - isa_create_simple(isa_bus, "i8042"); + isa_create_simple(isa_bus, TYPE_I8042); =20 cpu =3D POWERPC_CPU(first_cpu); sysctrl->reset_irq =3D cpu->env.irq_inputs[PPC6xx_INPUT_HRESET]; @@ -775,7 +776,7 @@ static void ibm_40p_init(MachineState *machine) =20 /* add some more devices */ if (defaults_enabled()) { - isa_create_simple(isa_bus, "i8042"); + isa_create_simple(isa_bus, TYPE_I8042); m48t59 =3D NVRAM(isa_create_simple(isa_bus, "isa-m48t59")); =20 dev =3D DEVICE(isa_create(isa_bus, "cs4231a")); diff --git a/hw/sparc64/sun4u.c b/hw/sparc64/sun4u.c index c3280aaf38..973daed977 100644 --- a/hw/sparc64/sun4u.c +++ b/hw/sparc64/sun4u.c @@ -31,6 +31,7 @@ #include "hw/i386/pc.h" #include "hw/char/serial.h" #include "hw/timer/m48t59.h" +#include "hw/input/i8042.h" #include "hw/block/fdc.h" #include "net/net.h" #include "qemu/timer.h" @@ -488,7 +489,7 @@ static void sun4uv_init(MemoryRegion *address_space_mem, =20 pci_cmd646_ide_init(pci_bus, hd, 1); =20 - isa_create_simple(isa_bus, "i8042"); + isa_create_simple(isa_bus, TYPE_I8042); =20 /* Floppy */ for(i =3D 0; i < MAX_FD; i++) { diff --git a/hw/unicore32/puv3.c b/hw/unicore32/puv3.c index 6849bac59c..cf79c89f12 100644 --- a/hw/unicore32/puv3.c +++ b/hw/unicore32/puv3.c @@ -19,6 +19,7 @@ =20 #undef DEBUG_PUV3 #include "hw/unicore32/puv3.h" +#include "hw/input/i8042.h" =20 #define KERNEL_LOAD_ADDR 0x03000000 #define KERNEL_MAX_SIZE 0x00800000 /* Just a guess */ diff --git a/MAINTAINERS b/MAINTAINERS index f7d377ead9..cc1f8bb66b 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -834,12 +834,13 @@ F: hw/misc/sga.c PC Chipset M: Michael S. Tsirkin M: Paolo Bonzini -S: Support +S: Supported F: hw/char/debugcon.c F: hw/char/parallel.c F: hw/char/serial* F: hw/dma/i8257* F: hw/i2c/pm_smbus.c +F: hw/input/pckbd.c F: hw/intc/apic* F: hw/intc/ioapic* F: hw/intc/i8259* @@ -849,6 +850,7 @@ F: hw/timer/hpet* F: hw/timer/i8254* F: hw/timer/mc146818rtc* F: include/hw/i2c/pm_smbus.h +F: include/hw/input/i8042.h F: include/hw/timer/hpet.h F: include/hw/timer/i8254* F: include/hw/timer/mc146818rtc* --=20 2.14.1