mirror of https://github.com/proxmox/mirror_qemu
vga roms: move loading from pc.c to vga drivers.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>master
parent
de2aff17a3
commit
5245d57a7a
|
@ -32,6 +32,7 @@
|
||||||
#include "console.h"
|
#include "console.h"
|
||||||
#include "vga_int.h"
|
#include "vga_int.h"
|
||||||
#include "kvm.h"
|
#include "kvm.h"
|
||||||
|
#include "loader.h"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* TODO:
|
* TODO:
|
||||||
|
@ -3162,6 +3163,7 @@ void isa_cirrus_vga_init(void)
|
||||||
s->vga.screen_dump, s->vga.text_update,
|
s->vga.screen_dump, s->vga.text_update,
|
||||||
&s->vga);
|
&s->vga);
|
||||||
vmstate_register(0, &vmstate_cirrus_vga, s);
|
vmstate_register(0, &vmstate_cirrus_vga, s);
|
||||||
|
rom_add_vga(VGABIOS_CIRRUS_FILENAME);
|
||||||
/* XXX ISA-LFB support */
|
/* XXX ISA-LFB support */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3245,7 +3247,9 @@ static int pci_cirrus_vga_initfn(PCIDevice *dev)
|
||||||
PCI_ADDRESS_SPACE_MEM, cirrus_pci_mmio_map);
|
PCI_ADDRESS_SPACE_MEM, cirrus_pci_mmio_map);
|
||||||
}
|
}
|
||||||
vmstate_register(0, &vmstate_pci_cirrus_vga, d);
|
vmstate_register(0, &vmstate_pci_cirrus_vga, d);
|
||||||
/* XXX: ROM BIOS */
|
|
||||||
|
/* ROM BIOS */
|
||||||
|
rom_add_vga(VGABIOS_CIRRUS_FILENAME);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
12
hw/pc.c
12
hw/pc.c
|
@ -47,8 +47,6 @@
|
||||||
//#define DEBUG_MULTIBOOT
|
//#define DEBUG_MULTIBOOT
|
||||||
|
|
||||||
#define BIOS_FILENAME "bios.bin"
|
#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)
|
#define PC_MAX_BIOS_SIZE (4 * 1024 * 1024)
|
||||||
|
|
||||||
|
@ -1050,7 +1048,6 @@ static void pc_init1(ram_addr_t ram_size,
|
||||||
IsaIrqState *isa_irq_state;
|
IsaIrqState *isa_irq_state;
|
||||||
DriveInfo *hd[MAX_IDE_BUS * MAX_IDE_DEVS];
|
DriveInfo *hd[MAX_IDE_BUS * MAX_IDE_DEVS];
|
||||||
DriveInfo *fd[MAX_FD];
|
DriveInfo *fd[MAX_FD];
|
||||||
int using_vga = cirrus_vga_enabled || std_vga_enabled || vmsvga_enabled;
|
|
||||||
void *fw_cfg;
|
void *fw_cfg;
|
||||||
|
|
||||||
if (ram_size >= 0xe0000000 ) {
|
if (ram_size >= 0xe0000000 ) {
|
||||||
|
@ -1141,15 +1138,6 @@ static void pc_init1(ram_addr_t ram_size,
|
||||||
option_rom_offset = qemu_ram_alloc(PC_ROM_SIZE);
|
option_rom_offset = qemu_ram_alloc(PC_ROM_SIZE);
|
||||||
cpu_register_physical_memory(PC_ROM_MIN_VGA, PC_ROM_SIZE, option_rom_offset);
|
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 */
|
/* map all the bios at the top of memory */
|
||||||
cpu_register_physical_memory((uint32_t)(-bios_size),
|
cpu_register_physical_memory((uint32_t)(-bios_size),
|
||||||
bios_size, bios_offset | IO_MEM_ROM);
|
bios_size, bios_offset | IO_MEM_ROM);
|
||||||
|
|
|
@ -27,6 +27,7 @@
|
||||||
#include "vga_int.h"
|
#include "vga_int.h"
|
||||||
#include "pixel_ops.h"
|
#include "pixel_ops.h"
|
||||||
#include "qemu-timer.h"
|
#include "qemu-timer.h"
|
||||||
|
#include "loader.h"
|
||||||
|
|
||||||
int isa_vga_init(void)
|
int isa_vga_init(void)
|
||||||
{
|
{
|
||||||
|
@ -46,5 +47,7 @@ int isa_vga_init(void)
|
||||||
cpu_register_physical_memory(VBE_DISPI_LFB_PHYSICAL_ADDRESS,
|
cpu_register_physical_memory(VBE_DISPI_LFB_PHYSICAL_ADDRESS,
|
||||||
VGA_RAM_SIZE, s->vram_offset);
|
VGA_RAM_SIZE, s->vram_offset);
|
||||||
#endif
|
#endif
|
||||||
|
/* ROM BIOS */
|
||||||
|
rom_add_vga(VGABIOS_FILENAME);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,6 +28,7 @@
|
||||||
#include "vga_int.h"
|
#include "vga_int.h"
|
||||||
#include "pixel_ops.h"
|
#include "pixel_ops.h"
|
||||||
#include "qemu-timer.h"
|
#include "qemu-timer.h"
|
||||||
|
#include "loader.h"
|
||||||
|
|
||||||
typedef struct PCIVGAState {
|
typedef struct PCIVGAState {
|
||||||
PCIDevice dev;
|
PCIDevice dev;
|
||||||
|
@ -105,6 +106,9 @@ static int pci_vga_initfn(PCIDevice *dev)
|
||||||
pci_register_bar(&d->dev, PCI_ROM_SLOT, bios_total_size,
|
pci_register_bar(&d->dev, PCI_ROM_SLOT, bios_total_size,
|
||||||
PCI_ADDRESS_SPACE_MEM_PREFETCH, vga_map);
|
PCI_ADDRESS_SPACE_MEM_PREFETCH, vga_map);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* ROM BIOS */
|
||||||
|
rom_add_vga(VGABIOS_FILENAME);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -223,6 +223,8 @@ extern const uint8_t sr_mask[8];
|
||||||
extern const uint8_t gr_mask[16];
|
extern const uint8_t gr_mask[16];
|
||||||
|
|
||||||
#define VGA_RAM_SIZE (8192 * 1024)
|
#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 CPUReadMemoryFunc * const vga_mem_read[3];
|
||||||
extern CPUWriteMemoryFunc * const vga_mem_write[3];
|
extern CPUWriteMemoryFunc * const vga_mem_write[3];
|
||||||
|
|
Loading…
Reference in New Issue