From: Blue Swirl <blauwirbel@gmail.com>
To: Markus Armbruster <armbru@redhat.com>
Cc: qemu-devel <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH v2 2/7] ioapic: convert to qdev
Date: Mon, 14 Jun 2010 17:41:28 +0000 [thread overview]
Message-ID: <AANLkTimPE6HXwmtr923DjPJAOYENSfbxlbVPGpdJK-hr@mail.gmail.com> (raw)
In-Reply-To: <m3vd9mhsbr.fsf@blackfin.pond.sub.org>
On Mon, Jun 14, 2010 at 9:33 AM, Markus Armbruster <armbru@redhat.com> wrote:
> Blue Swirl <blauwirbel@gmail.com> writes:
>
>> Convert to qdev.
>>
>> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
>> ---
>> hw/apic.h | 2 --
>> hw/ioapic.c | 45 ++++++++++++++++++++++++++++++---------------
>> hw/pc.h | 4 +++-
>> hw/pc_piix.c | 19 ++++++++++++++++++-
>> 4 files changed, 51 insertions(+), 19 deletions(-)
>>
>> diff --git a/hw/apic.h b/hw/apic.h
>> index e1954f4..dc41400 100644
>> --- a/hw/apic.h
>> +++ b/hw/apic.h
>> @@ -1,7 +1,6 @@
>> #ifndef APIC_H
>> #define APIC_H
>>
>> -typedef struct IOAPICState IOAPICState;
>> void apic_deliver_irq(uint8_t dest, uint8_t dest_mode,
>> uint8_t delivery_mode,
>> uint8_t vector_num, uint8_t polarity,
>> @@ -10,7 +9,6 @@ int apic_init(CPUState *env);
>> int apic_accept_pic_intr(CPUState *env);
>> void apic_deliver_pic_intr(CPUState *env, int level);
>> int apic_get_interrupt(CPUState *env);
>> -qemu_irq *ioapic_init(void);
>> void apic_reset_irq_delivered(void);
>> int apic_get_irq_delivered(void);
>>
>> diff --git a/hw/ioapic.c b/hw/ioapic.c
>> index e3f8a46..0336dbd 100644
>> --- a/hw/ioapic.c
>> +++ b/hw/ioapic.c
>> @@ -25,6 +25,7 @@
>> #include "apic.h"
>> #include "qemu-timer.h"
>> #include "host-utils.h"
>> +#include "sysbus.h"
>>
>> //#define DEBUG_IOAPIC
>>
>> @@ -35,7 +36,6 @@
>> #define DPRINTF(fmt, ...)
>> #endif
>>
>> -#define IOAPIC_NUM_PINS 0x18
>> #define IOAPIC_LVT_MASKED (1<<16)
>>
>> #define IOAPIC_TRIGGER_EDGE 0
>> @@ -50,7 +50,10 @@
>> #define IOAPIC_DM_SIPI 0x5
>> #define IOAPIC_DM_EXTINT 0x7
>>
>> +typedef struct IOAPICState IOAPICState;
>> +
>> struct IOAPICState {
>> + SysBusDevice busdev;
>> uint8_t id;
>> uint8_t ioregsel;
>>
>> @@ -209,12 +212,14 @@ static const VMStateDescription vmstate_ioapic = {
>> }
>> };
>>
>> -static void ioapic_reset(void *opaque)
>> +static void ioapic_reset(DeviceState *d)
>> {
>> - IOAPICState *s = opaque;
>> + IOAPICState *s = container_of(d, IOAPICState, busdev.qdev);
>
> DO_UPCAST()? I hate it, but it's what the other devices do...
Both are used:
grep container_of hw/*.[ch]|wc -l
81
grep DO_UPCAST hw/*.[ch]|wc -l
246
next prev parent reply other threads:[~2010-06-14 17:42 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-06-12 21:14 [Qemu-devel] [PATCH v2 2/7] ioapic: convert to qdev Blue Swirl
2010-06-14 9:33 ` Markus Armbruster
2010-06-14 17:41 ` Blue Swirl [this message]
2010-06-15 0:25 ` Paul Brook
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=AANLkTimPE6HXwmtr923DjPJAOYENSfbxlbVPGpdJK-hr@mail.gmail.com \
--to=blauwirbel@gmail.com \
--cc=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).