From: "Andreas Färber" <afaerber@suse.de>
To: qemu-devel@nongnu.org
Cc: "Andreas Färber" <afaerber@suse.de>, anthony@codemonkey.ws
Subject: [Qemu-devel] [PATCH v2 07/12] i8259: QOM'ify some more
Date: Fri, 7 Jun 2013 14:58:15 +0200 [thread overview]
Message-ID: <1370609900-21998-8-git-send-email-afaerber@suse.de> (raw)
In-Reply-To: <1370609900-21998-1-git-send-email-afaerber@suse.de>
Introduce type constant.
Prepares for PIC realizefn.
Signed-off-by: Andreas Färber <afaerber@suse.de>
---
hw/intc/i8259.c | 23 ++++++++++++++---------
1 file changed, 14 insertions(+), 9 deletions(-)
diff --git a/hw/intc/i8259.c b/hw/intc/i8259.c
index fef00fc..1b513ff 100644
--- a/hw/intc/i8259.c
+++ b/hw/intc/i8259.c
@@ -41,6 +41,8 @@
//#define DEBUG_IRQ_LATENCY
//#define DEBUG_IRQ_COUNT
+#define TYPE_I8259 "isa-i8259"
+
#if defined(DEBUG_PIC) || defined(DEBUG_IRQ_COUNT)
static int irq_level[16];
#endif
@@ -448,25 +450,28 @@ void irq_info(Monitor *mon, const QDict *qdict)
qemu_irq *i8259_init(ISABus *bus, qemu_irq parent_irq)
{
qemu_irq *irq_set;
- ISADevice *dev;
+ DeviceState *dev;
+ ISADevice *isadev;
int i;
irq_set = g_malloc(ISA_NUM_IRQS * sizeof(qemu_irq));
- dev = i8259_init_chip("isa-i8259", bus, true);
+ isadev = i8259_init_chip(TYPE_I8259, bus, true);
+ dev = DEVICE(isadev);
- qdev_connect_gpio_out(&dev->qdev, 0, parent_irq);
+ qdev_connect_gpio_out(dev, 0, parent_irq);
for (i = 0 ; i < 8; i++) {
- irq_set[i] = qdev_get_gpio_in(&dev->qdev, i);
+ irq_set[i] = qdev_get_gpio_in(dev, i);
}
- isa_pic = &dev->qdev;
+ isa_pic = dev;
- dev = i8259_init_chip("isa-i8259", bus, false);
+ isadev = i8259_init_chip(TYPE_I8259, bus, false);
+ dev = DEVICE(isadev);
- qdev_connect_gpio_out(&dev->qdev, 0, irq_set[2]);
+ qdev_connect_gpio_out(dev, 0, irq_set[2]);
for (i = 0 ; i < 8; i++) {
- irq_set[i + 8] = qdev_get_gpio_in(&dev->qdev, i);
+ irq_set[i + 8] = qdev_get_gpio_in(dev, i);
}
slave_pic = PIC_COMMON(dev);
@@ -484,7 +489,7 @@ static void i8259_class_init(ObjectClass *klass, void *data)
}
static const TypeInfo i8259_info = {
- .name = "isa-i8259",
+ .name = TYPE_I8259,
.instance_size = sizeof(PICCommonState),
.parent = TYPE_PIC_COMMON,
.class_init = i8259_class_init,
--
1.8.1.4
next prev parent reply other threads:[~2013-06-07 12:58 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-07 12:58 [Qemu-devel] [PATCH v2 00/12] QOM realize for ISA, part 2 Andreas Färber
2013-06-07 12:58 ` [Qemu-devel] [PATCH v2 01/12] gus: QOM'ify some more Andreas Färber
2013-06-07 12:58 ` [Qemu-devel] [PATCH v2 02/12] cs4231a: " Andreas Färber
2013-06-07 12:58 ` [Qemu-devel] [PATCH v2 03/12] isa: Use realizefn for ISADevice Andreas Färber
2013-06-07 12:58 ` [Qemu-devel] [PATCH v2 04/12] i8254: QOM'ify some more Andreas Färber
2013-06-07 12:58 ` [Qemu-devel] [PATCH v2 05/12] kvm/i8254: " Andreas Färber
2013-06-10 1:37 ` li guang
2013-06-10 1:40 ` Andreas Färber
2013-06-10 1:43 ` li guang
2013-06-07 12:58 ` [Qemu-devel] [PATCH v2 06/12] i8254: Convert PITCommonState to QOM realizefn Andreas Färber
2013-06-07 12:58 ` Andreas Färber [this message]
2013-06-07 12:58 ` [Qemu-devel] [PATCH v2 08/12] kvm/i8259: QOM'ify some more Andreas Färber
2013-06-07 12:58 ` [Qemu-devel] [PATCH v2 09/12] i8259: Convert PICCommonState to use QOM realizefn Andreas Färber
2013-06-07 12:58 ` [Qemu-devel] [PATCH v2 10/12] isa: QOM'ify ISABus Andreas Färber
2013-06-07 12:58 ` [Qemu-devel] [PATCH v2 11/12] isa: QOM'ify ISADevice Andreas Färber
2013-06-07 12:58 ` [Qemu-devel] [PATCH v2 12/12] qdev: Drop FROM_QBUS() macro Andreas Färber
2013-06-07 13:08 ` [Qemu-devel] [PATCH v2 00/12] QOM realize for ISA, part 2 Andreas Färber
2013-06-15 17:55 ` Blue Swirl
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=1370609900-21998-8-git-send-email-afaerber@suse.de \
--to=afaerber@suse.de \
--cc=anthony@codemonkey.ws \
--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).