From patchwork Fri Mar 8 13:14:43 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Markus Armbruster X-Patchwork-Id: 10844815 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1C8C01390 for ; Fri, 8 Mar 2019 13:37:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 06DFF2E40A for ; Fri, 8 Mar 2019 13:37:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EEA632E466; Fri, 8 Mar 2019 13:37:28 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 9964D2E40A for ; Fri, 8 Mar 2019 13:37:28 +0000 (UTC) Received: from localhost ([127.0.0.1]:43518 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h2Fgl-0006nG-Tf for patchwork-qemu-devel@patchwork.kernel.org; Fri, 08 Mar 2019 08:37:27 -0500 Received: from eggs.gnu.org ([209.51.188.92]:36489) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h2FLF-0004yK-UN for qemu-devel@nongnu.org; Fri, 08 Mar 2019 08:15:14 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h2FLE-0007NX-2E for qemu-devel@nongnu.org; Fri, 08 Mar 2019 08:15:12 -0500 Received: from mx1.redhat.com ([209.132.183.28]:51314) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1h2FLA-0006gG-2L; Fri, 08 Mar 2019 08:15:08 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 3205D3082134; Fri, 8 Mar 2019 13:15:04 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-116-92.ams2.redhat.com [10.36.116.92]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C3B6C60BE7; Fri, 8 Mar 2019 13:14:55 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 153E41132D3C; Fri, 8 Mar 2019 14:14:46 +0100 (CET) From: Markus Armbruster To: qemu-devel@nongnu.org Date: Fri, 8 Mar 2019 14:14:43 +0100 Message-Id: <20190308131445.17502-11-armbru@redhat.com> In-Reply-To: <20190308131445.17502-1-armbru@redhat.com> References: <20190308131445.17502-1-armbru@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.42]); Fri, 08 Mar 2019 13:15:04 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v3 10/12] pc_sysfw: Pass PCMachineState to pc_system_firmware_init() 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: kwolf@redhat.com, pkrempa@redhat.com, qemu-block@nongnu.org, mst@redhat.com, philmd@redhat.com, mreitz@redhat.com, marcandre.lureau@redhat.com, pbonzini@redhat.com, lersek@redhat.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Philippe Mathieu-Daudé pc_system_firmware_init() parameter @isapc_ram_fw is PCMachineState member pci_enabled negated. The next commit will need more of PCMachineState. To prepare for that, pass a PCMachineState *, and drop the now redundant parameter @isapc_ram_fw. Signed-off-by: Markus Armbruster Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Laszlo Ersek --- hw/i386/pc.c | 2 +- hw/i386/pc_sysfw.c | 5 ++++- include/hw/i386/pc.h | 3 +-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/hw/i386/pc.c b/hw/i386/pc.c index 42128183e9..b2947e433b 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -1803,7 +1803,7 @@ void pc_memory_init(PCMachineState *pcms, } /* Initialize PC system firmware */ - pc_system_firmware_init(rom_memory, !pcmc->pci_enabled); + pc_system_firmware_init(pcms, rom_memory); option_rom_mr = g_malloc(sizeof(*option_rom_mr)); memory_region_init_ram(option_rom_mr, NULL, "pc.rom", PC_ROM_SIZE, diff --git a/hw/i386/pc_sysfw.c b/hw/i386/pc_sysfw.c index 46b87afe23..785123252c 100644 --- a/hw/i386/pc_sysfw.c +++ b/hw/i386/pc_sysfw.c @@ -231,8 +231,11 @@ static void old_pc_system_rom_init(MemoryRegion *rom_memory, bool isapc_ram_fw) bios); } -void pc_system_firmware_init(MemoryRegion *rom_memory, bool isapc_ram_fw) +void pc_system_firmware_init(PCMachineState *pcms, + MemoryRegion *rom_memory) { + PCMachineClass *pcmc = PC_MACHINE_GET_CLASS(pcms); + bool isapc_ram_fw = !pcmc->pci_enabled; DriveInfo *pflash_drv; pflash_drv = drive_get(IF_PFLASH, 0, 0); diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h index 54222a202d..4f5ed7cefc 100644 --- a/include/hw/i386/pc.h +++ b/include/hw/i386/pc.h @@ -277,8 +277,7 @@ extern PCIDevice *piix4_dev; int piix4_init(PCIBus *bus, ISABus **isa_bus, int devfn); /* pc_sysfw.c */ -void pc_system_firmware_init(MemoryRegion *rom_memory, - bool isapc_ram_fw); +void pc_system_firmware_init(PCMachineState *pcms, MemoryRegion *rom_memory); /* acpi-build.c */ void pc_madt_cpu_entry(AcpiDeviceIf *adev, int uid,