[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v4 06/20] nubus: implement BusClass get_dev_path()
From: |
Laurent Vivier |
Subject: |
Re: [PATCH v4 06/20] nubus: implement BusClass get_dev_path() |
Date: |
Mon, 20 Sep 2021 21:57:51 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 |
Le 17/09/2021 à 09:50, Mark Cave-Ayland a écrit :
> Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
> hw/nubus/nubus-bus.c | 16 ++++++++++++++++
> 1 file changed, 16 insertions(+)
>
> diff --git a/hw/nubus/nubus-bus.c b/hw/nubus/nubus-bus.c
> index 141876b579..63e7d66b95 100644
> --- a/hw/nubus/nubus-bus.c
> +++ b/hw/nubus/nubus-bus.c
> @@ -87,6 +87,21 @@ static void nubus_init(Object *obj)
> nubus->slot_available_mask = MAKE_64BIT_MASK(0, 16);
> }
>
> +static char *nubus_get_dev_path(DeviceState *dev)
> +{
> + NubusDevice *nd = NUBUS_DEVICE(dev);
> + BusState *bus = qdev_get_parent_bus(dev);
> + char *p = qdev_get_dev_path(bus->parent);
> +
> + if (p) {
> + char *ret = g_strdup_printf("%s/%s/%02x", p, bus->name, nd->slot);
> + g_free(p);
> + return ret;
> + } else {
> + return g_strdup_printf("%s/%02x", bus->name, nd->slot);
> + }
> +}
> +
> static bool nubus_check_address(BusState *bus, DeviceState *dev, Error
> **errp)
> {
> NubusDevice *nd = NUBUS_DEVICE(dev);
> @@ -129,6 +144,7 @@ static void nubus_class_init(ObjectClass *oc, void *data)
>
> bc->realize = nubus_realize;
> bc->check_address = nubus_check_address;
> + bc->get_dev_path = nubus_get_dev_path;
> }
>
> static const TypeInfo nubus_bus_info = {
>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
- Re: [PATCH v4 01/20] nubus-device: rename slot_nb variable to slot, (continued)
- [PATCH v4 02/20] nubus-device: expose separate super slot memory region, Mark Cave-Ayland, 2021/09/17
- [PATCH v4 03/20] nubus-device: add device slot parameter, Mark Cave-Ayland, 2021/09/17
- [PATCH v4 04/20] nubus: use bitmap to manage available slots, Mark Cave-Ayland, 2021/09/17
- [PATCH v4 05/20] nubus: move slot bitmap checks from NubusDevice realize() to BusClass check_address(), Mark Cave-Ayland, 2021/09/17
- [PATCH v4 06/20] nubus: implement BusClass get_dev_path(), Mark Cave-Ayland, 2021/09/17
- Re: [PATCH v4 06/20] nubus: implement BusClass get_dev_path(),
Laurent Vivier <=
- [PATCH v4 11/20] nubus-device: add romfile property for loading declaration ROMs, Mark Cave-Ayland, 2021/09/17
- [PATCH v4 08/20] nubus: generate bus error when attempting to access empty slots, Mark Cave-Ayland, 2021/09/17
- [PATCH v4 10/20] nubus-device: remove nubus_register_rom() and nubus_register_format_block(), Mark Cave-Ayland, 2021/09/17
- [PATCH v4 07/20] nubus: add trace-events for empty slot accesses, Mark Cave-Ayland, 2021/09/17
- [PATCH v4 09/20] macfb: don't register declaration ROM, Mark Cave-Ayland, 2021/09/17