qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Anthony Liguori <aliguori@us.ibm.com>
To: qemu-devel@nongnu.org
Cc: "Paolo Bonzini" <pbonzini@redhat.com>,
	"Anthony Liguori" <aliguori@us.ibm.com>,
	"Markus Armbruster" <armbru@redhat.com>,
	"Andreas Färber" <afaerber@suse.de>
Subject: [Qemu-devel] [PATCH 02/30] openpic: remove dead code to make a PCI device version
Date: Mon,  2 Jan 2012 18:51:51 -0600	[thread overview]
Message-ID: <1325551939-24749-3-git-send-email-aliguori@us.ibm.com> (raw)
In-Reply-To: <1325551939-24749-1-git-send-email-aliguori@us.ibm.com>

bus is always NULL so the code in this if clause is dead (and therefore
untested).

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
---
 hw/openpic.c      |   30 +++---------------------------
 hw/openpic.h      |    2 +-
 hw/ppc_newworld.c |    2 +-
 3 files changed, 5 insertions(+), 29 deletions(-)

diff --git a/hw/openpic.c b/hw/openpic.c
index 22fc275..280b7a9 100644
--- a/hw/openpic.c
+++ b/hw/openpic.c
@@ -1181,41 +1181,17 @@ static void openpic_irq_raise(openpic_t *opp, int n_CPU, IRQ_src_t *src)
     qemu_irq_raise(opp->dst[n_CPU].irqs[OPENPIC_OUTPUT_INT]);
 }
 
