qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Juan Quintela <quintela@redhat.com>
To: Blue Swirl <blauwirbel@gmail.com>
Cc: qemu-devel@nongnu.org
Subject: [Qemu-devel] Re: [PATCH 0/5] piix_pci cleanup
Date: Mon, 24 Aug 2009 17:20:35 +0200	[thread overview]
Message-ID: <m3fxbhme64.fsf@neno.mitica> (raw)
In-Reply-To: <f43fc5580908211259i464f35caw806b4607ae7c1b4c@mail.gmail.com> (Blue Swirl's message of "Fri, 21 Aug 2009 22:59:10 +0300")

Blue Swirl <blauwirbel@gmail.com> wrote:
> On Fri, Aug 21, 2009 at 8:36 PM, Juan Quintela<quintela@redhat.com> wrote:
>> Hi
>>
>> This series:
>> - split piix4 from piix_pci.  The only shared code where piix_save/load, i.e.
>>  almost nothing.  Once there, compile piix4.o only for mips (it was not used
>>  anywhere else).
>> - Move global variables to PCII440FXState.  Nice and clean until....
>> - pci_irq_levels: This is great:
>>  * it is saved/loaded from i440fx
>>  * it is cleaned during reset in piix3
>>  * it is used in piix3_set_irq, that don't receive neither i440fx nor
>>    piix state, it needs to be a global variable. (created a global link
>>    until a better solution appear).
>>
>> I looked where to "hide" pci_irq_levels and piix3_dev (both needed in
>> piix3_set_irq), and didn't found where to pass them, out of:
>> - hack i8259 to hide it into PicState2 (that one got passed through the pic)
>>  ugly for words, but will work
>> - try to add <something> at setup_irq time, but at that point we have:
>>  * opaque -> pci_dev of device that we are working with
>>  * from there we can get to the bus that the device is attached to,
>>    but no way to go from there to the Host bridge (that is what we wanted
>>    in the 1st place)
>>
>> Notice that this is needed for both pc and mips_malta.c
>>
>> Ideas on where to hide a pci_dev inside a bus?
>
> pci_set_irq_fn should take an opaque state pointer (given at
> pci_register_bus time):
>
> typedef void (*pci_set_irq_fn)(void *opaque, qemu_irq *pic, int
> irq_num, int level);
>
> PCIBus *pci_register_bus(DeviceState *parent, const char *name,
>                          pci_set_irq_fn set_irq, pci_map_irq_fn map_irq,
>                          qemu_irq *pic, void *irq_opaque, int
> devfn_min, int nirq);

I fixed it changing the type of qemu_irq *pic to void *irq_state.
See the v2 of the series.

Thanks very much for the suggestion.

later, Juan.

      reply	other threads:[~2009-08-24 15:23 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-21 17:36 [Qemu-devel] [PATCH 0/5] piix_pci cleanup Juan Quintela
2009-08-21 17:36 ` [Qemu-devel] [PATCH 1/5] piix4 don't use pci_irq_levels at all Juan Quintela
2009-08-21 17:36 ` [Qemu-devel] [PATCH 2/5] Split piix4 support from piix_pci.c Juan Quintela
2009-08-21 17:36 ` [Qemu-devel] [PATCH 3/5] Use PCII440FXState instead of generic PCIDevice Juan Quintela
2009-08-21 17:36 ` [Qemu-devel] [PATCH 4/5] Move smm_enabled and isa_memory_mappings to PCII440FXState Juan Quintela
2009-08-21 17:36 ` [Qemu-devel] [PATCH 5/5] Cleanup of pci_irq_levels belong to i440fx Juan Quintela
2009-08-21 19:59 ` [Qemu-devel] [PATCH 0/5] piix_pci cleanup Blue Swirl
2009-08-24 15:20   ` Juan Quintela [this message]

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=m3fxbhme64.fsf@neno.mitica \
    --to=quintela@redhat.com \
    --cc=blauwirbel@gmail.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).