From 5991cbe99b2faf035522ec4910524421a34d9f14 Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Fri, 17 May 2019 06:51:16 +0200 Subject: [PATCH 49/53] pc_sysfw: Pass PCMachineState to pc_system_firmware_init() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit RH-Author: Markus Armbruster Message-id: <20190517065120.12028-28-armbru@redhat.com> Patchwork-id: 87988 O-Subject: [RHEL-7.7 qemu-kvm-rhev PATCH v3 27/31] pc_sysfw: Pass PCMachineState to pc_system_firmware_init() Bugzilla: 1624009 RH-Acked-by: Philippe Mathieu-Daudé RH-Acked-by: Thomas Huth RH-Acked-by: Miroslav Rezanina 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 Message-Id: <20190308131445.17502-11-armbru@redhat.com> Reviewed-by: Michael S. Tsirkin (cherry picked from commit 5e640a9e78ea61c50401a2b11fa144b5f0c217dc) Signed-off-by: Miroslav Rezanina --- 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 7160969..86e9d43 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -1413,7 +1413,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 d40d727..2a0e18c 100644 --- a/hw/i386/pc_sysfw.c +++ b/hw/i386/pc_sysfw.c @@ -240,8 +240,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 1e9f252..611e111 100644 --- a/include/hw/i386/pc.h +++ b/include/hw/i386/pc.h @@ -290,8 +290,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, -- 1.8.3.1