qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [RFC PATCH] hw/misc/unimp: Add create_unimplemented_sub


From: Philippe Mathieu-Daudé
Subject: Re: [Qemu-devel] [RFC PATCH] hw/misc/unimp: Add create_unimplemented_subregion_device()
Date: Tue, 29 May 2018 13:43:41 -0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0

On 05/29/2018 12:08 PM, Peter Maydell wrote:
> On 28 May 2018 at 07:11, Philippe Mathieu-Daudé <address@hidden> wrote:
>> The create_unimplemented_device() function is very useful to
>> register unimplemented devices to the SysBus 'absolute' address.
>>
>> Some devices are modelled as container of memory subregions,
>> the subregions being mmio-mapped relatively to the container
>> base address.
>>
>> With these container devices, the current create_unimplemented_device()
>> does not work.
>> Add a function to remove the current limitation, and allow
>> containerized devices to use the helpful UnimplementedDevice.
>>
>> Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
>> ---
>> I don't like the function name much, I first tried with
>> create_unimplemented_device_mr() :( Would it be cleaner renaming current
>> create_unimplemented_device() -> create_unimplemented_sysbus_device()?
>>
>> Also, is this useful to have this code inlined?
> 
> My experience has been that devices that want to map the
> unimplemented device into some other container probably
> also want to do in-place initialization rather than using
> qdev_create() -- eg hw/arm/iotkit.c which directly creates
> TYPE_UNIMPLEMENTED_DEVICEs which are embedded in its state
> struct.
> 
> It was always the intention that you can create a
> TYPE_UNIMPLEMENTED_DEVICE directly; create_unimplemented_device()
> is just a convenience wrapper.

OK.

> I'm not opposed to having another convenience wrapper here;
> but I'm not sure this is the right API for one (ie if it
> would be used in very many places).

Fair enough.

Thanks,

Phil.



reply via email to

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