From: Peter Maydell <peter.maydell@linaro.org>
To: qemu-devel@nongnu.org
Subject: [PULL 25/41] hw/intc/pxa2xx: Convert to Resettable interface
Date: Fri, 27 Oct 2023 15:39:26 +0100 [thread overview]
Message-ID: <20231027143942.3413881-26-peter.maydell@linaro.org> (raw)
In-Reply-To: <20231027143942.3413881-1-peter.maydell@linaro.org>
From: Philippe Mathieu-Daudé <philmd@linaro.org>
Factor reset code out of the DeviceRealize() handler.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Message-id: 20231020130331.50048-7-philmd@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
hw/arm/pxa2xx_pic.c | 17 ++++++++++++-----
1 file changed, 12 insertions(+), 5 deletions(-)
diff --git a/hw/arm/pxa2xx_pic.c b/hw/arm/pxa2xx_pic.c
index 47132ab982b..2eb869a605a 100644
--- a/hw/arm/pxa2xx_pic.c
+++ b/hw/arm/pxa2xx_pic.c
@@ -271,12 +271,9 @@ static int pxa2xx_pic_post_load(void *opaque, int version_id)
return 0;
}
-DeviceState *pxa2xx_pic_init(hwaddr base, ARMCPU *cpu)
+static void pxa2xx_pic_reset_hold(Object *obj)
{
- DeviceState *dev = qdev_new(TYPE_PXA2XX_PIC);
- PXA2xxPICState *s = PXA2XX_PIC(dev);
-
- s->cpu = cpu;
+ PXA2xxPICState *s = PXA2XX_PIC(obj);
s->int_pending[0] = 0;
s->int_pending[1] = 0;
@@ -284,6 +281,14 @@ DeviceState *pxa2xx_pic_init(hwaddr base, ARMCPU *cpu)
s->int_enabled[1] = 0;
s->is_fiq[0] = 0;
s->is_fiq[1] = 0;
+}
+
+DeviceState *pxa2xx_pic_init(hwaddr base, ARMCPU *cpu)
+{
+ DeviceState *dev = qdev_new(TYPE_PXA2XX_PIC);
+ PXA2xxPICState *s = PXA2XX_PIC(dev);
+
+ s->cpu = cpu;
sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal);
@@ -319,9 +324,11 @@ static const VMStateDescription vmstate_pxa2xx_pic_regs = {
static void pxa2xx_pic_class_init(ObjectClass *klass, void *data)
{
DeviceClass *dc = DEVICE_CLASS(klass);
+ ResettableClass *rc = RESETTABLE_CLASS(klass);
dc->desc = "PXA2xx PIC";
dc->vmsd = &vmstate_pxa2xx_pic_regs;
+ rc->phases.hold = pxa2xx_pic_reset_hold;
}
static const TypeInfo pxa2xx_pic_info = {
--
2.34.1
next prev parent reply other threads:[~2023-10-27 14:40 UTC|newest]
Thread overview: 49+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-27 14:39 [PULL 00/41] target-arm queue Peter Maydell
2023-10-27 14:39 ` [PULL 01/41] target/arm: Correct minor errors in Cortex-A710 definition Peter Maydell
2023-10-27 14:39 ` [PULL 02/41] target/arm: Implement Neoverse N2 CPU model Peter Maydell
2023-10-27 14:39 ` [PULL 03/41] target/arm: Move feature test functions to their own header Peter Maydell
2023-10-27 14:39 ` [PULL 04/41] target/arm: Move ID_AA64MMFR1 and ID_AA64MMFR2 tests together Peter Maydell
2023-10-27 14:39 ` [PULL 05/41] target/arm: Move ID_AA64MMFR0 tests up to before MMFR1 and MMFR2 Peter Maydell
2023-10-27 14:39 ` [PULL 06/41] target/arm: Move ID_AA64ISAR* test functions together Peter Maydell
2023-10-27 14:39 ` [PULL 07/41] target/arm: Move ID_AA64PFR* tests together Peter Maydell
2023-10-27 14:39 ` [PULL 08/41] target/arm: Move ID_AA64DFR* feature " Peter Maydell
2023-10-27 14:39 ` [PULL 09/41] target/arm: Fix syndrome for FGT traps on ERET Peter Maydell
2023-10-27 14:39 ` [PULL 10/41] hw/arm/allwinner-a10: Remove 'hw/arm/boot.h' from header Peter Maydell
2023-10-27 14:39 ` [PULL 11/41] hw/arm/allwinner-h3: " Peter Maydell
2023-10-27 14:39 ` [PULL 12/41] hw/arm/allwinner-r40: " Peter Maydell
2023-10-27 14:39 ` [PULL 13/41] hw/arm/fsl-imx25: " Peter Maydell
2023-10-27 14:39 ` [PULL 14/41] hw/arm/fsl-imx31: " Peter Maydell
2023-10-27 14:39 ` [PULL 15/41] hw/arm/fsl-imx6: " Peter Maydell
2023-10-27 14:39 ` [PULL 16/41] hw/arm/fsl-imx6ul: " Peter Maydell
2023-10-27 14:39 ` [PULL 17/41] hw/arm/fsl-imx7: " Peter Maydell
2023-10-27 14:39 ` [PULL 18/41] hw/arm/xlnx-versal: " Peter Maydell
2023-10-27 14:39 ` [PULL 19/41] hw/arm/xlnx-zynqmp: " Peter Maydell
2023-10-27 14:39 ` [PULL 20/41] hw/sd/pxa2xx: Realize sysbus device before accessing it Peter Maydell
2023-10-27 14:39 ` [PULL 21/41] hw/sd/pxa2xx: Do not open-code sysbus_create_simple() Peter Maydell
2023-10-27 14:39 ` [PULL 22/41] hw/pcmcia/pxa2xx: Realize sysbus device before accessing it Peter Maydell
2023-10-27 14:39 ` [PULL 23/41] hw/pcmcia/pxa2xx: Do not open-code sysbus_create_simple() Peter Maydell
2023-10-27 14:39 ` [PULL 24/41] hw/pcmcia/pxa2xx: Inline pxa2xx_pcmcia_init() Peter Maydell
2023-10-27 14:39 ` Peter Maydell [this message]
2023-10-27 14:39 ` [PULL 26/41] hw/intc/pxa2xx: Pass CPU reference using QOM link property Peter Maydell
2023-10-27 14:39 ` [PULL 27/41] hw/intc/pxa2xx: Factor pxa2xx_pic_realize() out of pxa2xx_pic_init() Peter Maydell
2023-10-27 14:39 ` [PULL 28/41] hw/arm/pxa2xx: Realize PXA2XX_I2C device before accessing it Peter Maydell
2023-10-27 14:39 ` [PULL 29/41] hw/arm: Avoid using 'first_cpu' when first ARM CPU is reachable Peter Maydell
2023-10-27 14:39 ` [PULL 30/41] misc/led: LED state is set opposite of what is expected Peter Maydell
2023-10-27 14:39 ` [PULL 31/41] hw/net/cadence_gem: use REG32 macro for register definitions Peter Maydell
2023-10-27 14:39 ` [PULL 32/41] hw/net/cadence_gem: use FIELD for screening registers Peter Maydell
2023-10-27 14:39 ` [PULL 33/41] hw/net/cadence_gem: use FIELD to describe NWCTRL register fields Peter Maydell
2023-10-27 14:39 ` [PULL 34/41] hw/net/cadence_gem: use FIELD to describe NWCFG " Peter Maydell
2023-10-27 14:39 ` [PULL 35/41] hw/net/cadence_gem: use FIELD to describe DMACFG " Peter Maydell
2023-10-27 14:39 ` [PULL 36/41] hw/net/cadence_gem: use FIELD to describe [TX|RX]STATUS " Peter Maydell
2023-10-27 14:39 ` [PULL 37/41] hw/net/cadence_gem: use FIELD to describe IRQ " Peter Maydell
2023-10-27 14:39 ` [PULL 38/41] hw/net/cadence_gem: use FIELD to describe DESCONF6 " Peter Maydell
2023-10-27 14:39 ` [PULL 39/41] hw/net/cadence_gem: use FIELD to describe PHYMNTNC " Peter Maydell
2024-01-19 22:32 ` Guenter Roeck
2024-01-19 22:36 ` Guenter Roeck
2023-10-27 14:39 ` [PULL 40/41] hw/net/cadence_gem: perform PHY access on write only Peter Maydell
2023-10-27 14:39 ` [PULL 41/41] hw/net/cadence_gem: enforce 32 bits variable size for CRC Peter Maydell
2023-10-29 23:15 ` [PULL 00/41] target-arm queue Stefan Hajnoczi
2023-10-30 10:09 ` Peter Maydell
2023-10-30 22:09 ` Stefan Hajnoczi
2023-11-02 11:08 ` Peter Maydell
2023-10-31 7:51 ` Stefan Hajnoczi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20231027143942.3413881-26-peter.maydell@linaro.org \
--to=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).