From: Avi Kivity <avi@redhat.com>
To: Alexander Graf <agraf@suse.de>
Cc: "qemu-ppc@nongnu.org" <qemu-ppc@nongnu.org>,
"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
Bhushan Bharat-R65777 <R65777@freescale.com>
Subject: Re: [Qemu-devel] [PATCH 2/2] Adding BAR0 for e500 PCI controller
Date: Sun, 07 Oct 2012 11:48:50 +0200 [thread overview]
Message-ID: <50715002.4010408@redhat.com> (raw)
In-Reply-To: <AC92FFC4-A6AC-4D3D-B7FB-144D806A64D6@suse.de>
On 10/05/2012 01:59 PM, Alexander Graf wrote:
>>>> Do you mean that we add the "MemoryRegion bar0" in PCIDevice struct. Do the
>>> same thing that I was doing in e500_pcihost_initfn() in the k->init() (will add
>>> this) function of "e500-host-bridge"
>>>
>>> No, he means that you create a new struct like this:
>>>
>>> struct foo {
>>> PCIDevice p;
>>> MemoryRegion bar0;
>>> };
>>>
>>> Please check out any other random PCI device in QEMU. Almost all of them do this
>>> to store more information than their parent class can hold.
>>
>> Just want to be sure I understood you correctly: Do you mean something like this : ( I know I have to switch to QOM mechanism to share parameters)
>>
>> diff --git a/hw/ppce500_pci.c b/hw/ppce500_pci.c
>> index 92b1dc0..a948bc6 100644
>> --- a/hw/ppce500_pci.c
>> +++ b/hw/ppce500_pci.c
>> @@ -89,6 +89,12 @@ struct PPCE500PCIState {
>> MemoryRegion iomem;
>> };
>>
>> +struct BHARAT {
>> + PCIDevice p;
>> + void *bar0;
>
> MemoryRegion *bar0
MemoryRegion bar0;
>
>> +};
>> +
>> +typedef struct BHARAT bharat;
>> typedef struct PPCE500PCIState PPCE500PCIState;
>>
>> static uint64_t pci_reg_read4(void *opaque, target_phys_addr_t addr,
>> @@ -307,6 +313,16 @@ static const VMStateDescription vmstate_ppce500_pci = {
>>
>> #include "exec-memory.h"
>>
>> +static int e500_pcihost_bridge_initfn(PCIDevice *d)
>> +{
>> + bharat *b = DO_UPCAST(bharat, p, d);
>> +
>> + printf("Addr = %llx, size = %llx\n", ((MemoryRegion *)b->bar0)->addr, (unsigned long long)int128_get64(((Me
memory_region_init_io(&d->bar0, ...);
>> + pci_register_bar(d, 0, PCI_BASE_ADDRESS_SPACE_MEMORY, (MemoryRegion *)b->bar0);
>
> That one still has to call its parent initfn, no?
>
yes
--
error compiling committee.c: too many arguments to function
next prev parent reply other threads:[~2012-10-07 9:48 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-03 11:49 [Qemu-devel] [PATCH 0/2] e500: creating CCSR region and registering bar0 Bharat Bhushan
2012-10-03 11:49 ` [Qemu-devel] [PATCH 1/2] e500: Adding CCSR memory region Bharat Bhushan
2012-10-03 12:08 ` Alexander Graf
2012-10-03 12:16 ` Bhushan Bharat-R65777
2012-10-03 12:18 ` Alexander Graf
2012-10-03 11:50 ` [Qemu-devel] [PATCH 2/2] Adding BAR0 for e500 PCI controller Bharat Bhushan
2012-10-03 12:11 ` Alexander Graf
2012-10-03 12:23 ` Bhushan Bharat-R65777
2012-10-04 12:31 ` Avi Kivity
2012-10-04 13:46 ` Bhushan Bharat-R65777
2012-10-04 14:58 ` Avi Kivity
2012-10-04 16:03 ` Bhushan Bharat-R65777
2012-10-04 16:07 ` Alexander Graf
2012-10-04 16:48 ` Bhushan Bharat-R65777
2012-10-04 16:50 ` Alexander Graf
2012-10-04 17:02 ` Avi Kivity
2012-10-05 7:11 ` Bhushan Bharat-R65777
2012-10-05 11:59 ` Alexander Graf
2012-10-07 9:48 ` Avi Kivity [this message]
2012-10-07 11:57 ` Alexander Graf
2012-10-07 12:41 ` Avi Kivity
2012-10-08 8:23 ` Bhushan Bharat-R65777
2012-10-08 8:50 ` Alexander Graf
2012-10-08 13:57 ` Andreas Färber
2012-10-04 15:54 ` Andreas Färber
2012-10-04 16:01 ` Alexander Graf
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=50715002.4010408@redhat.com \
--to=avi@redhat.com \
--cc=R65777@freescale.com \
--cc=agraf@suse.de \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@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).