[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 17/33] hw/arm/pxa2xx_gpio: Pass CPU using QOM link property
From: |
Peter Maydell |
Subject: |
[PULL 17/33] hw/arm/pxa2xx_gpio: Pass CPU using QOM link property |
Date: |
Thu, 2 Nov 2023 17:38:19 +0000 |
From: Philippe Mathieu-Daudé <philmd@linaro.org>
Instead of passing the CPU index and resolving it,
use a QOM link to directly pass the CPU.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-id: 20231030083706.63685-1-philmd@linaro.org
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
hw/arm/pxa2xx_gpio.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/hw/arm/pxa2xx_gpio.c b/hw/arm/pxa2xx_gpio.c
index e7c3d99224a..c8db5e8e2b7 100644
--- a/hw/arm/pxa2xx_gpio.c
+++ b/hw/arm/pxa2xx_gpio.c
@@ -32,7 +32,6 @@ struct PXA2xxGPIOInfo {
MemoryRegion iomem;
qemu_irq irq0, irq1, irqX;
int lines;
- int ncpu;
ARMCPU *cpu;
/* XXX: GNU C vectors are more suitable */
@@ -266,12 +265,11 @@ static const MemoryRegionOps pxa_gpio_ops = {
DeviceState *pxa2xx_gpio_init(hwaddr base,
ARMCPU *cpu, DeviceState *pic, int lines)
{
- CPUState *cs = CPU(cpu);
DeviceState *dev;
dev = qdev_new(TYPE_PXA2XX_GPIO);
qdev_prop_set_int32(dev, "lines", lines);
- qdev_prop_set_int32(dev, "ncpu", cs->cpu_index);
+ object_property_set_link(OBJECT(dev), "cpu", OBJECT(cpu), &error_abort);
sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal);
sysbus_mmio_map(SYS_BUS_DEVICE(dev), 0, base);
@@ -303,8 +301,6 @@ static void pxa2xx_gpio_realize(DeviceState *dev, Error
**errp)
{
PXA2xxGPIOInfo *s = PXA2XX_GPIO(dev);
- s->cpu = ARM_CPU(qemu_get_cpu(s->ncpu));
-
qdev_init_gpio_in(dev, pxa2xx_gpio_set, s->lines);
qdev_init_gpio_out(dev, s->handler, s->lines);
}
@@ -339,7 +335,7 @@ static const VMStateDescription vmstate_pxa2xx_gpio_regs = {
static Property pxa2xx_gpio_properties[] = {
DEFINE_PROP_INT32("lines", PXA2xxGPIOInfo, lines, 0),
- DEFINE_PROP_INT32("ncpu", PXA2xxGPIOInfo, ncpu, 0),
+ DEFINE_PROP_LINK("cpu", PXA2xxGPIOInfo, cpu, TYPE_ARM_CPU, ARMCPU *),
DEFINE_PROP_END_OF_LIST(),
};
--
2.34.1
- [PULL 00/33] target-arm queue, Peter Maydell, 2023/11/02
- [PULL 01/33] linux-user/elfload: Add missing arm64 hwcap values, Peter Maydell, 2023/11/02
- [PULL 07/33] hw/input/stellaris_gamepad: Convert to qemu_input_handler_register(), Peter Maydell, 2023/11/02
- [PULL 03/33] hw/input/stellaris_gamepad: Rename structs to our usual convention, Peter Maydell, 2023/11/02
- [PULL 06/33] hw/input/stellaris_input: Convert to qdev, Peter Maydell, 2023/11/02
- [PULL 05/33] hw/input/stellaris_gamepad: Remove StellarisGamepadButton struct, Peter Maydell, 2023/11/02
- [PULL 09/33] docs/specs/edu: Convert to rST, Peter Maydell, 2023/11/02
- [PULL 15/33] docs/specs/vmgenid: Convert to rST, Peter Maydell, 2023/11/02
- [PULL 11/33] docs/specs/pvpanic: Convert to rST, Peter Maydell, 2023/11/02
- [PULL 17/33] hw/arm/pxa2xx_gpio: Pass CPU using QOM link property,
Peter Maydell <=
- [PULL 18/33] hw/watchdog/wdt_imx2: Trace MMIO access, Peter Maydell, 2023/11/02
- [PULL 08/33] docs/specs/vmw_pvscsi-spec: Convert to rST, Peter Maydell, 2023/11/02
- [PULL 10/33] docs/specs/ivshmem-spec: Convert to rST, Peter Maydell, 2023/11/02
- [PULL 14/33] docs/specs/vmcoreinfo: Convert to rST, Peter Maydell, 2023/11/02
- [PULL 19/33] hw/watchdog/wdt_imx2: Trace timer activity, Peter Maydell, 2023/11/02
- [PULL 24/33] linux-user: Report AArch64 hwcap2 fields above bit 31, Peter Maydell, 2023/11/02
- [PULL 30/33] target/arm: Correctly propagate stage 1 BTI guarded bit in a two-stage walk, Peter Maydell, 2023/11/02
- [PULL 28/33] hw/char/stm32f2xx_usart: Update IRQ when DR is written, Peter Maydell, 2023/11/02
- [PULL 31/33] hw/misc: Introduce AMD/Xilix Versal TRNG device, Peter Maydell, 2023/11/02
- [PULL 32/33] hw/arm: xlnx-versal-virt: Add AMD/Xilinx TRNG device, Peter Maydell, 2023/11/02