From nobody Sat Oct 25 08:57:50 2025 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 (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1520284914716703.9640684023675; Mon, 5 Mar 2018 13:21:54 -0800 (PST) Received: from localhost ([::1]:51594 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1esxYP-0005iO-Rc for importer@patchew.org; Mon, 05 Mar 2018 16:21:53 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49210) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1esxWK-0004Eh-4C for qemu-devel@nongnu.org; Mon, 05 Mar 2018 16:19:45 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1esxWI-0001UJ-GA for qemu-devel@nongnu.org; Mon, 05 Mar 2018 16:19:44 -0500 Received: from mail-wm0-x242.google.com ([2a00:1450:400c:c09::242]:53424) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1esxWI-0001U1-5f; Mon, 05 Mar 2018 16:19:42 -0500 Received: by mail-wm0-x242.google.com with SMTP id t74so18846259wme.3; Mon, 05 Mar 2018 13:19:42 -0800 (PST) Received: from x1.local (ABayonne-654-1-79-224.w86-222.abo.wanadoo.fr. [86.222.222.224]) by smtp.gmail.com with ESMTPSA id g96sm12904808wrd.73.2018.03.05.13.19.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 05 Mar 2018 13:19:40 -0800 (PST) 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=9BhZ2Ad+M63Anz2wzY251SFzNDhq56ESLYCil4p9fQQ=; b=tEm/5IRHvESuSgRWRFjZlK58AbA3/57VrubNYF5IwHsXxl4Xuih7anQyLAv4M4iTW5 NmrjNjfu9zRJ6AROz/GGxPbirzmHos0SEe53fyIAlLV7gznfRspxm5yEHx0tUoWEEp2T ARtrbjEbyND3pUH4cbCpQirRpo0kmHGCghIl9XeDPftvBhxAyvRpiqsVOEPNy8E+981y g0/POTNUg0BR1UWf62d8yfkqSTRgPSjgpS0lY+NN3z21By4KgHe89/vg9TU1k0MRYac9 t8rIwghQwWHYPvp9rfG2VJLwWt8Lv7fjmMkI6zyRRicMgb9R4GwJtuH3DSxCVycYXbH1 znvw== 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=9BhZ2Ad+M63Anz2wzY251SFzNDhq56ESLYCil4p9fQQ=; b=TaRxLfagW/nkNmYiaJ7nzruMV9pteSEcWA4WuEsP8ivKgXxYXVldasHWLKjcuxcufp vU3oeBEvn9x8a3ZuCaTIFiVLsPo2kn0x/5i79TMr9kDyesih9EGvDAU3XomSciPCNmXi eKYQaCWCFWuuqq9+l2+YhAk1dbMQOUkFgyRdKHwtMlAUhsKl6OBVlvp0RuZgiwDimIQ0 S+ALlw9zCUC7Rq9A+T0IIY2dcC1we9IoJpIFxddcUYiw08n1og6Vo6BkQ5CuLi5ivC9+ nej/CNmpYeAhrQ+K5gKG7xOUvIDLJ3xUQawlLoSY0BFhghPnSDxI5Am35U/rF/rxm8// PhJA== X-Gm-Message-State: AElRT7G7w2e7Tux7p2ZJaZLaf6dIH09fTwR1Hr16rOPqGcuKOlaAzf8I 0iQ/giyRw8aSv9PCmaexvQI= X-Google-Smtp-Source: AG47ELs5OfIC68rWXiy/V4EGzLWRSCRhoX4dsOosbDNoZm1hwWdslDcaMSthT6AiNo7U+yfns51ejg== X-Received: by 10.28.208.70 with SMTP id h67mr1151262wmg.95.1520284780974; Mon, 05 Mar 2018 13:19:40 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: "Michael S . Tsirkin" , Paolo Bonzini , =?UTF-8?q?Herv=C3=A9=20Poussineau?= , Marcel Apfelbaum , Aurelien Jarno , Mark Cave-Ayland , Alexey Kardashevskiy , Thomas Huth Date: Mon, 5 Mar 2018 18:19:09 -0300 Message-Id: <20180305211928.466-4-f4bug@amsat.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180305211928.466-1-f4bug@amsat.org> References: <20180305211928.466-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: 2a00:1450:400c:c09::242 Subject: [Qemu-devel] [RFC PATCH v2 03/22] hw/input/i8042: Extract declarations from i386/pc.h into input/i8042.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: Alexander Graf , Eduardo Habkost , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-devel@nongnu.org, "open list:PReP" , David Gibson , Guan Xuetao , Yongbok Kim , Artyom Tarasenko , Richard Henderson 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 Signed-off-by: Philippe Mathieu-Daud=C3=A9 Acked-by: David Gibson --- include/hw/i386/pc.h | 9 --------- include/hw/input/i8042.h | 24 ++++++++++++++++++++++++ hw/alpha/dp264.c | 3 ++- hw/i386/pc.c | 1 + hw/i386/vmmouse.c | 1 + hw/i386/vmport.c | 1 + hw/input/pckbd.c | 2 +- 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/ppc/prep.c | 5 +++-- hw/sparc64/sun4u.c | 1 + hw/unicore32/puv3.c | 1 + MAINTAINERS | 1 + 15 files changed, 43 insertions(+), 16 deletions(-) create mode 100644 include/hw/input/i8042.h diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h index f1feb18c3c..1638618dfc 100644 --- a/include/hw/i386/pc.h +++ b/include/hw/i386/pc.h @@ -188,15 +188,6 @@ void vmport_register(unsigned char command, VMPortRead= Func *func, void *opaque); void vmmouse_get_data(uint32_t *data); void vmmouse_set_data(const uint32_t *data); =20 -/* 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; =20 diff --git a/include/hw/input/i8042.h b/include/hw/input/i8042.h new file mode 100644 index 0000000000..f6ff146364 --- /dev/null +++ b/include/hw/input/i8042.h @@ -0,0 +1,24 @@ +/* + * QEMU PS/2 Controller + * + * Copyright (c) 2003 Fabrice Bellard + * + * SPDX-License-Identifier: MIT + */ +#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); + +#endif /* HW_INPUT_I8042_H */ diff --git a/hw/alpha/dp264.c b/hw/alpha/dp264.c index 766373eec7..e13cb576fd 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 @@ -81,7 +82,7 @@ static void clipper_init(MachineState *machine) mc146818_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 95b3fb3523..efb1b3bccf 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -43,6 +43,7 @@ #include "hw/timer/mc146818rtc.h" #include "hw/dma/i8257.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" diff --git a/hw/i386/vmmouse.c b/hw/i386/vmmouse.c index 65ef55329e..5d2d278be4 100644 --- a/hw/i386/vmmouse.c +++ b/hw/i386/vmmouse.c @@ -25,6 +25,7 @@ #include "hw/hw.h" #include "ui/console.h" #include "hw/i386/pc.h" +#include "hw/input/i8042.h" #include "hw/qdev.h" =20 /* debug only vmmouse */ diff --git a/hw/i386/vmport.c b/hw/i386/vmport.c index 116aa09819..3bf8cfe041 100644 --- a/hw/i386/vmport.c +++ b/hw/i386/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" #include "qemu/log.h" 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/mips/mips_fulong2e.c b/hw/mips/mips_fulong2e.c index 0545fcd899..9339e02120 100644 --- a/hw/mips/mips_fulong2e.c +++ b/hw/mips/mips_fulong2e.c @@ -44,6 +44,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" @@ -364,7 +365,7 @@ static void mips_fulong2e_init(MachineState *machine) i8257_dma_init(isa_bus, 0); =20 /* Super I/O */ - isa_create_simple(isa_bus, "i8042"); + isa_create_simple(isa_bus, TYPE_I8042); =20 mc146818_rtc_init(isa_bus, 2000, NULL); =20 diff --git a/hw/mips/mips_jazz.c b/hw/mips/mips_jazz.c index 827ffdcd4a..5abbe30c21 100644 --- a/hw/mips/mips_jazz.c +++ b/hw/mips/mips_jazz.c @@ -43,6 +43,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 9cb86c432e..cd7bd0eef6 100644 --- a/hw/mips/mips_malta.c +++ b/hw/mips/mips_malta.c @@ -47,6 +47,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" @@ -1213,7 +1214,7 @@ void mips_malta_init(MachineState *machine) i8257_dma_init(isa_bus, 0); =20 /* Super I/O */ - isa_create_simple(isa_bus, "i8042"); + isa_create_simple(isa_bus, TYPE_I8042); =20 mc146818_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 830ee7732c..aeadc4a340 100644 --- a/hw/mips/mips_r4k.c +++ b/hw/mips/mips_r4k.c @@ -28,6 +28,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" @@ -286,7 +287,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/ppc/prep.c b/hw/ppc/prep.c index 096d4d4cfb..ae724b0613 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 "hw/net/ne2000-isa.h" #include "sysemu/block-backend.h" @@ -641,7 +642,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]; @@ -771,7 +772,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 0ca0243821..2044a52ded 100644 --- a/hw/sparc64/sun4u.c +++ b/hw/sparc64/sun4u.c @@ -36,6 +36,7 @@ #include "hw/char/serial.h" #include "hw/char/parallel.h" #include "hw/timer/m48t59.h" +#include "hw/input/i8042.h" #include "hw/block/fdc.h" #include "net/net.h" #include "qemu/timer.h" diff --git a/hw/unicore32/puv3.c b/hw/unicore32/puv3.c index db26959a1d..830fe3face 100644 --- a/hw/unicore32/puv3.c +++ b/hw/unicore32/puv3.c @@ -20,6 +20,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 335c6c9f65..6622efc1da 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -931,6 +931,7 @@ F: include/hw/display/vga.h F: include/hw/char/parallel.h F: include/hw/dma/i8257.h 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.16.2