All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Hervé Poussineau" <hpoussin@reactos.org>
To: qemu-devel@nongnu.org
Cc: "Hervé Poussineau" <hpoussin@reactos.org>
Subject: [Qemu-devel] [RFC 5/6] isa: improve bus implementation of PIIX3 bridge
Date: Sat, 20 Aug 2011 16:56:34 +0200	[thread overview]
Message-ID: <1313852195-23081-6-git-send-email-hpoussin@reactos.org> (raw)
In-Reply-To: <1313852195-23081-1-git-send-email-hpoussin@reactos.org>


Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>
---
 hw/pc_piix.c  |    2 +-
 hw/piix_pci.c |   23 ++++++++++++++++++++++-
 2 files changed, 23 insertions(+), 2 deletions(-)

diff --git a/hw/pc_piix.c b/hw/pc_piix.c
index d8f285c..af45a13 100644
--- a/hw/pc_piix.c
+++ b/hw/pc_piix.c
@@ -135,8 +135,8 @@ static void pc_init1(MemoryRegion *system_memory,
         pci_bus = NULL;
         i440fx_state = NULL;
         isa_bus_bridge_init(NULL);
+        isa_bus_irqs(i8259);
     }
-    isa_bus_irqs(isa_irq);
 
     pc_register_ferr_irq(isa_get_irq(13));
 
diff --git a/hw/piix_pci.c b/hw/piix_pci.c
index 0b56553..4be1dcd 100644
--- a/hw/piix_pci.c
+++ b/hw/piix_pci.c
@@ -30,6 +30,7 @@
 #include "sysbus.h"
 #include "range.h"
 #include "xen.h"
+#include "exec-memory.h"
 
 /*
  * I440FX chipset data sheet.
@@ -45,6 +46,7 @@ typedef PCIHostState I440FXState;
 
 typedef struct PIIX3State {
     PCIDevice dev;
+    ISABus bus;
 
     /*
      * bitmap to track pic levels.
@@ -443,11 +445,30 @@ static const VMStateDescription vmstate_piix3 = {
     }
 };
 
+static qemu_irq piix3_bus_get_irq(ISABus *bus, int isairq)
+{
+    PIIX3State *d = container_of(bus, PIIX3State, bus);
+    if (isairq < 0 || isairq >= PIIX_NUM_PIC_IRQS) {
+        hw_error("isa irq %d invalid", isairq);
+    }
+    return d->pic[isairq];
+}
+
+static MemoryRegion *piix3_bus_get_address_space(ISABus *bus)
+{
+    return get_system_memory();
+}
+
+static ISABusOps piix3_bus_ops = {
+    .get_irq = piix3_bus_get_irq,
+    .get_address_space = piix3_bus_get_address_space,
+};
+
 static int piix3_initfn(PCIDevice *dev)
 {
     PIIX3State *d = DO_UPCAST(PIIX3State, dev, dev);
 
-    isa_bus_bridge_init(&d->dev.qdev);
+    isa_bus_new(&d->bus, &piix3_bus_ops, &dev->qdev);
     qemu_register_reset(piix3_reset, d);
     return 0;
 }
-- 
1.7.5.4

  parent reply	other threads:[~2011-08-20 14:56 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-20 14:56 [Qemu-devel] [RFC 0/6] ISA bus improvements Hervé Poussineau
2011-08-20 14:56 ` [Qemu-devel] [RFC 1/6] isa: rename isa_bus_new to isa_bus_bridge_init Hervé Poussineau
2011-08-20 14:56 ` [Qemu-devel] [RFC 2/6] isa: rework ISA bus internals, and add ISA bus ops structure Hervé Poussineau
2011-08-20 14:56 ` [Qemu-devel] [RFC 3/6] isa: add isa_address_space() method Hervé Poussineau
2011-08-20 14:56 ` [Qemu-devel] [RFC 4/6] vga: use " Hervé Poussineau
2011-08-20 14:56 ` Hervé Poussineau [this message]
2011-08-20 14:56 ` [Qemu-devel] [RFC 6/6] isa: improve bus implementation of ebus bridge Hervé Poussineau
2011-08-20 20:12   ` Richard Henderson

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=1313852195-23081-6-git-send-email-hpoussin@reactos.org \
    --to=hpoussin@reactos.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.