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: Peter Maydell
Subject: Re: [Qemu-devel] [RFC PATCH] hw/misc/unimp: Add create_unimplemented_subregion_device()
Date: Tue, 29 May 2018 16:08:46 +0100

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.

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).

thanks
-- PMM



reply via email to

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