Revision 7b17d41e

b/hw/vga.c
147 147
static uint16_t expand2[256];
148 148
static uint8_t expand4to8[16];
149 149

  
150
VGAState vga_state;
150
VGAState *vga_state;
151 151
int vga_io_memory;
152 152

  
153 153
static uint32_t vga_ioport_read(void *opaque, uint32_t addr)
......
1507 1507

  
1508 1508
void vga_update_display(void)
1509 1509
{
1510
    VGAState *s = &vga_state;
1510
    VGAState *s = vga_state;
1511 1511
    int full_update, graphic_mode;
1512 1512

  
1513 1513
    if (s->ds->depth == 0) {
......
1674 1674
static void vga_map(PCIDevice *pci_dev, int region_num, 
1675 1675
                    uint32_t addr, uint32_t size, int type)
1676 1676
{
1677
    VGAState *s = &vga_state;
1677
    VGAState *s = vga_state;
1678 1678

  
1679 1679
    cpu_register_physical_memory(addr, s->vram_size, s->vram_offset);
1680 1680
}
......
1715 1715
    s->ds = ds;
1716 1716
    s->get_bpp = vga_get_bpp;
1717 1717
    s->get_offsets = vga_get_offsets;
1718
    /* XXX: currently needed for display */
1719
    vga_state = s;
1718 1720
}
1719 1721

  
1720 1722

  
......
1722 1724
                   unsigned long vga_ram_offset, int vga_ram_size, 
1723 1725
                   int is_pci)
1724 1726
{
1725
    VGAState *s = &vga_state;
1727
    VGAState *s;
1728

  
1729
    s = qemu_mallocz(sizeof(VGAState));
1730
    if (!s)
1731
        return -1;
1726 1732

  
1727 1733
    vga_common_init(s, ds, vga_ram_base, vga_ram_offset, vga_ram_size);
1728 1734

  
......
1857 1863
   available */
1858 1864
void vga_screen_dump(const char *filename)
1859 1865
{
1860
    VGAState *s = &vga_state;
1866
    VGAState *s = vga_state;
1861 1867
    DisplayState *saved_ds, ds1, *ds = &ds1;
1862 1868
    
1863 1869
    /* XXX: this is a little hackish */

Also available in: Unified diff