[{"id":1838679,"web_url":"http://patchwork.ozlabs.org/comment/1838679/","msgid":"<40ab8186-dddc-39cc-2514-077c941d72a6@amsat.org>","list_archive_url":null,"date":"2018-01-14T18:22:40","subject":"Re: [Qemu-devel] [PATCH 06/29] hw/isa: add a generic\n\tisa_superio_init()","submitter":{"id":70924,"url":"http://patchwork.ozlabs.org/api/people/70924/","name":"Philippe Mathieu-Daudé","email":"f4bug@amsat.org"},"content":"On 01/07/2018 11:45 PM, Philippe Mathieu-Daudé wrote:\n> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>\n> ---\n>  include/hw/isa/superio.h | 17 +++++++++++++++++\n>  hw/isa/isa-superio.c     | 45 +++++++++++++++++++++++++++++++++++++++++++++\n>  MAINTAINERS              |  2 ++\n>  hw/isa/Makefile.objs     |  1 +\n>  4 files changed, 65 insertions(+)\n>  create mode 100644 include/hw/isa/superio.h\n>  create mode 100644 hw/isa/isa-superio.c\n> \n> diff --git a/include/hw/isa/superio.h b/include/hw/isa/superio.h\n> new file mode 100644\n> index 0000000000..e685b96653\n> --- /dev/null\n> +++ b/include/hw/isa/superio.h\n> @@ -0,0 +1,17 @@\n> +/*\n> + * Generic ISA Super I/O\n> + *\n> + * Copyright (c) 2018 Philippe Mathieu-Daudé\n> + *\n> + * This work is licensed under the terms of the GNU GPL, version 2 or later.\n> + * See the COPYING file in the top-level directory.\n> + */\n> +#ifndef HW_ISA_SUPERIO_H\n> +#define HW_ISA_SUPERIO_H\n> +\n> +#include \"hw/isa/isa.h\"\n> +\n> +ISADevice *isa_superio_init(ISABus *isa_bus, int serial_count,\n> +                            int parallel_count, int drive_count);\n\nThis approach is simple enough, but how Hervé wrote hw/isa/pc87312.c is\nway cleaner, so I'll respin using it.\n\n> +\n> +#endif\n> diff --git a/hw/isa/isa-superio.c b/hw/isa/isa-superio.c\n> new file mode 100644\n> index 0000000000..93d8457c6b\n> --- /dev/null\n> +++ b/hw/isa/isa-superio.c\n> @@ -0,0 +1,45 @@\n> +/*\n> + * Generic ISA Super I/O\n> + *\n> + * Copyright (c) 2018 Philippe Mathieu-Daudé\n> + *\n> + * This work is licensed under the terms of the GNU GPL, version 2 or later.\n> + * See the COPYING file in the top-level directory.\n> + */\n> +#include \"qemu/osdep.h\"\n> +#include \"qemu/error-report.h\"\n> +#include \"sysemu/blockdev.h\"\n> +#include \"hw/isa/superio.h\"\n> +#include \"hw/char/serial.h\"\n> +#include \"hw/char/parallel.h\"\n> +#include \"hw/block/fdc.h\"\n> +#include \"hw/input/i8042.h\"\n> +\n> +ISADevice *isa_superio_init(ISABus *isa_bus, int serial_count,\n> +                            int parallel_count, int drive_count)\n> +{\n> +    serial_hds_isa_init(isa_bus, 0, serial_count);\n> +\n> +    parallel_hds_isa_init(isa_bus, parallel_count);\n> +\n> +    if (drive_count) {\n> +        DriveInfo **fd;\n> +        int i;\n> +\n> +        if (drive_count > MAX_FD) {\n> +            warn_report(\"superio: ignoring %d floppy controllers\",\n> +                        drive_count - MAX_FD);\n> +            drive_count = MAX_FD;\n> +        }\n> +        fd = g_new(DriveInfo *, drive_count);\n> +\n> +        for (i = 0; i < drive_count; i++) {\n> +            fd[i] = drive_get(IF_FLOPPY, 0, i);\n> +        }\n> +        fdctrl_init_isa(isa_bus, fd);\n> +\n> +        g_free(fd); /* FIXME */\n> +    }\n> +\n> +    return isa_create_simple(isa_bus, TYPE_I8042);\n> +}\n> diff --git a/MAINTAINERS b/MAINTAINERS\n> index 7f9e98a046..6f867da743 100644\n> --- a/MAINTAINERS\n> +++ b/MAINTAINERS\n> @@ -875,6 +875,7 @@ F: hw/input/pckbd.c\n>  F: hw/intc/apic*\n>  F: hw/intc/ioapic*\n>  F: hw/intc/i8259*\n> +F: hw/isa/isa-superio.c\n>  F: hw/misc/debugexit.c\n>  F: hw/misc/pc-testdev.c\n>  F: hw/timer/hpet*\n> @@ -885,6 +886,7 @@ F: include/hw/display/vga.h\n>  F: include/hw/char/parallel.h\n>  F: include/hw/dma/i8257.h\n>  F: include/hw/i2c/pm_smbus.h\n> +F: include/hw/isa/superio.h\n>  F: include/hw/input/i8042.h\n>  F: include/hw/timer/hpet.h\n>  F: include/hw/timer/i8254*\n> diff --git a/hw/isa/Makefile.objs b/hw/isa/Makefile.objs\n> index fb37c55cf2..cac655ba58 100644\n> --- a/hw/isa/Makefile.objs\n> +++ b/hw/isa/Makefile.objs\n> @@ -1,4 +1,5 @@\n>  common-obj-$(CONFIG_ISA_BUS) += isa-bus.o\n> +common-obj-$(CONFIG_ISA_BUS) += isa-superio.o\n>  common-obj-$(CONFIG_APM) += apm.o\n>  common-obj-$(CONFIG_I82378) += i82378.o\n>  common-obj-$(CONFIG_PC87312) += pc87312.o\n>","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"lnDKiCO9\"; dkim-atps=neutral"],"Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3zKPxM3JBsz9s7s\n\tfor <incoming@patchwork.ozlabs.org>;\n\tMon, 15 Jan 2018 05:23:18 +1100 (AEDT)","from localhost ([::1]:54828 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1eamw8-0001im-0g\n\tfor incoming@patchwork.ozlabs.org; Sun, 14 Jan 2018 13:23:16 -0500","from eggs.gnu.org ([2001:4830:134:3::10]:52230)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <philippe.mathieu.daude@gmail.com>)\n\tid 1eamvh-0001gS-UZ\n\tfor qemu-devel@nongnu.org; Sun, 14 Jan 2018 13:22:51 -0500","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <philippe.mathieu.daude@gmail.com>)\n\tid 1eamvd-00052P-11\n\tfor qemu-devel@nongnu.org; Sun, 14 Jan 2018 13:22:49 -0500","from mail-qk0-x22e.google.com ([2607:f8b0:400d:c09::22e]:39213)\n\tby eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16)\n\t(Exim 4.71) (envelope-from <philippe.mathieu.daude@gmail.com>)\n\tid 1eamvc-00052E-SH\n\tfor qemu-devel@nongnu.org; Sun, 14 Jan 2018 13:22:44 -0500","by mail-qk0-x22e.google.com with SMTP id c69so5301316qkg.6\n\tfor <qemu-devel@nongnu.org>; Sun, 14 Jan 2018 10:22:44 -0800 (PST)","from [192.168.1.11] ([138.117.48.219])\n\tby smtp.gmail.com with ESMTPSA id\n\tk29sm8599352qtc.87.2018.01.14.10.22.41\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\n\tSun, 14 Jan 2018 10:22:43 -0800 (PST)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;\n\th=sender:subject:to:cc:references:from:openpgp:message-id:date\n\t:user-agent:mime-version:in-reply-to:content-language\n\t:content-transfer-encoding;\n\tbh=Bl6tGG0ud/o709iQzZaPttZuxUr7ZQ2CH53ltzTG3e8=;\n\tb=lnDKiCO9dVho5vXPDAClw+qytcnvr+cFWUnFV1KflEIKKid0n8YJWlAsnflKmLeN+o\n\tp0IzOGgZqqK1hymezj6mGFBMHjz6q99Az7x2uWwgHp5HO8JA4i6G8mQeir4D8Jr5pF++\n\trcU31DiMSPaLHT/2+FPD8gFCgl0HIVAx2J9a/DqWaDr+jVjVyhORz37N70w+zpNvxTME\n\tZOVPRGeTbDNYGDXVIn0/JSUXVNjbdIoIjifBOVMc5Tusoo//McyjEk3a5WnpAqN/VBgH\n\t17x4/Hy8Ajm4QWPiTe+sa8p9juUXKNuAtxZ3AGBsoeVc9o/CoijGHFXt+w4s4NMJ90JT\n\t47zw==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:sender:subject:to:cc:references:from:openpgp\n\t:message-id:date:user-agent:mime-version:in-reply-to\n\t:content-language:content-transfer-encoding;\n\tbh=Bl6tGG0ud/o709iQzZaPttZuxUr7ZQ2CH53ltzTG3e8=;\n\tb=btM6aF8jVBCfrGxcfxfbMKyaDCa3j0QDe0vM4DXuqqhc/TTYhLKw5iipDYOLLGBxFF\n\tnUWUX/cyLdTrypGX2Djrl+Hl+kLftLzpa1ODvK9MzBhtP8HxjTjnUCJWi2ulohF/u8jT\n\tyCnr33i8f3DrirNr02ZPpNhfVrpv+KornL9Hz7EBg2GbdPxGS8jxT4Gr0pvbgOut1NBQ\n\tNoUFssNvCAwLCKvl1yKC99OQEK+IwsvEYJFr6e/nRmnND4AIztyJn6yL+7I4RAmf0N22\n\tFybTRpw/iF0ZIpAc+wKnjYRkoZ4gFh3tuEE/5nVJYqGIztv98lu92kapS+dW7PSkuUJv\n\tpHBQ==","X-Gm-Message-State":"AKwxytcEOZV37WrrnBbtIQ9CmFO+tFur9MJzY7+Zk2Py29GNPkT4e3Yx\n\tLrXPfyTZK91OSmzhOnMF98w=","X-Google-Smtp-Source":"ACJfBourW4FPJ2w2eEXom3FRnAMmPI9eXBGQNyfsH8AhsSpqzGJkpLcDdp2YLQPGgBvNJHSxa27c2A==","X-Received":"by 10.55.176.3 with SMTP id z3mr2134257qke.162.1515954164342;\n\tSun, 14 Jan 2018 10:22:44 -0800 (PST)","To":"Paolo Bonzini <pbonzini@redhat.com>,\n\t\"Michael S. Tsirkin\" <mst@redhat.com>, =?utf-8?q?Herv=C3=A9_Poussinea?=\n\t=?utf-8?q?u?= <hpoussin@reactos.org>,\n\tAurelien Jarno <aurelien@aurel32.net>, Eduardo Habkost\n\t<ehabkost@redhat.com>, Marcel Apfelbaum <marcel@redhat.com>","References":"<20180108024558.17983-1-f4bug@amsat.org>\n\t<20180108024558.17983-7-f4bug@amsat.org>","From":"=?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= <f4bug@amsat.org>","Openpgp":"id=FAABE75E12917221DCFD6BB2E3E32C2CDEADC0DE;\n\turl=http://pgp.mit.edu/pks/lookup?op=get&search=0xE3E32C2CDEADC0DE","Message-ID":"<40ab8186-dddc-39cc-2514-077c941d72a6@amsat.org>","Date":"Sun, 14 Jan 2018 15:22:40 -0300","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101\n\tThunderbird/52.5.2","MIME-Version":"1.0","In-Reply-To":"<20180108024558.17983-7-f4bug@amsat.org>","Content-Type":"text/plain; charset=utf-8","Content-Language":"en-US","Content-Transfer-Encoding":"8bit","X-detected-operating-system":"by eggs.gnu.org: Genre and OS details not\n\trecognized.","X-Received-From":"2607:f8b0:400d:c09::22e","Subject":"Re: [Qemu-devel] [PATCH 06/29] hw/isa: add a generic\n\tisa_superio_init()","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Cc":"Igor Mammedov <imammedo@redhat.com>, qemu-devel@nongnu.org","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"}}]