[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-ppc] [PATCH 2/3] e500: Adding CCSR memory region
From: |
Avi Kivity |
Subject: |
Re: [Qemu-ppc] [PATCH 2/3] e500: Adding CCSR memory region |
Date: |
Tue, 09 Oct 2012 19:01:13 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:15.0) Gecko/20120911 Thunderbird/15.0.1 |
On 10/09/2012 06:57 PM, Bhushan Bharat-R65777 wrote:
>
>
>> -----Original Message-----
>> From: Avi Kivity [mailto:address@hidden
>> Sent: Tuesday, October 09, 2012 10:24 PM
>> To: Bhushan Bharat-R65777
>> Cc: Andreas Färber; address@hidden; address@hidden; address@hidden
>> 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
- Re: [Qemu-ppc] [Qemu-devel] [PATCH 3/3] Adding BAR0 for e500 PCI controller, (continued)
[Qemu-ppc] [PATCH 2/3] e500: Adding CCSR memory region, Bharat Bhushan, 2012/10/08
- Re: [Qemu-ppc] [PATCH 2/3] e500: Adding CCSR memory region, Andreas Färber, 2012/10/08
- Re: [Qemu-ppc] [PATCH 2/3] e500: Adding CCSR memory region, Avi Kivity, 2012/10/09
- Re: [Qemu-ppc] [PATCH 2/3] e500: Adding CCSR memory region, Bhushan Bharat-R65777, 2012/10/09
- Re: [Qemu-ppc] [PATCH 2/3] e500: Adding CCSR memory region, Avi Kivity, 2012/10/09
- Re: [Qemu-ppc] [PATCH 2/3] e500: Adding CCSR memory region, Bhushan Bharat-R65777, 2012/10/09
- Re: [Qemu-ppc] [PATCH 2/3] e500: Adding CCSR memory region,
Avi Kivity <=
- Re: [Qemu-ppc] [PATCH 2/3] e500: Adding CCSR memory region, Bhushan Bharat-R65777, 2012/10/09
Re: [Qemu-ppc] [PATCH 2/3] e500: Adding CCSR memory region, Andreas Färber, 2012/10/08