From: Avi Kivity <avi@redhat.com>
To: Bhushan Bharat-R65777 <R65777@freescale.com>
Cc: "qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
"qemu-ppc@nongnu.org" <qemu-ppc@nongnu.org>,
"Andreas Färber" <afaerber@suse.de>,
"agraf@suse.de" <agraf@suse.de>
Subject: Re: [Qemu-devel] [PATCH 2/3] e500: Adding CCSR memory region
Date: Tue, 09 Oct 2012 19:01:13 +0200 [thread overview]
Message-ID: <50745859.7020906@redhat.com> (raw)
In-Reply-To: <6A3DF150A5B70D4F9B66A25E3F7C888D064B8639@039-SN2MPN1-022.039d.mgd.msft.net>
On 10/09/2012 06:57 PM, Bhushan Bharat-R65777 wrote:
>
>
>> -----Original Message-----
>> From: Avi Kivity [mailto:avi@redhat.com]
>> Sent: Tuesday, October 09, 2012 10:24 PM
>> To: Bhushan Bharat-R65777
>> Cc: Andreas Färber; agraf@suse.de; qemu-ppc@nongnu.org; qemu-devel@nongnu.org
>> Subject: Re: [PATCH 2/3] e500: Adding CCSR memory region
>>
>> On 10/09/2012 06:45 PM, Bhushan Bharat-R65777 wrote:
>> >
>> > What about adding a API:
>> > void sysbus_mmio_map_to_mr(SysBusDevice *dev, int n, target_phys_addr_t addr,
>> > MemoryRegion *mr) {
>> > assert(n >= 0 && n < dev->num_mmio);
>> >
>> > if (dev->mmio[n].addr == addr) {
>> > /* ??? region already mapped here. */
>> > return;
>> > }
>> > if (dev->mmio[n].addr != (target_phys_addr_t)-1) {
>> > /* Unregister previous mapping. */
>> > memory_region_del_subregion(mr, dev->mmio[n].memory);
>> > }
>> > dev->mmio[n].addr = addr;
>> > memory_region_add_subregion(mr, addr, dev->mmio[n].memory); }
>> >
>>
>> I think you can just use sysbus_mmio_get_region(). There are plenty of other
>> users, so there's precedent.
>
> You mean something like this : memory_region_add_subregion(mr, addr, sysbus_mmio_get_region(dev, 0);
>
> Ok, but this will still not resolve the issue of not setting the "dev->mmio[n].addr", no ?
Correct. But there are 20 uses already, so it can't matter much. If
someone wants to fix them, they can write a new API and do a sweep.
But really, sysbus just needs to go away. It's pointless to give it
more and more features.
--
error compiling committee.c: too many arguments to function
next prev parent reply other threads:[~2012-10-09 17:01 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-08 16:46 [Qemu-devel] [PATCH 0/3] e500: creating CCSR region and registering bar0 Bharat Bhushan
2012-10-08 16:46 ` [Qemu-devel] [PATCH 1/3] e500: Fix serial initialization Bharat Bhushan
2012-10-08 17:00 ` Andreas Färber
2012-10-08 18:54 ` Alexander Graf
2012-10-08 16:46 ` [Qemu-devel] [PATCH 2/3] e500: Adding CCSR memory region Bharat Bhushan
2012-10-08 17:21 ` Andreas Färber
2012-10-08 18:58 ` Alexander Graf
2012-10-09 17:23 ` Andreas Färber
2012-10-09 9:04 ` Avi Kivity
2012-10-09 16:45 ` Bhushan Bharat-R65777
2012-10-09 16:53 ` Avi Kivity
2012-10-09 16:57 ` Bhushan Bharat-R65777
2012-10-09 17:01 ` Avi Kivity [this message]
2012-10-09 17:05 ` Bhushan Bharat-R65777
2012-10-08 17:26 ` Andreas Färber
2012-10-08 16:46 ` [Qemu-devel] [PATCH 3/3] Adding BAR0 for e500 PCI controller Bharat Bhushan
2012-10-08 18:00 ` Andreas Färber
2012-10-08 19:04 ` Alexander Graf
2012-10-08 20:23 ` Scott Wood
2012-10-09 1:55 ` Bhushan Bharat-R65777
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=50745859.7020906@redhat.com \
--to=avi@redhat.com \
--cc=R65777@freescale.com \
--cc=afaerber@suse.de \
--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).