-qemu_irq *openpic_init (PCIBus *bus, MemoryRegion **pmem, int nb_cpus,
+qemu_irq *openpic_init (MemoryRegion **pmem, int nb_cpus,
                         qemu_irq **irqs, qemu_irq irq_out)
 {
     openpic_t *opp;
-    uint8_t *pci_conf;
     int i, m;
 
     /* XXX: for now, only one CPU is supported */
     if (nb_cpus != 1)
         return NULL;
-    if (bus) {
-        opp = (openpic_t *)pci_register_device(bus, "OpenPIC", sizeof(openpic_t),
-                                               -1, NULL, NULL);
-        pci_conf = opp->pci_dev.config;
-        pci_config_set_vendor_id(pci_conf, PCI_VENDOR_ID_IBM);
-        pci_config_set_device_id(pci_conf, PCI_DEVICE_ID_IBM_OPENPIC2);
-        pci_config_set_class(pci_conf, PCI_CLASS_SYSTEM_OTHER); // FIXME?
-        pci_conf[0x3d] = 0x00; // no interrupt pin
-
-        memory_region_init_io(&opp->mem, &openpic_ops, opp, "openpic", 0x40000);
-#if 0 // Don't implement ISU for now
-        opp_io_memory = cpu_register_io_memory(openpic_src_read,
-                                               openpic_src_write, NULL
-                                               DEVICE_NATIVE_ENDIAN);
-        cpu_register_physical_memory(isu_base, 0x20 * (EXT_IRQ + 2),
-                                     opp_io_memory);
-#endif
-
-        /* Register I/O spaces */
-        pci_register_bar(&opp->pci_dev, 0,
-                         PCI_BASE_ADDRESS_SPACE_MEMORY, &opp->mem);
-    } else {
-        opp = g_malloc0(sizeof(openpic_t));
-        memory_region_init_io(&opp->mem, &openpic_ops, opp, "openpic", 0x40000);
-    }
+    opp = g_malloc0(sizeof(openpic_t));
+    memory_region_init_io(&opp->mem, &openpic_ops, opp, "openpic", 0x40000);
 
     //    isu_base &= 0xFFFC0000;
     opp->nb_cpus = nb_cpus;
diff --git a/hw/openpic.h b/hw/openpic.h
index 715f084..8556030 100644
--- a/hw/openpic.h
+++ b/hw/openpic.h
@@ -11,7 +11,7 @@ enum {
     OPENPIC_OUTPUT_NB,
 };
 
-qemu_irq *openpic_init (PCIBus *bus, MemoryRegion **pmem, int nb_cpus,
+qemu_irq *openpic_init (MemoryRegion **pmem, int nb_cpus,
                         qemu_irq **irqs, qemu_irq irq_out);
 qemu_irq *mpic_init (MemoryRegion *address_space, target_phys_addr_t base,
                      int nb_cpus, qemu_irq **irqs, qemu_irq irq_out);
diff --git a/hw/ppc_newworld.c b/hw/ppc_newworld.c
index 8c84f9e..34d81d9 100644
--- a/hw/ppc_newworld.c
+++ b/hw/ppc_newworld.c
@@ -309,7 +309,7 @@ static void ppc_core99_init (ram_addr_t ram_size,
             exit(1);
         }
     }
-    pic = openpic_init(NULL, &pic_mem, smp_cpus, openpic_irqs, NULL);
+    pic = openpic_init(&pic_mem, smp_cpus, openpic_irqs, NULL);
     if (PPC_INPUT(env) == PPC_FLAGS_INPUT_970) {
         /* 970 gets a U3 bus */
         pci_bus = pci_pmac_u3_init(pic, get_system_memory(), get_system_io());
-- 
1.7.4.1

  parent reply	other threads:[~2012-01-03  0:52 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-03  0:51 [Qemu-devel] qom: add QEMU Object Model type hierarchy to qdev (v2) Anthony Liguori
2012-01-03  0:51 ` [Qemu-devel] [PATCH 01/30] macio: convert to qdev Anthony Liguori
2012-01-03  0:51 ` Anthony Liguori [this message]
2012-01-03  0:51 ` [Qemu-devel] [PATCH 03/30] ppc: remove ppc440 bamboo board support Anthony Liguori
2012-01-05 15:16   ` François Revol
2012-01-13 10:59   ` Benjamin Herrenschmidt
2012-01-13 11:04     ` Andreas Färber
2012-01-13 11:45       ` Paolo Bonzini
2012-01-13 12:30         ` Alexander Graf
2012-01-13 14:24           ` Andreas Färber
2012-01-13 14:29             ` Alexander Graf
2012-01-03  0:51 ` [Qemu-devel] [PATCH 04/30] ppc_prep: convert host bridge to qdev Anthony Liguori
2012-01-03 14:57   ` Andreas Färber
2012-01-07  0:11     ` Andreas Färber
2012-01-03  0:51 ` [Qemu-devel] [PATCH 05/30] pseries: Remove hcalls callback Anthony Liguori
2012-01-03  0:51 ` [Qemu-devel] [PATCH 06/30] pci: call reset unconditionally Anthony Liguori
2012-01-03  0:51 ` [Qemu-devel] [PATCH 07/30] qom: add the base Object class (v2) Anthony Liguori
2012-01-03  9:02   ` Paolo Bonzini
2012-01-03  0:51 ` [Qemu-devel] [PATCH 08/30] qdev: integrate with QEMU Object Model (v2) Anthony Liguori
2012-01-03  0:51 ` [Qemu-devel] [PATCH 09/30] qdev: move qdev->info to class Anthony Liguori
2012-01-08  2:27   ` Andreas Färber
2012-01-03  0:51 ` [Qemu-devel] [PATCH 10/30] qdev: don't access name through info Anthony Liguori
2012-01-03  9:06   ` Paolo Bonzini
2012-01-03 13:39     ` Anthony Liguori
2012-01-03 13:41       ` Paolo Bonzini
2012-01-03  0:52 ` [Qemu-devel] [PATCH 11/30] qdev: use a wrapper to access reset and promote reset to a class method Anthony Liguori
2012-01-03  0:52 ` [Qemu-devel] [PATCH 12/30] qdev: add a interface to register subclasses Anthony Liguori
2012-01-03  0:52 ` [Qemu-devel] [PATCH 13/30] qdev: add class_init to DeviceInfo Anthony Liguori
2012-01-03  0:52 ` [Qemu-devel] [PATCH 14/30] qdev: prepare source tree for code conversion Anthony Liguori
2012-01-04 14:07   ` Andreas Färber
2012-01-04 14:24     ` Anthony Liguori
2012-01-03  0:52 ` [Qemu-devel] [PATCH 15/30] isa: convert to QEMU Object Model Anthony Liguori
2012-01-03  0:52 ` [Qemu-devel] [PATCH 16/30] usb: " Anthony Liguori
2012-01-03  0:52 ` [Qemu-devel] [PATCH 17/30] ccid: " Anthony Liguori
2012-01-03  0:52 ` [Qemu-devel] [PATCH 18/30] ssi: " Anthony Liguori
2012-01-03  0:52 ` [Qemu-devel] [PATCH 19/30] i2c: rename i2c_slave -> I2CSlave Anthony Liguori
2012-01-03  0:52 ` [Qemu-devel] [PATCH 20/30] i2c: smbus: convert to QEMU Object Model Anthony Liguori
2012-01-03  0:52 ` [Qemu-devel] [PATCH 21/30] hda-codec: " Anthony Liguori
2012-01-03  0:52 ` [Qemu-devel] [PATCH 22/30] ide: " Anthony Liguori
2012-01-03  0:52 ` [Qemu-devel] [PATCH 23/30] scsi: " Anthony Liguori
2012-01-03  0:52 ` [Qemu-devel] [PATCH 24/30] spapr: convert to QEMU Object Model (v2) Anthony Liguori
2012-01-03  0:52 ` [Qemu-devel] [PATCH 25/30] virtio-serial: convert to QEMU Object Model Anthony Liguori
2012-01-03  0:52 ` [Qemu-devel] [PATCH 26/30] grackle: remove broken pci device Anthony Liguori
2012-01-08  1:46   ` Aurelien Jarno
2012-01-08  1:55     ` Andreas Färber
2012-01-03  0:52 ` [Qemu-devel] [PATCH 27/30] unin_pci: remove phantom qdev devices in unin_pci Anthony Liguori
2012-01-08  2:04   ` Andreas Färber
2012-01-03  0:52 ` [Qemu-devel] [PATCH 28/30] pci: convert to QEMU Object Model Anthony Liguori
2012-01-03  0:52 ` [Qemu-devel] [PATCH 29/30] sysbus: " Anthony Liguori
2012-01-03  0:52 ` [Qemu-devel] [PATCH 30/30] virtio-s390: " Anthony Liguori

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=1325551939-24749-3-git-send-email-aliguori@us.ibm.com \
    --to=aliguori@us.ibm.com \
    --cc=afaerber@suse.de \
    --cc=armbru@redhat.com \
    --cc=pbonzini@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).