From patchwork Tue Oct 13 11:06:17 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 35842 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 6C67BB7B8D for ; Tue, 13 Oct 2009 22:13:21 +1100 (EST) Received: from localhost ([127.0.0.1]:47158 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MxfJe-0006Hd-FA for incoming@patchwork.ozlabs.org; Tue, 13 Oct 2009 07:13:18 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MxfD5-0003bY-Rf for qemu-devel@nongnu.org; Tue, 13 Oct 2009 07:06:32 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MxfD0-0003ZD-S9 for qemu-devel@nongnu.org; Tue, 13 Oct 2009 07:06:30 -0400 Received: from [199.232.76.173] (port=39482 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MxfD0-0003Z8-Mi for qemu-devel@nongnu.org; Tue, 13 Oct 2009 07:06:26 -0400 Received: from mx1.redhat.com ([209.132.183.28]:59595) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MxfCz-0002g8-Af for qemu-devel@nongnu.org; Tue, 13 Oct 2009 07:06:25 -0400 Received: from int-mx08.intmail.prod.int.phx2.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id n9DB6NA6021928 for ; Tue, 13 Oct 2009 07:06:23 -0400 Received: from zweiblum.home.kraxel.org (vpn1-5-43.ams2.redhat.com [10.36.5.43]) by int-mx08.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with SMTP id n9DB6KgZ023958; Tue, 13 Oct 2009 07:06:21 -0400 Received: by zweiblum.home.kraxel.org (Postfix, from userid 500) id 282C7700E5; Tue, 13 Oct 2009 13:06:19 +0200 (CEST) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Tue, 13 Oct 2009 13:06:17 +0200 Message-Id: <1255431978-4992-4-git-send-email-kraxel@redhat.com> In-Reply-To: <1255431978-4992-1-git-send-email-kraxel@redhat.com> References: <1255431978-4992-1-git-send-email-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.21 X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. Cc: Gerd Hoffmann Subject: [Qemu-devel] [PATCH 3/4] vga roms: move loading from pc.c to vga drivers. X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Signed-off-by: Gerd Hoffmann --- hw/cirrus_vga.c | 6 +++++- hw/pc.c | 12 ------------ hw/vga-isa.c | 3 +++ hw/vga-pci.c | 4 ++++ hw/vga_int.h | 2 ++ 5 files changed, 14 insertions(+), 13 deletions(-) diff --git a/hw/cirrus_vga.c b/hw/cirrus_vga.c index 9dfe76a..f4c9cdf 100644 --- a/hw/cirrus_vga.c +++ b/hw/cirrus_vga.c @@ -32,6 +32,7 @@ #include "console.h" #include "vga_int.h" #include "kvm.h" +#include "loader.h" /* * TODO: @@ -3162,6 +3163,7 @@ void isa_cirrus_vga_init(void) s->vga.screen_dump, s->vga.text_update, &s->vga); vmstate_register(0, &vmstate_cirrus_vga, s); + rom_add_vga(VGABIOS_CIRRUS_FILENAME); /* XXX ISA-LFB support */ } @@ -3245,7 +3247,9 @@ static int pci_cirrus_vga_initfn(PCIDevice *dev) PCI_ADDRESS_SPACE_MEM, cirrus_pci_mmio_map); } vmstate_register(0, &vmstate_pci_cirrus_vga, d); - /* XXX: ROM BIOS */ + + /* ROM BIOS */ + rom_add_vga(VGABIOS_CIRRUS_FILENAME); return 0; } diff --git a/hw/pc.c b/hw/pc.c index 240161a..c4fa3f7 100644 --- a/hw/pc.c +++ b/hw/pc.c @@ -47,8 +47,6 @@ //#define DEBUG_MULTIBOOT #define BIOS_FILENAME "bios.bin" -#define VGABIOS_FILENAME "vgabios.bin" -#define VGABIOS_CIRRUS_FILENAME "vgabios-cirrus.bin" #define PC_MAX_BIOS_SIZE (4 * 1024 * 1024) @@ -1043,7 +1041,6 @@ static void pc_init1(ram_addr_t ram_size, IsaIrqState *isa_irq_state; DriveInfo *hd[MAX_IDE_BUS * MAX_IDE_DEVS]; DriveInfo *fd[MAX_FD]; - int using_vga = cirrus_vga_enabled || std_vga_enabled || vmsvga_enabled; void *fw_cfg; if (ram_size >= 0xe0000000 ) { @@ -1133,15 +1130,6 @@ static void pc_init1(ram_addr_t ram_size, option_rom_offset = qemu_ram_alloc(PC_ROM_SIZE); cpu_register_physical_memory(PC_ROM_MIN_VGA, PC_ROM_SIZE, option_rom_offset); - if (using_vga) { - /* VGA BIOS load */ - if (cirrus_vga_enabled) { - rom_add_vga(VGABIOS_CIRRUS_FILENAME); - } else { - rom_add_vga(VGABIOS_FILENAME); - } - } - /* map all the bios at the top of memory */ cpu_register_physical_memory((uint32_t)(-bios_size), bios_size, bios_offset | IO_MEM_ROM); diff --git a/hw/vga-isa.c b/hw/vga-isa.c index 7fa31d3..6b387af 100644 --- a/hw/vga-isa.c +++ b/hw/vga-isa.c @@ -27,6 +27,7 @@ #include "vga_int.h" #include "pixel_ops.h" #include "qemu-timer.h" +#include "loader.h" int isa_vga_init(void) { @@ -46,5 +47,7 @@ int isa_vga_init(void) cpu_register_physical_memory(VBE_DISPI_LFB_PHYSICAL_ADDRESS, VGA_RAM_SIZE, s->vram_offset); #endif + /* ROM BIOS */ + rom_add_vga(VGABIOS_FILENAME); return 0; } diff --git a/hw/vga-pci.c b/hw/vga-pci.c index 5e75938..b5fd666 100644 --- a/hw/vga-pci.c +++ b/hw/vga-pci.c @@ -28,6 +28,7 @@ #include "vga_int.h" #include "pixel_ops.h" #include "qemu-timer.h" +#include "loader.h" typedef struct PCIVGAState { PCIDevice dev; @@ -117,6 +118,9 @@ static int pci_vga_initfn(PCIDevice *dev) pci_register_bar(&d->dev, PCI_ROM_SLOT, bios_total_size, PCI_ADDRESS_SPACE_MEM_PREFETCH, vga_map); } + + /* ROM BIOS */ + rom_add_vga(VGABIOS_FILENAME); return 0; } diff --git a/hw/vga_int.h b/hw/vga_int.h index c162c07..b843e52 100644 --- a/hw/vga_int.h +++ b/hw/vga_int.h @@ -220,6 +220,8 @@ extern const uint8_t sr_mask[8]; extern const uint8_t gr_mask[16]; #define VGA_RAM_SIZE (8192 * 1024) +#define VGABIOS_FILENAME "vgabios.bin" +#define VGABIOS_CIRRUS_FILENAME "vgabios-cirrus.bin" extern CPUReadMemoryFunc * const vga_mem_read[3]; extern CPUWriteMemoryFunc * const vga_mem_write[3];