From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: qemu-devel@nongnu.org
Cc: "Thomas Huth" <thuth@redhat.com>, "Sergio Lopez" <slp@redhat.com>,
"Richard Henderson" <richard.henderson@linaro.org>,
qemu-ppc@nongnu.org, "Philippe Mathieu-Daudé" <f4bug@amsat.org>,
"Philippe Mathieu-Daudé" <philmd@linaro.org>,
"Hervé Poussineau" <hpoussin@reactos.org>
Subject: [PATCH 03/11] hw/isa/i82378: Remove intermediate IRQ forwarder
Date: Fri, 10 Feb 2023 17:37:36 +0100 [thread overview]
Message-ID: <20230210163744.32182-4-philmd@linaro.org> (raw)
In-Reply-To: <20230210163744.32182-1-philmd@linaro.org>
From: Philippe Mathieu-Daudé <f4bug@amsat.org>
When the i82378 model was added in commit a04ff940974 ("prep:
Add i82378 PCI-to-ISA bridge emulation") the i8259 model was
not yet QOM'ified. This happened later in commit 747c70af78f
("i8259: Convert to qdev").
Directly dispatch ISA IRQs to 'cpu_intr' output IRQ
by removing the intermediate i82378_request_out0_irq()
handler. Rename ISA IRQs array as 'isa_irqs_in' to
emphasize these are input IRQs.
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
hw/isa/i82378.c | 15 ++++-----------
1 file changed, 4 insertions(+), 11 deletions(-)
diff --git a/hw/isa/i82378.c b/hw/isa/i82378.c
index 84ce761f5f..d32653369d 100644
--- a/hw/isa/i82378.c
+++ b/hw/isa/i82378.c
@@ -33,7 +33,7 @@ struct I82378State {
PCIDevice parent_obj;
qemu_irq cpu_intr;
- qemu_irq *i8259;
+ qemu_irq *isa_irqs_in;
MemoryRegion io;
};
@@ -47,18 +47,12 @@ static const VMStateDescription vmstate_i82378 = {
},
};
-static void i82378_request_out0_irq(void *opaque, int irq, int level)
-{
- I82378State *s = opaque;
- qemu_set_irq(s->cpu_intr, level);
-}
-
static void i82378_request_pic_irq(void *opaque, int irq, int level)
{
DeviceState *dev = opaque;
I82378State *s = I82378(dev);
- qemu_set_irq(s->i8259[irq], level);
+ qemu_set_irq(s->isa_irqs_in[irq], level);
}
static void i82378_realize(PCIDevice *pci, Error **errp)
@@ -94,9 +88,8 @@ static void i82378_realize(PCIDevice *pci, Error **errp)
*/
/* 2 82C59 (irq) */
- s->i8259 = i8259_init(isabus,
- qemu_allocate_irq(i82378_request_out0_irq, s, 0));
- isa_bus_irqs(isabus, s->i8259);
+ s->isa_irqs_in = i8259_init(isabus, s->cpu_intr);
+ isa_bus_irqs(isabus, s->isa_irqs_in);
/* 1 82C54 (pit) */
pit = i8254_pit_init(isabus, 0x40, 0, NULL);
--
2.38.1
next prev parent reply other threads:[~2023-02-10 16:39 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-10 16:37 [PATCH 00/11] hw/isa: More housekeeping Philippe Mathieu-Daudé
2023-02-10 16:37 ` [PATCH 01/11] hw/intc/i8259: Document i8259_init() Philippe Mathieu-Daudé
2023-02-11 17:09 ` Richard Henderson
2023-02-10 16:37 ` [PATCH 02/11] hw/isa/i82378: Rename output IRQ as 'cpu_intr' Philippe Mathieu-Daudé
2023-02-11 17:10 ` Richard Henderson
2023-02-10 16:37 ` Philippe Mathieu-Daudé [this message]
2023-02-11 17:13 ` [PATCH 03/11] hw/isa/i82378: Remove intermediate IRQ forwarder Richard Henderson
2023-02-10 16:37 ` [PATCH 04/11] hw/isa/vt82c686: " Philippe Mathieu-Daudé
2023-02-10 16:37 ` [PATCH 05/11] hw/mips/jazz: Rename ISA input IRQs as 'isa_irqs_in' Philippe Mathieu-Daudé
2023-02-11 17:18 ` Richard Henderson
2023-02-10 16:37 ` [PATCH 06/11] hw/sparc64/sun4u: Keep reference to ISA input IRQs in EbusState Philippe Mathieu-Daudé
2023-02-11 17:30 ` Richard Henderson
2023-02-10 16:37 ` [PATCH 07/11] hw/isa: Reorder to separate ISABus* vs ISADevice* functions Philippe Mathieu-Daudé
2023-02-11 17:32 ` Richard Henderson
2023-02-10 16:37 ` [PATCH 08/11] hw/isa: Un-inline isa_bus_from_device() Philippe Mathieu-Daudé
2023-02-10 16:37 ` [PATCH 09/11] hw/isa: Rename isa_bus_irqs() -> isa_bus_register_input_irqs() Philippe Mathieu-Daudé
2023-02-11 17:37 ` Richard Henderson
2023-02-10 16:37 ` [PATCH 10/11] hw/isa: Use isa_address_space_io() to reduce access on global 'isabus' Philippe Mathieu-Daudé
2023-02-10 16:37 ` [PATCH 11/11] hw/isa: Factor isa_bus_get_irq() out of isa_get_irq() Philippe Mathieu-Daudé
2023-02-11 17:46 ` Richard Henderson
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=20230210163744.32182-4-philmd@linaro.org \
--to=philmd@linaro.org \
--cc=f4bug@amsat.org \
--cc=hpoussin@reactos.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.org \
--cc=richard.henderson@linaro.org \
--cc=slp@redhat.com \
--cc=thuth@redhat.com \
/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).