char device support
[qemu] / hw / vga.c
index 57bad8f..2a0a9c3 100644 (file)
--- a/hw/vga.c
+++ b/hw/vga.c
@@ -190,6 +190,9 @@ static uint32_t vga_ioport_read(void *opaque, uint32_t addr)
         case 0x3c7:
             val = s->dac_state;
             break;
+       case 0x3c8:
+           val = s->dac_write_index;
+           break;
         case 0x3c9:
             val = s->palette[s->dac_read_index * 3 + s->dac_sub_index];
             if (++s->dac_sub_index == 3) {
@@ -1747,9 +1750,8 @@ void vga_common_init(VGAState *s, DisplayState *ds, uint8_t *vga_ram_base,
 }
 
 
-int vga_initialize(DisplayState *ds, uint8_t *vga_ram_base, 
-                   unsigned long vga_ram_offset, int vga_ram_size, 
-                   int is_pci)
+int vga_initialize(PCIBus *bus, DisplayState *ds, uint8_t *vga_ram_base, 
+                   unsigned long vga_ram_offset, int vga_ram_size)
 {
     VGAState *s;
 
@@ -1805,14 +1807,13 @@ int vga_initialize(DisplayState *ds, uint8_t *vga_ram_base,
     cpu_register_physical_memory(isa_mem_base + 0x000a0000, 0x20000, 
                                  vga_io_memory);
 
-    if (is_pci) {
+    if (bus) {
         PCIDevice *d;
         uint8_t *pci_conf;
 
-        d = pci_register_device("VGA", 
+        d = pci_register_device(bus, "VGA", 
                                 sizeof(PCIDevice),
-                                0, -1, 
-                                NULL, NULL);
+                                -1, NULL, NULL);
         pci_conf = d->config;
         pci_conf[0x00] = 0x34; // dummy VGA (same as Bochs ID)
         pci_conf[0x01] = 0x12;