mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-06 01:03:55 -06:00
vga: drop get_system_memory() from vga devices and derivatives
Instead, use the bus accessors, or get the address space directly from the board constructor. Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
This commit is contained in:
parent
f5e6fed879
commit
be20f9e902
11 changed files with 37 additions and 34 deletions
|
@ -27,7 +27,6 @@
|
|||
#include "vga_int.h"
|
||||
#include "pixel_ops.h"
|
||||
#include "qemu-timer.h"
|
||||
#include "exec-memory.h"
|
||||
|
||||
typedef struct ISAVGAMMState {
|
||||
VGACommonState vga;
|
||||
|
@ -97,7 +96,8 @@ static const MemoryRegionOps vga_mm_ctrl_ops = {
|
|||
};
|
||||
|
||||
static void vga_mm_init(ISAVGAMMState *s, target_phys_addr_t vram_base,
|
||||
target_phys_addr_t ctrl_base, int it_shift)
|
||||
target_phys_addr_t ctrl_base, int it_shift,
|
||||
MemoryRegion *address_space)
|
||||
{
|
||||
MemoryRegion *s_ioport_ctrl, *vga_io_memory;
|
||||
|
||||
|
@ -113,26 +113,27 @@ static void vga_mm_init(ISAVGAMMState *s, target_phys_addr_t vram_base,
|
|||
|
||||
vmstate_register(NULL, 0, &vmstate_vga_common, s);
|
||||
|
||||
memory_region_add_subregion(get_system_memory(), ctrl_base, s_ioport_ctrl);
|
||||
memory_region_add_subregion(address_space, ctrl_base, s_ioport_ctrl);
|
||||
s->vga.bank_offset = 0;
|
||||
memory_region_add_subregion(get_system_memory(),
|
||||
memory_region_add_subregion(address_space,
|
||||
vram_base + 0x000a0000, vga_io_memory);
|
||||
memory_region_set_coalescing(vga_io_memory);
|
||||
}
|
||||
|
||||
int isa_vga_mm_init(target_phys_addr_t vram_base,
|
||||
target_phys_addr_t ctrl_base, int it_shift)
|
||||
target_phys_addr_t ctrl_base, int it_shift,
|
||||
MemoryRegion *address_space)
|
||||
{
|
||||
ISAVGAMMState *s;
|
||||
|
||||
s = g_malloc0(sizeof(*s));
|
||||
|
||||
vga_common_init(&s->vga, VGA_RAM_SIZE);
|
||||
vga_mm_init(s, vram_base, ctrl_base, it_shift);
|
||||
vga_mm_init(s, vram_base, ctrl_base, it_shift, address_space);
|
||||
|
||||
s->vga.ds = graphic_console_init(s->vga.update, s->vga.invalidate,
|
||||
s->vga.screen_dump, s->vga.text_update, s);
|
||||
|
||||
vga_init_vbe(&s->vga);
|
||||
vga_init_vbe(&s->vga, address_space);
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue