qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH 3/9] Support pci=... in option argument of -vga


From: Markus Armbruster
Subject: [Qemu-devel] [PATCH 3/9] Support pci=... in option argument of -vga
Date: Thu, 22 Jan 2009 20:30:59 +0100

From: Markus Armbruster <address@hidden>

---
 hw/cirrus_vga.c   |    6 +++---
 hw/mips_malta.c   |    2 +-
 hw/pc.c           |    7 +++----
 hw/pc.h           |    4 ++--
 hw/pci.h          |    2 +-
 hw/ppc_chrp.c     |    2 +-
 hw/ppc_oldworld.c |    2 +-
 hw/ppc_prep.c     |    2 +-
 hw/sun4u.c        |    2 +-
 hw/vga.c          |    6 +++---
 hw/vmware_vga.c   |    7 ++++---
 11 files changed, 21 insertions(+), 21 deletions(-)

diff --git a/hw/cirrus_vga.c b/hw/cirrus_vga.c
index ef939ae..e8d2857 100644
--- a/hw/cirrus_vga.c
+++ b/hw/cirrus_vga.c
@@ -3339,7 +3339,7 @@ static void cirrus_pci_mmio_map(PCIDevice *d, int 
region_num,
                                 s->cirrus_mmio_io_addr);
 }
 
