qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Markus Armbruster <armbru@redhat.com>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH 3/9] Support pci=... in option argument of -vga
Date: Thu, 22 Jan 2009 20:30:59 +0100	[thread overview]
Message-ID: <1232652665-1710-3-git-send-email-armbru@redhat.com> (raw)
In-Reply-To: <87ocxzrvqb.fsf@pike.pond.sub.org>

From: Markus Armbruster <armbru@pond.sub.org>

---
 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

  parent reply	other threads:[~2009-01-22 19:31 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-22 19:23 [Qemu-devel] [RFC PATCH 0/9] Configurable PCI device addresses Markus Armbruster
2009-01-22 19:30 ` [Qemu-devel] [PATCH 1/9] PCI device registration helpers Markus Armbruster
2009-01-22 19:30 ` [Qemu-devel] [PATCH 2/9] Clean up handling of name=value, ... part of -vga option argument Markus Armbruster
2009-01-22 19:30 ` Markus Armbruster [this message]
2009-01-22 19:31 ` [Qemu-devel] [PATCH 4/9] Convert virtio_init_pci() to pci_register_device_2() Markus Armbruster
2009-01-22 19:31 ` [Qemu-devel] [PATCH 5/9] Support pci=... in option argument of -net nic Markus Armbruster
2009-01-22 19:31 ` [Qemu-devel] [PATCH 6/9] Make drives_opt[] accessible from device initialization Markus Armbruster
2009-01-22 19:31 ` [Qemu-devel] [PATCH 7/9] Support pci=... in option argument of -drive if=virtio Markus Armbruster
2009-01-22 19:31 ` [Qemu-devel] [PATCH 8/9] New option -audio as a more flexible alternative to -soundhw Markus Armbruster
2009-01-22 22:03   ` malc
2009-01-23  8:32     ` Markus Armbruster
2009-01-23  9:29       ` Kevin Wolf
2009-01-23 10:04         ` Markus Armbruster
2009-01-23 10:24           ` Kevin Wolf
2009-01-23 11:51             ` Markus Armbruster
2009-01-22 19:31 ` [Qemu-devel] [PATCH 9/9] Support pci=... in option argument of -audio Markus Armbruster
2009-01-22 20:06 ` [Qemu-devel] [RFC PATCH 0/9] Configurable PCI device addresses Anthony Liguori
2009-01-23  9:04   ` Markus Armbruster
2009-01-23 10:23   ` Daniel P. Berrange
2009-01-23 19:06   ` Paul Brook
2009-01-23 19:28     ` Anthony Liguori
2009-01-26  8:55       ` Markus Armbruster

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1232652665-1710-3-git-send-email-armbru@redhat.com \
    --to=armbru@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).