[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 03/20] nubus-device: add device slot parameter
From: |
Philippe Mathieu-Daudé |
Subject: |
Re: [PATCH 03/20] nubus-device: add device slot parameter |
Date: |
Sun, 12 Sep 2021 17:15:06 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 |
On 9/12/21 9:48 AM, Mark Cave-Ayland wrote:
> This prepares for allowing Nubus devices to be placed in a specific slot
> instead
> of always being auto-allocated by the bus itself.
>
> Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
> ---
> hw/nubus/nubus-device.c | 6 ++++++
> include/hw/nubus/nubus.h | 2 +-
> 2 files changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/hw/nubus/nubus-device.c b/hw/nubus/nubus-device.c
> index 36203848e5..c1832f73da 100644
> --- a/hw/nubus/nubus-device.c
> +++ b/hw/nubus/nubus-device.c
> @@ -191,12 +191,18 @@ static void nubus_device_realize(DeviceState *dev,
> Error **errp)
> nubus_register_format_block(nd);
> }
>
> +static Property nubus_device_properties[] = {
> + DEFINE_PROP_INT32("slot", NubusDevice, slot, -1),
> + DEFINE_PROP_END_OF_LIST()
> +};
> +
> static void nubus_device_class_init(ObjectClass *oc, void *data)
> {
> DeviceClass *dc = DEVICE_CLASS(oc);
>
> dc->realize = nubus_device_realize;
> dc->bus_type = TYPE_NUBUS_BUS;
> + device_class_set_props(dc, nubus_device_properties);
Can we reorder this after #4 where you sanity check 'slot'
in nubus_device_realize()? First sanity check, then expose
the property.
- Re: [PATCH 02/20] nubus-device: expose separate super slot memory region, (continued)
[PATCH 06/20] nubus: implement BusClass get_dev_path(), Mark Cave-Ayland, 2021/09/12
[PATCH 04/20] nubus: use bitmap to manage available slots, Mark Cave-Ayland, 2021/09/12
[PATCH 05/20] nubus: move slot bitmap checks from NubusDevice realize() to BusClass check_address(), Mark Cave-Ayland, 2021/09/12
[PATCH 03/20] nubus-device: add device slot parameter, Mark Cave-Ayland, 2021/09/12
- Re: [PATCH 03/20] nubus-device: add device slot parameter,
Philippe Mathieu-Daudé <=
[PATCH 07/20] nubus: add trace-events for unassigned slot accesses, Mark Cave-Ayland, 2021/09/12
[PATCH 08/20] nubus: generate bus error when attempting to access empty slots, Mark Cave-Ayland, 2021/09/12
[PATCH 09/20] macfb: don't register declaration ROM, Mark Cave-Ayland, 2021/09/12
[PATCH 10/20] nubus-device: remove nubus_register_rom() and nubus_register_format_block(), Mark Cave-Ayland, 2021/09/12
[PATCH 11/20] nubus-device: add romfile property for loading declaration ROMs, Mark Cave-Ayland, 2021/09/12