qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 2/3] e500: Adding CCSR memory region


From: Avi Kivity
Subject: Re: [Qemu-devel] [PATCH 2/3] e500: Adding CCSR memory region
Date: Tue, 09 Oct 2012 18:53:41 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:15.0) Gecko/20120911 Thunderbird/15.0.1

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.


-- 
error compiling committee.c: too many arguments to function



reply via email to

[Prev in Thread] Current Thread [Next in Thread]