-void pci_cirrus_vga_init(PCIBus *bus, uint8_t *vga_ram_base,
+void pci_cirrus_vga_init(uint8_t *vga_ram_base,
                          ram_addr_t vga_ram_offset, int vga_ram_size)
 {
     PCICirrusVGAState *d;
@@ -3350,9 +3350,9 @@ void pci_cirrus_vga_init(PCIBus *bus, uint8_t 
*vga_ram_base,
     device_id = CIRRUS_ID_CLGD5446;
 
     /* setup PCI configuration registers */
-    d = (PCICirrusVGAState *)pci_register_device(bus, "Cirrus VGA",
+    d = (PCICirrusVGAState *)pci_register_device_2("Cirrus VGA", vga_opts,
                                                  sizeof(PCICirrusVGAState),
-                                                 -1, NULL, NULL);
+                                                 NULL, NULL);
     pci_conf = d->dev.config;
     pci_conf[0x00] = (uint8_t) (PCI_VENDOR_CIRRUS & 0xff);
     pci_conf[0x01] = (uint8_t) (PCI_VENDOR_CIRRUS >> 8);
diff --git a/hw/mips_malta.c b/hw/mips_malta.c
index 9a41cdf..466c303 100644
--- a/hw/mips_malta.c
+++ b/hw/mips_malta.c
@@ -935,7 +935,7 @@ void mips_malta_init (ram_addr_t ram_size, int vga_ram_size,
     network_init(pci_bus);
 
     /* Optional PCI video card */
-    pci_cirrus_vga_init(pci_bus, phys_ram_base + ram_size,
+    pci_cirrus_vga_init(phys_ram_base + ram_size,
                         ram_size, vga_ram_size);
 }
 
diff --git a/hw/pc.c b/hw/pc.c
index dd5fb8f..75b7374 100644
--- a/hw/pc.c
+++ b/hw/pc.c
@@ -945,8 +945,7 @@ vga_bios_error:
 
     if (cirrus_vga_enabled) {
         if (pci_enabled) {
-            pci_cirrus_vga_init(pci_bus,
-                                phys_ram_base + vga_ram_addr,
+            pci_cirrus_vga_init(phys_ram_base + vga_ram_addr,
                                 vga_ram_addr, vga_ram_size);
         } else {
             isa_cirrus_vga_init(phys_ram_base + vga_ram_addr,
@@ -954,13 +953,13 @@ vga_bios_error:
         }
     } else if (vmsvga_enabled) {
         if (pci_enabled)
-            pci_vmsvga_init(pci_bus, phys_ram_base + vga_ram_addr,
+            pci_vmsvga_init(phys_ram_base + vga_ram_addr,
                             vga_ram_addr, vga_ram_size);
         else
             fprintf(stderr, "%s: vmware_vga: no PCI bus\n", __FUNCTION__);
     } else if (std_vga_enabled) {
         if (pci_enabled) {
-            pci_vga_init(pci_bus, phys_ram_base + vga_ram_addr,
+            pci_vga_init(phys_ram_base + vga_ram_addr,
                          vga_ram_addr, vga_ram_size, 0, 0);
         } else {
             isa_vga_init(phys_ram_base + vga_ram_addr,
diff --git a/hw/pc.h b/hw/pc.h
index f43c138..827e8ba 100644
--- a/hw/pc.h
+++ b/hw/pc.h
@@ -129,7 +129,7 @@ extern const char *vga_opts;
 
 int isa_vga_init(uint8_t *vga_ram_base,
                  unsigned long vga_ram_offset, int vga_ram_size);
-int pci_vga_init(PCIBus *bus, uint8_t *vga_ram_base,
+int pci_vga_init(uint8_t *vga_ram_base,
                  unsigned long vga_ram_offset, int vga_ram_size,
                  unsigned long vga_bios_offset, int vga_bios_size);
 int isa_vga_mm_init(uint8_t *vga_ram_base,
@@ -138,7 +138,7 @@ int isa_vga_mm_init(uint8_t *vga_ram_base,
                     int it_shift);
 
 /* cirrus_vga.c */
-void pci_cirrus_vga_init(PCIBus *bus, uint8_t *vga_ram_base,
+void pci_cirrus_vga_init(uint8_t *vga_ram_base,
                          ram_addr_t vga_ram_offset, int vga_ram_size);
 void isa_cirrus_vga_init(uint8_t *vga_ram_base,
                          ram_addr_t vga_ram_offset, int vga_ram_size);
diff --git a/hw/pci.h b/hw/pci.h
index 1528fc2..fe72881 100644
--- a/hw/pci.h
+++ b/hw/pci.h
@@ -141,7 +141,7 @@ void lsi_scsi_attach(void *opaque, BlockDriverState *bd, 
int id);
 void *lsi_scsi_init(PCIBus *bus, int devfn);
 
 /* vmware_vga.c */
-void pci_vmsvga_init(PCIBus *bus, uint8_t *vga_ram_base,
+void pci_vmsvga_init(uint8_t *vga_ram_base,
                      unsigned long vga_ram_offset, int vga_ram_size);
 
 /* usb-uhci.c */
diff --git a/hw/ppc_chrp.c b/hw/ppc_chrp.c
index 64a613c..c15c4ae 100644
--- a/hw/ppc_chrp.c
+++ b/hw/ppc_chrp.c
@@ -256,7 +256,7 @@ static void ppc_core99_init (ram_addr_t ram_size, int 
vga_ram_size,
     pic = openpic_init(NULL, &pic_mem_index, smp_cpus, openpic_irqs, NULL);
     pci_bus = pci_pmac_init(pic);
     /* init basic PC hardware */
-    pci_vga_init(pci_bus, phys_ram_base + ram_size,
+    pci_vga_init(phys_ram_base + ram_size,
                  ram_size, vga_ram_size,
                  vga_bios_offset, vga_bios_size);
 
diff --git a/hw/ppc_oldworld.c b/hw/ppc_oldworld.c
index f60b174..882a523 100644
--- a/hw/ppc_oldworld.c
+++ b/hw/ppc_oldworld.c
@@ -296,7 +296,7 @@ static void ppc_heathrow_init (ram_addr_t ram_size, int 
vga_ram_size,
     }
     pic = heathrow_pic_init(&pic_mem_index, 1, heathrow_irqs);
     pci_bus = pci_grackle_init(0xfec00000, pic);
-    pci_vga_init(pci_bus, phys_ram_base + vga_ram_offset,
+    pci_vga_init(phys_ram_base + vga_ram_offset,
                  vga_ram_offset, vga_ram_size,
                  vga_bios_offset, vga_bios_size);
 
diff --git a/hw/ppc_prep.c b/hw/ppc_prep.c
index 934d520..bb692e3 100644
--- a/hw/ppc_prep.c
+++ b/hw/ppc_prep.c
@@ -655,7 +655,7 @@ static void ppc_prep_init (ram_addr_t ram_size, int 
vga_ram_size,
     cpu_register_physical_memory(0x80000000, 0x00800000, PPC_io_memory);
 
     /* init basic PC hardware */
-    pci_vga_init(pci_bus, phys_ram_base + ram_size, ram_size,
+    pci_vga_init(phys_ram_base + ram_size, ram_size,
                  vga_ram_size, 0, 0);
     //    openpic = openpic_init(0x00000000, 0xF0000000, 1);
     //    pit = pit_init(0x40, i8259[0]);
diff --git a/hw/sun4u.c b/hw/sun4u.c
index 59aee1b..5d209fb 100644
--- a/hw/sun4u.c
+++ b/hw/sun4u.c
@@ -508,7 +508,7 @@ static void sun4uv_init(ram_addr_t RAM_size, int 
vga_ram_size,
                            &pci_bus3);
     isa_mem_base = VGA_BASE;
     vga_ram_offset = qemu_ram_alloc(vga_ram_size);
-    pci_vga_init(pci_bus, phys_ram_base + vga_ram_offset,
+    pci_vga_init(phys_ram_base + vga_ram_offset,
                  vga_ram_offset, vga_ram_size,
                  0, 0);
 
diff --git a/hw/vga.c b/hw/vga.c
index 164e652..16ee247 100644
--- a/hw/vga.c
+++ b/hw/vga.c
@@ -2481,7 +2481,7 @@ int isa_vga_mm_init(uint8_t *vga_ram_base,
     return 0;
 }
 
-int pci_vga_init(PCIBus *bus, uint8_t *vga_ram_base,
+int pci_vga_init(uint8_t *vga_ram_base,
                  unsigned long vga_ram_offset, int vga_ram_size,
                  unsigned long vga_bios_offset, int vga_bios_size)
 {
@@ -2489,9 +2489,9 @@ int pci_vga_init(PCIBus *bus, uint8_t *vga_ram_base,
     VGAState *s;
     uint8_t *pci_conf;
 
-    d = (PCIVGAState *)pci_register_device(bus, "VGA",
+    d = (PCIVGAState *)pci_register_device_2("VGA", vga_opts,
                                            sizeof(PCIVGAState),
-                                           -1, NULL, NULL);
+                                           NULL, NULL);
     if (!d)
         return -1;
     s = &d->vga_state;
diff --git a/hw/vmware_vga.c b/hw/vmware_vga.c
index 950a98c..9a5380f 100644
--- a/hw/vmware_vga.c
+++ b/hw/vmware_vga.c
@@ -24,6 +24,7 @@
 #include "hw.h"
 #include "console.h"
 #include "pci.h"
+#include "pc.h"
 
 #define VERBOSE
 #define EMBED_STDVGA
@@ -1214,15 +1215,15 @@ static void pci_vmsvga_map_mem(PCIDevice *pci_dev, int 
region_num,
 #define PCI_CLASS_SUB_VGA              0x00
 #define PCI_CLASS_HEADERTYPE_00h       0x00
 
-void pci_vmsvga_init(PCIBus *bus, uint8_t *vga_ram_base,
+void pci_vmsvga_init(uint8_t *vga_ram_base,
                      unsigned long vga_ram_offset, int vga_ram_size)
 {
     struct pci_vmsvga_state_s *s;
 
     /* Setup PCI configuration */
     s = (struct pci_vmsvga_state_s *)
-        pci_register_device(bus, "QEMUware SVGA",
-                sizeof(struct pci_vmsvga_state_s), -1, 0, 0);
+        pci_register_device_2("QEMUware SVGA", vga_opts,
+                sizeof(struct pci_vmsvga_state_s), 0, 0);
     s->card.config[PCI_VENDOR_ID]      = PCI_VENDOR_ID_VMWARE & 0xff;
     s->card.config[PCI_VENDOR_ID + 1]  = PCI_VENDOR_ID_VMWARE >> 8;
     s->card.config[PCI_DEVICE_ID]      = SVGA_PCI_DEVICE_ID & 0xff;
-- 
1.6.0.6





reply via email to

[Prev in Thread] Current Thread [Next in Thread]