Commit 89b6b508929d63b2a3dda18692fcb724afb43336

Authored by bellard
1 parent d2269f6f

vga init changes


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2114 c046a42c-6fe2-441c-8c8c-71466251a162
hw/mips_r4k.c
@@ -270,8 +270,8 @@ void mips_r4k_init (int ram_size, int vga_ram_size, int boot_device, @@ -270,8 +270,8 @@ void mips_r4k_init (int ram_size, int vga_ram_size, int boot_device,
270 isa_pic = pic_init(pic_irq_request, env); 270 isa_pic = pic_init(pic_irq_request, env);
271 pit = pit_init(0x40, 0); 271 pit = pit_init(0x40, 0);
272 serial_init(&pic_set_irq_new, isa_pic, 0x3f8, 4, serial_hds[0]); 272 serial_init(&pic_set_irq_new, isa_pic, 0x3f8, 4, serial_hds[0]);
273 - vga_initialize(NULL, ds, phys_ram_base + ram_size, ram_size,  
274 - vga_ram_size, 0, 0); 273 + isa_vga_init(ds, phys_ram_base + ram_size, ram_size,
  274 + vga_ram_size);
275 275
276 if (nd_table[0].vlan) { 276 if (nd_table[0].vlan) {
277 if (nd_table[0].model == NULL 277 if (nd_table[0].model == NULL
@@ -768,8 +768,13 @@ static void pc_init1(int ram_size, int vga_ram_size, int boot_device, @@ -768,8 +768,13 @@ static void pc_init1(int ram_size, int vga_ram_size, int boot_device,
768 vga_ram_size); 768 vga_ram_size);
769 } 769 }
770 } else { 770 } else {
771 - vga_initialize(pci_bus, ds, phys_ram_base + ram_size, ram_size,  
772 - vga_ram_size, 0, 0); 771 + if (pci_enabled) {
  772 + pci_vga_init(pci_bus, ds, phys_ram_base + ram_size, ram_size,
  773 + vga_ram_size, 0, 0);
  774 + } else {
  775 + isa_vga_init(ds, phys_ram_base + ram_size, ram_size,
  776 + vga_ram_size);
  777 + }
773 } 778 }
774 779
775 rtc_state = rtc_init(0x70, 8); 780 rtc_state = rtc_init(0x70, 8);
hw/ppc_chrp.c
@@ -424,9 +424,9 @@ static void ppc_chrp_init(int ram_size, int vga_ram_size, int boot_device, @@ -424,9 +424,9 @@ static void ppc_chrp_init(int ram_size, int vga_ram_size, int boot_device,
424 pic = heathrow_pic_init(&heathrow_pic_mem_index); 424 pic = heathrow_pic_init(&heathrow_pic_mem_index);
425 set_irq = heathrow_pic_set_irq; 425 set_irq = heathrow_pic_set_irq;
426 pci_bus = pci_grackle_init(0xfec00000, pic); 426 pci_bus = pci_grackle_init(0xfec00000, pic);
427 - vga_initialize(pci_bus, ds, phys_ram_base + ram_size,  
428 - ram_size, vga_ram_size,  
429 - vga_bios_offset, vga_bios_size); 427 + pci_vga_init(pci_bus, ds, phys_ram_base + ram_size,
  428 + ram_size, vga_ram_size,
  429 + vga_bios_offset, vga_bios_size);
430 430
431 /* XXX: suppress that */ 431 /* XXX: suppress that */
432 isa_pic = pic_init(pic_irq_request, NULL); 432 isa_pic = pic_init(pic_irq_request, NULL);
@@ -474,9 +474,9 @@ static void ppc_chrp_init(int ram_size, int vga_ram_size, int boot_device, @@ -474,9 +474,9 @@ static void ppc_chrp_init(int ram_size, int vga_ram_size, int boot_device,
474 set_irq = openpic_set_irq; 474 set_irq = openpic_set_irq;
475 pci_bus = pci_pmac_init(pic); 475 pci_bus = pci_pmac_init(pic);
476 /* init basic PC hardware */ 476 /* init basic PC hardware */
477 - vga_initialize(pci_bus, ds, phys_ram_base + ram_size,  
478 - ram_size, vga_ram_size,  
479 - vga_bios_offset, vga_bios_size); 477 + pci_vga_init(pci_bus, ds, phys_ram_base + ram_size,
  478 + ram_size, vga_ram_size,
  479 + vga_bios_offset, vga_bios_size);
480 480
481 /* XXX: suppress that */ 481 /* XXX: suppress that */
482 isa_pic = pic_init(pic_irq_request, NULL); 482 isa_pic = pic_init(pic_irq_request, NULL);
hw/ppc_prep.c
@@ -612,8 +612,8 @@ static void ppc_prep_init(int ram_size, int vga_ram_size, int boot_device, @@ -612,8 +612,8 @@ static void ppc_prep_init(int ram_size, int vga_ram_size, int boot_device,
612 cpu_register_physical_memory(0x80000000, 0x00800000, PPC_io_memory); 612 cpu_register_physical_memory(0x80000000, 0x00800000, PPC_io_memory);
613 613
614 /* init basic PC hardware */ 614 /* init basic PC hardware */
615 - vga_initialize(pci_bus, ds, phys_ram_base + ram_size, ram_size,  
616 - vga_ram_size, 0, 0); 615 + pci_vga_init(pci_bus, ds, phys_ram_base + ram_size, ram_size,
  616 + vga_ram_size, 0, 0);
617 rtc_init(0x70, 8); 617 rtc_init(0x70, 8);
618 // openpic = openpic_init(0x00000000, 0xF0000000, 1); 618 // openpic = openpic_init(0x00000000, 0xF0000000, 1);
619 isa_pic = pic_init(pic_irq_request, first_cpu); 619 isa_pic = pic_init(pic_irq_request, first_cpu);
@@ -744,8 +744,8 @@ uint32_t pci_default_read_config(PCIDevice *d, @@ -744,8 +744,8 @@ uint32_t pci_default_read_config(PCIDevice *d,
744 uint32_t address, int len); 744 uint32_t address, int len);
745 void pci_default_write_config(PCIDevice *d, 745 void pci_default_write_config(PCIDevice *d,
746 uint32_t address, uint32_t val, int len); 746 uint32_t address, uint32_t val, int len);
747 -void generic_pci_save(QEMUFile* f, void *opaque);  
748 -int generic_pci_load(QEMUFile* f, void *opaque, int version_id); 747 +void pci_device_save(PCIDevice *s, QEMUFile *f);
  748 +int pci_device_load(PCIDevice *s, QEMUFile *f);
749 749
750 typedef void (*pci_set_irq_fn)(PCIDevice *pci_dev, void *pic, 750 typedef void (*pci_set_irq_fn)(PCIDevice *pci_dev, void *pic,
751 int irq_num, int level); 751 int irq_num, int level);
@@ -834,9 +834,11 @@ static inline void dpy_resize(DisplayState *s, int w, int h) @@ -834,9 +834,11 @@ static inline void dpy_resize(DisplayState *s, int w, int h)
834 s->dpy_resize(s, w, h); 834 s->dpy_resize(s, w, h);
835 } 835 }
836 836
837 -int vga_initialize(PCIBus *bus, DisplayState *ds, uint8_t *vga_ram_base,  
838 - unsigned long vga_ram_offset, int vga_ram_size,  
839 - unsigned long vga_bios_offset, int vga_bios_size); 837 +int isa_vga_init(DisplayState *ds, uint8_t *vga_ram_base,
  838 + unsigned long vga_ram_offset, int vga_ram_size);
  839 +int pci_vga_init(PCIBus *bus, DisplayState *ds, uint8_t *vga_ram_base,
  840 + unsigned long vga_ram_offset, int vga_ram_size,
  841 + unsigned long vga_bios_offset, int vga_bios_size);
840 842
841 /* cirrus_vga.c */ 843 /* cirrus_vga.c */
842 void pci_cirrus_vga_init(PCIBus *bus, DisplayState *ds, uint8_t *vga_ram_base, 844 void pci_cirrus_vga_init(PCIBus *bus, DisplayState *ds, uint8_t *vga_ram_base,